修复bug以及优化

This commit is contained in:
2026-06-02 16:23:56 +08:00
parent 5cc680f26d
commit a82c8da013
17 changed files with 529 additions and 110 deletions

View File

@@ -129,7 +129,6 @@
data() {
const life = uni.getStorageSync('lifeData') || {}
return {
user:{},
bgPath1: '/public/static/center/my-bg.png',
bgPath2: '/public/static/center/my-bg2.png',
unsignContractNum:0,
@@ -163,8 +162,11 @@
},
staticHost() {
return this.$config.staticUrl
}
},
user() {
return uni.getStorageSync('userInfo') || {}
}
},
onLoad() {
@@ -177,7 +179,6 @@
onUnload() {
uni.$off('updateAvatar')
},
onShow() {
this.$checkToken(this.$getToken())
this.loadUserInfo()
@@ -193,14 +194,18 @@
loadUserInfo(){
let userInfo = uni.getStorageSync('userInfo');
if(!userInfo) {
console.log("缓存中用户信息为空")
return
}
console.log(userInfo)
console.log("查询用户信息")
let url = `/login/userInfo`;
this.$u.get(url, {}, {
'WT': this.$getToken(),
'USERTYPE': userInfo.userType
}).then(obj => {
if(obj.flag){
console.log("更新缓存中用户信息")
uni.setStorageSync('userInfo', {
userType: obj.data.userType,
oaAuth: obj.data.oaAuth,
@@ -211,7 +216,7 @@
})
}
});
this.user = uni.getStorageSync('userInfo');
},
logout() {
this.$u.vuex('vuex_token', '');