|
@@ -69,8 +69,10 @@
|
|
|
|
|
|
</view>
|
|
|
|
|
|
+ <view class="btn_submit" @click="onLogout()">退出登录</view>
|
|
|
|
|
|
<view class="blankHeight"></view>
|
|
|
+ <view class="blankHeight"></view>
|
|
|
</view>
|
|
|
|
|
|
|
|
@@ -156,40 +158,36 @@
|
|
|
|
|
|
|
|
|
},
|
|
|
- EditNickname() {
|
|
|
+ onLogout() {
|
|
|
let that = this;
|
|
|
this.$refs['DialogBox'].confirm({
|
|
|
- title: '更改昵称',
|
|
|
- placeholder: '请输入修改的昵称',
|
|
|
- value: that.myinfo.nickname,
|
|
|
- DialogType: 'input',
|
|
|
+ title: '提示',
|
|
|
+ content: '确定退出吗?',
|
|
|
+ DialogType: 'inquiry',
|
|
|
+ btn1: '取消',
|
|
|
+ btn2: '退出',
|
|
|
animation: 0
|
|
|
}).then((res) => {
|
|
|
- if (res.value.length < 1) {
|
|
|
- uni.showToast({
|
|
|
- title: "请输入有效的昵称",
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- that.myinfo.nickname = res.value;
|
|
|
- let obj2 = {
|
|
|
- nickname: res.value
|
|
|
- }
|
|
|
- const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
|
|
|
uni.request({
|
|
|
- url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
|
|
|
- data: postData,
|
|
|
- method: 'POST',
|
|
|
+ url: that.$apiHost + '/My/logout',
|
|
|
+ data: {
|
|
|
+ uuid: getApp().globalData.uuid,
|
|
|
+ skey: getApp().globalData.skey
|
|
|
+ },
|
|
|
header: {
|
|
|
- 'content-type': 'application/json', //自定义请求头信息
|
|
|
- 'Access-Control-Allow-Origin': '*'
|
|
|
+ "content-type": "application/json", //自定义请求头信息
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- uni.showToast({
|
|
|
- title: res.data.str,
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
+ console.log("----:", res.data);
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/login'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ complete: (com) => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ },
|
|
|
+ fail: (e) => {
|
|
|
+ console.log("----e:", e);
|
|
|
}
|
|
|
});
|
|
|
})
|