Commit e95b5504 by 李伟康

commit 退出增加二次确认

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