refactor: ♻️ 我的页面重构
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
const TOKEN_KEY = "app-token";
|
||||
|
||||
function getToken(): string {
|
||||
return uni.getStorageSync(TOKEN_KEY) || "";
|
||||
}
|
||||
|
||||
function setToken(token: string) {
|
||||
return uni.setStorageSync(TOKEN_KEY, token);
|
||||
}
|
||||
|
||||
function clearToken() {
|
||||
return uni.removeStorageSync(TOKEN_KEY);
|
||||
}
|
||||
|
||||
function isLogin(): boolean {
|
||||
return !!getToken();
|
||||
}
|
||||
|
||||
export { getToken, setToken, clearToken, isLogin };
|
||||
Reference in New Issue
Block a user