utils.ts 353 Bytes
Newer Older
xiaohuoni's avatar
xiaohuoni committed
1
import { parse } from 'query-string';
2 3 4 5

export function getPageQuery() {
  return parse(window.location.href.split('?')[1]);
}
陈帅's avatar
陈帅 committed
6 7 8 9 10

export function setAuthority(authority: string | string[]) {
  const proAuthority = typeof authority === 'string' ? [authority] : authority;
  return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));
}