前端:增加注册登陆
前端:个人信息修改
This commit is contained in:
@@ -22,6 +22,11 @@ export function getLoginToken() {
|
||||
return res;
|
||||
}
|
||||
|
||||
export function clearLoginToken() {
|
||||
removeLocalStorage(cacheKeys.accessTokenKey);
|
||||
removeLocalStorage(cacheKeys.refreshTokenKey);
|
||||
}
|
||||
|
||||
export function getAccessToken() {
|
||||
return getLocalStorage(cacheKeys.accessTokenKey);
|
||||
}
|
||||
@@ -43,4 +48,12 @@ function getLocalStorage(key) {
|
||||
} catch (e) {
|
||||
throw new Error(`localStorage 获取错误! ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
function removeLocalStorage(key) {
|
||||
try {
|
||||
localStorage.removeItem(key);
|
||||
} catch (e) {
|
||||
throw new Error(`localStorage 设置错误! ${e}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user