Compare commits

...

2 Commits

Author SHA1 Message Date
0d4c625b10 优化工具发布分类类型参数 2025-09-14 11:21:07 +08:00
dc824592ce 优化用户注销功能及逻辑处理 2025-09-14 11:17:46 +08:00
3 changed files with 20 additions and 2 deletions

View File

@ -157,3 +157,10 @@ export const getUserExtend = () => {
export const cancelSocialBind = (params: { type: number; openid: string }) => {
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/social-user/unbind', { query: params })
}
/**
* 用户注销账号
*/
export const userLogout = () => {
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/user/unregister-user', {})
}

View File

@ -5,14 +5,25 @@
</template>
<script setup lang="ts">
import useUserStore from '~/stores/user'
const userStore = useUserStore()
import { userLogout } from '~/api/personal-center/index'
const handleClick = () => {
console.log('注销账号')
ElMessageBox.confirm('确定注销账号吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
}).then(async () => {
console.log('注销账号')
const res = await userLogout()
if (res.code === 0) {
ElMessage.success('注销成功')
navigateTo('/')
clearNuxtState(['token', 'userInfo'])
userStore.logout()
userStore.$reset()
}
})
}
</script>

View File

@ -187,7 +187,7 @@
/** 获取分类下拉框 */
const getParent = () => {
parent({
type: 1,
type: 3,
parentId: 0,
}).then((res) => {
projectTypeList.value = res.data