export default function getQueryString(query, name) {
  if (!query) return '';
  const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  const r = query.match(reg);
  return r !== null ? unescape(r[2]) : '';
}