修复校验
This commit is contained in:
@@ -35,9 +35,7 @@
|
||||
|
||||
<!-- 退出登录按钮 -->
|
||||
<view class="logout-btn-wrap">
|
||||
<button class="logout-btn" @tap="handleLogout">
|
||||
退出登录
|
||||
</button>
|
||||
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -46,6 +44,7 @@
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { logout, getSettingInfo } from '../../api/api.js'
|
||||
import { clearPermList } from '../../utils/permissions.js'
|
||||
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('') // 绑定手机号
|
||||
@@ -91,9 +90,9 @@ const goToModifyPassword = () => {
|
||||
})
|
||||
}
|
||||
// 跳转到注销账号
|
||||
const goToDeleteAccount = () =>{
|
||||
const goToDeleteAccount = () => {
|
||||
uni.navigateTo({
|
||||
url:'/pageSubPack/setting/deleteAccount'
|
||||
url: '/pageSubPack/setting/deleteAccount'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -116,19 +115,23 @@ const handleLogout = () => {
|
||||
const confirmLogout = () => {
|
||||
uni.showLoading({ title: '退出中...' })
|
||||
|
||||
logout().then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.clearStorageSync()
|
||||
uni.showToast({ title: '退出登录成功', icon: 'success' })
|
||||
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.showToast({ title: '退出失败,请重试', icon: 'none' })
|
||||
}).finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
logout()
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
clearPermList()
|
||||
uni.clearStorageSync()
|
||||
uni.showToast({ title: '退出登录成功', icon: 'success' })
|
||||
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({ title: '退出失败,请重试', icon: 'none' })
|
||||
})
|
||||
.finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user