fix:最新版本

This commit is contained in:
李伊帆
2026-10-21 17:09:53 +08:00
parent 83a1e961ea
commit e4276b0853
106 changed files with 1587 additions and 992 deletions

View File

@@ -15,6 +15,8 @@ function maskPhone(phone?: string): string {
export function usePrivacy() {
const phone = ref('')
const cancelAccountDialogVisible = ref(false)
const cancelingAccount = ref(false)
const sections = computed<PrivacySection[]>(() => [
{
@@ -66,25 +68,23 @@ export function usePrivacy() {
return
}
if (itemId === 'delete-account') {
uni.showModal({
title: '注销账号',
content: '注销后账号及所有数据将被永久删除,且无法恢复。确定继续吗?',
confirmColor: '#f04438',
success: (res) => {
if (!res.confirm) return
void (async () => {
try {
await cancelAccount()
teardownMessageInbox()
clearStoredToken()
uni.showToast({ title: '账号已注销', icon: 'success' })
uni.reLaunch({ url: '/pages/login/index' })
} catch (err) {
uni.showToast({ title: getErrorMessage(err, '注销失败'), icon: 'none' })
}
})()
},
})
cancelAccountDialogVisible.value = true
}
}
async function onConfirmCancelAccount() {
if (cancelingAccount.value) return
cancelingAccount.value = true
try {
await cancelAccount()
teardownMessageInbox()
clearStoredToken()
uni.showToast({ title: '账号已注销', icon: 'success' })
uni.reLaunch({ url: '/pages/login/index' })
} catch (err) {
uni.showToast({ title: getErrorMessage(err, '注销失败'), icon: 'none' })
} finally {
cancelingAccount.value = false
}
}
@@ -118,7 +118,9 @@ export function usePrivacy() {
return {
sections,
cancelAccountDialogVisible,
onItemTap,
onLogout,
onConfirmCancelAccount,
}
}