feat:客服
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { computed, ref } from 'vue'
|
||||
import { logout } from '@/api/auth'
|
||||
import { cancelAccount, logout } from '@/api/auth'
|
||||
import { fetchProfile } from '@/api/profile'
|
||||
import { getErrorMessage } from '@/utils/api-error'
|
||||
import { teardownMessageInbox } from '@/hooks/use-message-inbox'
|
||||
@@ -58,7 +58,7 @@ export function usePrivacy() {
|
||||
|
||||
function onItemTap(itemId: string) {
|
||||
if (itemId === 'password') {
|
||||
uni.navigateTo({ url: '/pages/mine/set-password/verify/index' })
|
||||
uni.navigateTo({ url: '/pages/forgot-password/index?from=privacy' })
|
||||
return
|
||||
}
|
||||
if (itemId === 'phone') {
|
||||
@@ -72,7 +72,17 @@ export function usePrivacy() {
|
||||
confirmColor: '#f04438',
|
||||
success: (res) => {
|
||||
if (!res.confirm) return
|
||||
uni.showToast({ title: '注销功能待对接', icon: 'none' })
|
||||
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' })
|
||||
}
|
||||
})()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user