export const getQuery = function (key: string) { if (key) { const search = window.location.search || ''; const reg = new RegExp(`${key}=([^&]+)?`, 'i'); const match = search.match(reg); if (match) { return match[1]; } } };