From 10ebf036984b6007ed6220fc863e0bf20bdec33d Mon Sep 17 00:00:00 2001 From: Netfan Date: Sun, 16 Feb 2025 23:06:20 +0800 Subject: [PATCH] fix: auth api definition --- playground/src/api/core/auth.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/playground/src/api/core/auth.ts b/playground/src/api/core/auth.ts index 71d9f994..b4627cbe 100644 --- a/playground/src/api/core/auth.ts +++ b/playground/src/api/core/auth.ts @@ -22,23 +22,29 @@ export namespace AuthApi { * 登录 */ export async function loginApi(data: AuthApi.LoginParams) { - return requestClient.post('/auth/login', data); + return requestClient.post('/auth/login', data, { + withCredentials: true, + }); } /** * 刷新accessToken */ export async function refreshTokenApi() { - return baseRequestClient.post('/auth/refresh', { - withCredentials: true, - }); + return baseRequestClient.post( + '/auth/refresh', + null, + { + withCredentials: true, + }, + ); } /** * 退出登录 */ export async function logoutApi() { - return baseRequestClient.post('/auth/logout', { + return baseRequestClient.post('/auth/logout', null, { withCredentials: true, }); }