From 863712fa1a71ac06d0090cab6b520808b9520ddb Mon Sep 17 00:00:00 2001 From: mujinxia <1764373892@qq.com> Date: Sat, 24 Feb 2024 18:54:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 10 +- pages/news1/help.vue | 383 +++++++++++++++++++++------------------- pages/news1/setting.vue | 29 ++- 3 files changed, 228 insertions(+), 194 deletions(-) diff --git a/api/user.js b/api/user.js index 2934823..a81879d 100644 --- a/api/user.js +++ b/api/user.js @@ -6,10 +6,14 @@ const api = { assets: 'user/assets', bindMobile: 'user/bindMobile', personal: 'user/personal', - todoCounts: "order/todoCounts" + todoCounts: "order/todoCounts", + delUser: "user/delete", } - -// 当前登录的用户信息 +// 注销 +export const delUser = (param) => { + return request.post(api.delUser, param) +} + // 当前登录的用户信息 export const info = (param, option) => { const options = { isPrompt: true, //(默认 true 说明:本接口抛出的错误是否提示) diff --git a/pages/news1/help.vue b/pages/news1/help.vue index 363431d..c30d75a 100644 --- a/pages/news1/help.vue +++ b/pages/news1/help.vue @@ -2,17 +2,19 @@ 帮助中心 - + - + + - {{item.name}} - + {{ item.name }} + - {{p.title}} + {{ p.title }} @@ -20,12 +22,12 @@ - + @@ -34,217 +36,230 @@ \ No newline at end of file diff --git a/pages/news1/setting.vue b/pages/news1/setting.vue index de46b3d..81c165c 100644 --- a/pages/news1/setting.vue +++ b/pages/news1/setting.vue @@ -171,13 +171,28 @@ export default { content: '', success(o) { if (o.confirm) { - uni.removeStorage('token'); - uni.removeStorage('userInfo'); - uni.clearStorageSync() - uni.clearStorage() - uni.reLaunch({ - url: '/pages/login/index' - }) + userApi.delUser({}) + .then(res => { + if (res.status == 200) { + uni.showToast({ + title: '注销成功', + icon: 'none', + duration: 2000 + }) + uni.removeStorage('token'); + uni.removeStorage('userInfo'); + uni.clearStorageSync() + uni.clearStorage() + setTimeout(function () { + uni.reLaunch({ + url: '/pages/login/index' + }) + }, 2000); + + } + }) + .finally() + } } });