auth.js 313 B

12345678910111213
  1. export function getCurrentAuthority() {
  2. return ["user"];
  3. }
  4. export function check(authority) {
  5. const current = getCurrentAuthority();
  6. return current.some(item => authority.includes(item));
  7. }
  8. export function isLogin() {
  9. const current = getCurrentAuthority();
  10. return current && current[0] !== "guest";
  11. }