Commit e95b5504 by 李伟康

commit 退出增加二次确认

1 parent 6eb2b521
......@@ -77,33 +77,41 @@ export default {
})
},
// 退出
async logout () {
this.stopAudio();
try {
uni.showLoading()
const { code, message } = await uni.$api.userApi.logout()
console.log(code)
if (code == 0) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.$storage.rm("noSignInUuid");
setTimeout(() => {
uni.hideLoading()
uni.reLaunch({
url: "/pages/common/login",
});
}, 500)
} else throw message
} catch (error) {
console.log(error)
uni.hideLoading()
uni.showToast({
title: error,
icon: "none",
});
}
logout () {
let _this = this
uni.showModal({
title: '温馨提示',
content: '是否退出当前账号?',
confirmColor: '#347BFF',
async success (res) {
if (res.confirm) {
_this.stopAudio();
try {
uni.showLoading()
const { code, message } = await uni.$api.userApi.logout()
console.log(code)
if (code == 0) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.$storage.rm("noSignInUuid");
setTimeout(() => {
uni.hideLoading()
uni.reLaunch({
url: "/pages/common/login",
});
}, 500)
} else throw message
} catch (error) {
console.log(error)
uni.hideLoading()
uni.showToast({
title: error,
icon: "none",
});
}
}
}
})
},
jump (type) {
let url = type == 'icp' ? 'https://beian.miit.gov.cn/' : 'https://img01.glsx.com.cn/weapp/resource/saas/app/privacy.html'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!