feat: 完成全部接口替换为新后端接口

This commit is contained in:
R524809
2026-10-19 13:19:07 +08:00
parent 8de06ce66b
commit 997042789d
40 changed files with 1946 additions and 785 deletions
+6 -19
View File
@@ -1,5 +1,6 @@
import { apiRequest } from '../../services/api-request';
import { disablePageShareMenu } from '../../base/pageMixin';
import { clearUser } from '../../utils/auth';
import { clearUser, refreshUser } from '../../utils/auth';
Page({
onLoad() {
@@ -22,15 +23,8 @@ Page({
async doClearProfile() {
wx.showLoading({ title: '处理中...', mask: true });
try {
const res = await wx.cloud.callFunction({
name: 'userSettings',
data: { action: 'clearProfile' },
});
const result = (res?.result as any) || {};
if (result.code !== 0) {
throw new Error(result.message || '操作失败');
}
clearUser();
await apiRequest('/me/profile', { method: 'DELETE' });
await refreshUser();
wx.hideLoading();
wx.showToast({ title: '已删除', icon: 'success' });
} catch (e) {
@@ -58,15 +52,8 @@ Page({
async doDeleteAccount() {
wx.showLoading({ title: '处理中...', mask: true });
try {
const res = await wx.cloud.callFunction({
name: 'userSettings',
data: { action: 'deleteAccount' },
});
const result = (res?.result as any) || {};
if (result.code !== 0) {
throw new Error(result.message || '操作失败');
}
clearUser();
await apiRequest('/me', { method: 'DELETE' });
clearUser(true);
wx.hideLoading();
wx.reLaunch({ url: '/pages/home/home' });