Update token handling and user state management

This commit is contained in:
wangqiao
2025-08-25 22:51:06 +08:00
parent 63fa551041
commit 7291768b03
5 changed files with 41 additions and 3 deletions

View File

@ -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();
}