This commit is contained in:
2024-02-02 22:31:01 +08:00
parent 06a5f041bf
commit 486ea5013a
77 changed files with 17507 additions and 122 deletions

15
src/utils/auth/index.ts Normal file
View File

@@ -0,0 +1,15 @@
const TokenKey = 'admin-token';
const TokenPrefix = 'Bearer ';
function isLogin() {
return !!uni.getStorageSync(TokenKey);
}
function getToken() {
return uni.getStorageSync(TokenKey);
}
function setToken(token: string) {
uni.setStorageSync(TokenKey, token);
}
function clearToken() {
uni.removeStorageSync(TokenKey);
}
export { TokenPrefix, isLogin, getToken, setToken, clearToken };