mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-06-07 06:22:27 +08:00
修复bug以及优化
This commit is contained in:
@@ -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', '');
|
||||
|
||||
Reference in New Issue
Block a user