diff --git a/apps/web-antd/src/api/core/auth.ts b/apps/web-antd/src/api/core/auth.ts index 71d9f994..a91359c2 100644 --- a/apps/web-antd/src/api/core/auth.ts +++ b/apps/web-antd/src/api/core/auth.ts @@ -5,11 +5,12 @@ export namespace AuthApi { export interface LoginParams { password?: string; username?: string; + code?: string; } /** 登录接口返回值 */ export interface LoginResult { - accessToken: string; + token: string; } export interface RefreshTokenResult { @@ -22,7 +23,19 @@ export namespace AuthApi { * 登录 */ export async function loginApi(data: AuthApi.LoginParams) { - return requestClient.post('/auth/login', data); + return requestClient.post('login', { + phone: data.username, + password: data.password, + code: data.code, + }); +} +/** + * 发送验证码 + */ +export async function sendVerificationCode(username: string) { + return requestClient.post('send-verification-code', { + username, + }); } /** @@ -38,7 +51,7 @@ export async function refreshTokenApi() { * 退出登录 */ export async function logoutApi() { - return baseRequestClient.post('/auth/logout', { + return baseRequestClient.post('logout', { withCredentials: true, }); } @@ -47,5 +60,5 @@ export async function logoutApi() { * 获取用户权限码 */ export async function getAccessCodesApi() { - return requestClient.get('/auth/codes'); + return requestClient.get('auth/codes'); } diff --git a/apps/web-antd/src/layouts/auth.vue b/apps/web-antd/src/layouts/auth.vue index 18d415bc..4cefdce0 100644 --- a/apps/web-antd/src/layouts/auth.vue +++ b/apps/web-antd/src/layouts/auth.vue @@ -8,6 +8,7 @@ import { $t } from '#/locales'; const appName = computed(() => preferences.app.name); const logo = computed(() => preferences.logo.source); +// const logo = 'https://xiaokang88.oss-cn-hangzhou.aliyuncs.com/logo.png?Expires=1734595037&OSSAccessKeyId=TMP.3KhpnCAjxkdTGWSj1ZCdYe3e9c6MBfEVZwN1CiHdUKUAT2D1mPEpACYgYMkUiQDVqy9Zqb7VqgUoh21W37FC3CztogHJPN&Signature=KmymeelO2OZxaAmvm2ACDK5UfF8%3D';