xy 1 year ago
parent
commit
34e975f9f6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      xs-app/stores/userDataManager.ts

+ 2 - 1
xs-app/stores/userDataManager.ts

@@ -9,7 +9,8 @@ export const UserData = defineStore('user-data',()=>{
 		if(!data.token) {
 			let string = util.getStorage(config.storage_key.USER_DATA)
 			if(string) {
-				data = JSON.parse(string)
+				// data = JSON.parse(string)  响应式对象无法被改变
+				Object.assign(data,JSON.parse(string))  // 使用此方法赋值给相应对象
 			}
 		}
 		return data