Update token handling and user state management
This commit is contained in:
@ -38,10 +38,12 @@ export default defineStore("useUserStore", {
|
||||
}
|
||||
},
|
||||
async getUserInfo() {
|
||||
const user = useUserInfo();
|
||||
const res = await getUserInfo();
|
||||
if (res.code === 0) {
|
||||
this.userInfoRes = res.data;
|
||||
refreshToken.setUserInfo(res.data);
|
||||
user.value = res.data;
|
||||
// 建立连接mqtt
|
||||
this.connectMqtt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user