V001
This commit is contained in:
1 parent
d5d4a6f3bf
commit
fb1a79a3e9
27 files changed
+708
-75
No files matched your search
@@ -34,6 +34,13 @@ export const useLoginProfileStore = defineStore("loginProfile", {
|
||||
updateJwtInfo(jwtInfo: JwtInfo) {
|
||||
storage.set(JWT_STORAGE_ID, "Bearer " + jwtInfo.AccessToken);
|
||||
storage.set(JWT_REFRESHKEY_STORAGE_ID, jwtInfo.RefreshToken);
|
||||
// 同时同步内存里的登录信息:否则别处读 loginProfile.Token 拿到的还是旧令牌
|
||||
if (this.loginProfile?.Token) {
|
||||
this.loginProfile.Token.AccessToken = jwtInfo.AccessToken;
|
||||
this.loginProfile.Token.RefreshToken = jwtInfo.RefreshToken;
|
||||
this.loginProfile.Token.CreatedTime = jwtInfo.CreatedTime;
|
||||
storage.set(LOGIN_PROFILE_STORAGE_ID, JSON.stringify(this.loginProfile));
|
||||
}
|
||||
},
|
||||
getToken() {
|
||||
return storage.get(JWT_STORAGE_ID);
|
||||
|
||||
Reference in new issue
Block a user