bug修改

This commit is contained in:
姚亚男
2021-10-26 14:04:29 +08:00
parent 15f270faf2
commit ad6c0afd9e
36 changed files with 294 additions and 122 deletions
+21 -12
View File
@@ -9,6 +9,7 @@ Page({
data: {
userId: '',
name: '',
avatarUrl: '', // 头像
phone: '未知手机号',
rsaPublicKey: '',
},
@@ -37,17 +38,12 @@ Page({
success(res) {
if (res.confirm) {
UserApi.wxUnbind().then(res => {
if (res.success) {
wx.clearStorage()
wx.redirectTo({
url: '../login/login',
})
} else {
wx.clearStorage()
wx.redirectTo({
url: '../login/login',
})
}
wx.removeStorage({key:'userInfo'})
wx.removeStorage({key:'X-Access-Token'})
wx.removeStorage({key:'avatarUrl'})
wx.redirectTo({
url: '../login/login',
})
})
} else if (res.cancel) {}
}
@@ -115,7 +111,9 @@ Page({
success(res) {
if (res.confirm) {
UserApi.logout().then(res => {
wx.clearStorage()
wx.removeStorage({key:'userInfo'})
wx.removeStorage({key:'X-Access-Token'})
wx.removeStorage({key:'avatarUrl'})
wx.redirectTo({
url: '../login/login',
})
@@ -124,6 +122,17 @@ Page({
}
})
},
onLoad(){
const that = this
wx.getStorage({
key: 'avatarUrl',
success(res){
that.setData({
avatarUrl: res.data
})
}
})
},
/**
* 生命周期函数--监听页面显示
*/