我的页面
This commit is contained in:
+23
-2
@@ -1,11 +1,12 @@
|
||||
// pages/mine/mine.js
|
||||
import UserApi from '../../assets/js/http/userApi'
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
userId: ''
|
||||
},
|
||||
// 个人信息
|
||||
mineInfo(){
|
||||
@@ -41,11 +42,31 @@ Page({
|
||||
url: '../mineContract/mineContract',
|
||||
})
|
||||
},
|
||||
// 退出登录
|
||||
logout(){
|
||||
wx.showModal({
|
||||
cancelColor: '取消',
|
||||
content: '确定退出登录?',
|
||||
confirmColor: '#069F99',
|
||||
success (res) {
|
||||
if (res.confirm) {
|
||||
UserApi.logout().then(res=>{
|
||||
if(res.success){
|
||||
wx.clearStorage()
|
||||
wx.redirectTo({
|
||||
url: '../login/login',
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,6 +72,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="logout">
|
||||
<text>退出登录</text>
|
||||
<text bindtap="logout">退出登录</text>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user