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
})
}
})
},
/**
* 生命周期函数--监听页面显示
*/
+2 -1
View File
@@ -1,4 +1,5 @@
{
"navigationBarTitleText": "我的",
"usingComponents": {},
"navigationStyle": "custom"
}
}
+2 -1
View File
@@ -5,7 +5,8 @@
<!-- 顶部选项栏 -->
<view class="select-box">
<view class="avator">
<image src="../../assets/images/tx.png"></image>
<image wx:if="{{!avatarUrl}}" src="../../assets/images/tx.png"></image>
<image wx:if="{{avatarUrl}}" src="{{avatarUrl}}"></image>
<view class="info">
<text wx:if="{{!name}}" bindtap="goLogin">未登录</text>
<text wx:if="{{name}}">{{name}}</text>