mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 05:50:18 +08:00
refactor(projects): 完善路由配置
This commit is contained in:
21
src/utils/auth/user.ts
Normal file
21
src/utils/auth/user.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import type { LoginModuleType } from '@/interface';
|
||||
import { setLocal, getLocal } from '../storage';
|
||||
|
||||
/** 设置token */
|
||||
export function getToken() {
|
||||
return getLocal<string>(EnumStorageKey.token) || '';
|
||||
}
|
||||
|
||||
/** 获取token */
|
||||
export function setToken(token: string) {
|
||||
setLocal(EnumStorageKey.token, token);
|
||||
}
|
||||
|
||||
export function getUserInfo() {}
|
||||
|
||||
/** 获取登录模块的正则字符串 */
|
||||
export function getLoginModuleRegExp() {
|
||||
const arr: LoginModuleType[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
|
||||
return arr.join('|');
|
||||
}
|
||||
Reference in New Issue
Block a user