1.新增退出功能

master
杨杰 2 years ago
parent 540f485ed0
commit 5724deb764
  1. 4
      high-unionPay/Utils/Api.js
  2. 60
      high-unionPay/pages/tabBar/user/user.vue

@ -565,6 +565,10 @@ export const phone = params => {
export const findUser = params => {
return POST('POST', `${userbase}/getUserDetail`, params).then(res => res.data);
}
// 退出登录
export const loginOut = params => {
return POST('POST', `${userbase}/login/out`, params).then(res => res.data);
}
// 获取用户余额
export const getUserAccount = params => {

@ -174,6 +174,7 @@
<script>
import {
findUser,
loginOut,
getUserAccount,
getUserOrderList,
orderCheck
@ -258,6 +259,10 @@
url: '../../login/updatePas/updatePas',
text: '支付密码',
img: '../../../static/img/user/user11.png'
}, {
url: '',
text: '退出登录',
img: '../../../static/img/user/user12.png'
}, {
url: '',
text: '客服',
@ -275,6 +280,10 @@
url: '../../login/updatePas/resetPas',
text: '支付密码',
img: '../../../static/img/user/user11.png'
}, {
url: '',
text: '退出登录',
img: '../../../static/img/user/user12.png'
},
{
url: '',
@ -496,12 +505,59 @@
})
},
toPage(url, item) {
let that = this;
if (item != '客服') {
uni.navigateTo({
url: url
})
} else {
this.playPhone();
}
if (item == '客服') {
that.playPhone();
}
if (item == '退出登录') {
uni.showModal({
title: '退出登录',
content: '是否退出当前账号',
success: function(res) {
if (res.confirm) {
loginOut().then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = '';
app.globalData.token = '';
that.textnum = '';
that.textSend = '';
that.therrNum = '';
that.whetherCheckNum = '';
that.orderPayNum = '';
that.rechargeOrderNum = '';
that.userphone = '';
that.user = '';
uni.setStorage({
key: "user",
data: ''
})
uni.setStorage({
key: "token",
data: ''
})
// location.reload();
uni.showToast({
title: '退出成功',
icon: 'none',
duration: 1500,
success() {
setTimeout(() => {
uni.switchTab({
url: '/pages/tabBar/home/home'
})
}, 1500);
}
})
}
});
}
}
})
}
},

Loading…
Cancel
Save