From 2fbc3583e889ef87cc3c13c8c3f8ef3e4ce51de3 Mon Sep 17 00:00:00 2001
From: fanpeng <438123081@qq.com>
Date: Tue, 15 Jul 2025 14:39:32 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=9B=B4=E6=96=B0?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E5=92=8CAPI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 2 +-
api/user.js | 9 ++
pages.json | 7 ++
pages/main/mine.vue | 26 ++++-
pages/user/deleteAccount.vue | 183 +++++++++++++++++++++++++++++++++++
pages/user/login.vue | 6 +-
stores/basic.js | 5 +
7 files changed, 232 insertions(+), 6 deletions(-)
create mode 100644 pages/user/deleteAccount.vue
diff --git a/App.vue b/App.vue
index ab386a2..412bcca 100644
--- a/App.vue
+++ b/App.vue
@@ -31,7 +31,7 @@
return 'XHJ'
}
// #endif
- return 'PRE'
+ return 'XHJ'
}
},
computed: {
diff --git a/api/user.js b/api/user.js
index a1f1916..2024731 100644
--- a/api/user.js
+++ b/api/user.js
@@ -155,6 +155,15 @@ export function getWebUrlRequest(data) {
})
}
+// 删除账号
+export function deleteAccountRequest(data) {
+ return request({
+ url: '/user/delete',
+ method: 'POST',
+ data
+ })
+}
+
// 退出登录
export function logoutRequest(data) {
return request({
diff --git a/pages.json b/pages.json
index ec3235c..c35a594 100644
--- a/pages.json
+++ b/pages.json
@@ -150,6 +150,13 @@
"style": {
"navigationBarTitleText": "安全验证"
}
+ },
+ {
+ "path": "deleteAccount",
+ "style": {
+ "navigationBarTitleText": "删除账号",
+ "disableScroll": true
+ }
}
]
},
diff --git a/pages/main/mine.vue b/pages/main/mine.vue
index 42e9c8e..73f9714 100644
--- a/pages/main/mine.vue
+++ b/pages/main/mine.vue
@@ -77,6 +77,7 @@
退出
+ 删除账号
@@ -175,6 +176,19 @@
'getUserInfo',
'checkSession'
]),
+ deleteAccount() {
+ uni.showModal({
+ title: '提示',
+ content: '删除账号后,你的所有信息及相关记录都会从平台彻底删除,且不可恢复,是否删除?',
+ success: res => {
+ if (res.confirm) {
+ this.routeJump({
+ name: 'deleteAccount'
+ })
+ }
+ }
+ })
+ },
selectEnv(env) {
setStorage('envVersion', env.key)
removeStorage('token')
@@ -364,7 +378,7 @@
.switch-account {
position: absolute;
- bottom: 60rpx;
+ bottom: 120rpx;
width: 600rpx;
height: 80rpx;
margin-left: 75rpx;
@@ -377,9 +391,17 @@
border-radius: 46rpx;
}
+ .delete-account {
+ position: absolute;
+ right: 75rpx;
+ bottom: 60rpx;
+ font-size: 28rpx;
+ color: #666;
+ }
+
.env {
position: absolute;
- bottom: 180rpx;
+ bottom: 240rpx;
width: 600rpx;
margin-left: 75rpx;
line-height: 80rpx;
diff --git a/pages/user/deleteAccount.vue b/pages/user/deleteAccount.vue
new file mode 100644
index 0000000..c72c235
--- /dev/null
+++ b/pages/user/deleteAccount.vue
@@ -0,0 +1,183 @@
+
+
+ 为了你的账号安全,删除账号前请先使用验证码验证
+
+
+ {{ text }}
+
+ 验证
+
+
+
+
+
+
+
+
diff --git a/pages/user/login.vue b/pages/user/login.vue
index f218b2e..c58f46b 100644
--- a/pages/user/login.vue
+++ b/pages/user/login.vue
@@ -94,10 +94,10 @@
abbreviation: 'CN',
group: 'Z'
})
- const username = ref('18174429647')
- const password = ref('..022059')
+ const username = ref('')
+ const password = ref('')
- const select = ref(true)
+ const select = ref(false)
const pending = ref(false)
diff --git a/stores/basic.js b/stores/basic.js
index b290053..519a851 100644
--- a/stores/basic.js
+++ b/stores/basic.js
@@ -431,6 +431,11 @@ const pages = [
name: 'safeVerify',
path: '/pages/user/safeVerify',
tabBar: false
+ },
+ {
+ name: 'deleteAccount',
+ path: '/pages/user/deleteAccount',
+ tabBar: false
}
]