Browse Source

feature:注销方法修正

feature-1.0
Penny 3 years ago
parent
commit
f323a1f0a6
  1. 71
      pages/userInfo/setting/setting.vue

71
pages/userInfo/setting/setting.vue

@ -10,9 +10,9 @@
</template>
<script>
// import {
// logout
// } from '@/api/auth.js'
import {
logout
} from '@/api/auth.js'
export default {
data() {
return {
@ -67,40 +67,37 @@
// },
methods: {
//
// logoutUser(){
// let that = this;
// uni.showModal({
// title: "",
// content: "",
// showCancel: true,
// success: function(ress){
// if(ress.confirm){
// const param = {
// phone: that.userInfo.phone
// }
// logout(param).then(res => {
// if (res.data.data === true) {
// uni.reLaunch({
// url: '/pages/login/login',
// success() {
// uni.clearStorage();
// uni.showToast({
// title: '!',
// duration: 2000
// });
// }
// });
// } else {
// uni.showModal({
// content: "!",
// showCancel: false,
// });
// }
// });
// }
// }
// });
// }
logoutUser(){
let that = this;
uni.showModal({
title: "提示",
content: "确定注销吗!",
showCancel: true,
success: function(ress){
if(ress.confirm){
logout().then(res => {
if (res.data.code === 200) {
uni.reLaunch({
url: '/pages/index/index',
success() {
uni.clearStorage();
uni.showToast({
title: '注销成功!',
duration: 2000
});
}
});
} else {
uni.showModal({
content: "注销失败,请联系管理员!",
showCancel: false,
});
}
});
}
}
});
}
}
}
</script>

Loading…
Cancel
Save