Browse Source

Merge remote-tracking branch 'origin/feature/asyncOrder' into feature/asyncOrder

qzy 1 month ago
parent
commit
116acf3aed
1 changed files with 26 additions and 1 deletions
  1. 26 1
      pages/personal/personal.vue

+ 26 - 1
pages/personal/personal.vue

@@ -86,6 +86,7 @@
 				</view>
 			</view>
 			<button class="btn exit" @click="exitLogin()">退出登录</button>
+			<button class="btn exit" @click="cancelAccount()">注销账号</button>
 		</view>
 		<view class="version">
 		<view>
@@ -211,6 +212,30 @@
 						}
 					}
 				});
+			},
+			cancelAccount() {
+				let param = {
+					id: this.getUser().id
+				};
+				uni.showModal({
+					title: '提示',
+					content: '确定注销账号?',
+					success: res => {
+						if (res.confirm) {
+							uni.removeStorageSync('token');
+							uni.removeStorageSync('info');
+							uni.removeStorageSync('menu');
+							uni.redirectTo({
+								url: '/pages/login/login'
+							});
+							this.http.request({
+								url: '/sp-admin/app/AppUser/delete',
+								data: param,
+								success: res => {}
+							});
+						}
+					}
+				});
 			}
 		}
 	};
@@ -289,4 +314,4 @@
 		color: #888484;
 		text-align: center;
 	}
-</style>
+</style>