From 04e21969424ec048cbb4256cb188e18ad8b18b00 Mon Sep 17 00:00:00 2001 From: chenghuan Date: Fri, 12 Dec 2025 11:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/modules/auth.ts | 4 ++-- api/modules/common.ts | 2 +- api/modules/user.ts | 4 ++-- pages/course/index.vue | 18 ++++++++---------- pages/login/forget.vue | 10 ++++++---- pages/login/login.vue | 13 +++++++------ style/tailwind.css | 36 ++++++++++++++++++++++++++++++++++++ types/{user.ts => user.d.ts} | 7 ++++--- 8 files changed, 66 insertions(+), 28 deletions(-) rename types/{user.ts => user.d.ts} (93%) diff --git a/api/modules/auth.ts b/api/modules/auth.ts index 651f47c..ed095e7 100644 --- a/api/modules/auth.ts +++ b/api/modules/auth.ts @@ -8,7 +8,7 @@ import type { ILoginResponse } from '@/types/user' * @param code 验证码 */ export async function loginWithCode(tel: string, code: string) { - const res = await mainClient.request>({ + const res = await mainClient.request({ url: 'book/user/registerOrLogin', method: 'GET', data: { tel, code } @@ -22,7 +22,7 @@ export async function loginWithCode(tel: string, code: string) { * @param password 密码 */ export async function loginWithPassword(phone: string, password: string) { - const res = await mainClient.request>({ + const res = await mainClient.request({ url: 'book/user/login', method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, diff --git a/api/modules/common.ts b/api/modules/common.ts index f8860ae..2871b65 100644 --- a/api/modules/common.ts +++ b/api/modules/common.ts @@ -22,7 +22,7 @@ export const commonApi = { * @param id 协议 ID (111: 用户协议, 112: 隐私政策) */ getAgreement: async (id: number) => { - const res = await mainClient.request>({ + const res = await skeletonClient.request>({ url: 'sys/agreement/getAgreement', method: 'POST', data: { id } diff --git a/api/modules/user.ts b/api/modules/user.ts index 302164f..1663d5e 100644 --- a/api/modules/user.ts +++ b/api/modules/user.ts @@ -1,5 +1,5 @@ // api/modules/user.ts -import { mainClient } from '@/api/clients/main' +import { mainClient, skeletonClient } from '@/api/clients' import { paymentClient } from '@/api/clients/payment' import type { IApiResponse } from '@/api/types' import type { @@ -17,7 +17,7 @@ import { SERVICE_MAP } from '@/api/config' * 获取用户信息 */ export async function getUserInfo() { - const res = await mainClient.request>({ + const res = await skeletonClient.request>({ url: 'common/user/getUserInfo', method: 'POST' }) diff --git a/pages/course/index.vue b/pages/course/index.vue index 829ac1e..ca99dd9 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -220,18 +220,16 @@ diff --git a/pages/login/forget.vue b/pages/login/forget.vue index 96c2570..a954a3b 100644 --- a/pages/login/forget.vue +++ b/pages/login/forget.vue @@ -1,6 +1,8 @@