소스 검색

fix: solve the problem of recursive call to logout api (#4265)

Li Kui 7 달 전
부모
커밋
08acaf05f1
4개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 1
      apps/web-antd/src/api/core/auth.ts
  2. 3 1
      apps/web-ele/src/api/core/auth.ts
  3. 3 1
      apps/web-naive/src/api/core/auth.ts
  4. 3 1
      playground/src/api/core/auth.ts

+ 3 - 1
apps/web-antd/src/api/core/auth.ts

@@ -42,7 +42,9 @@ export async function refreshTokenApi() {
  * 退出登录
  */
 export async function logoutApi() {
-  return requestClient.post('/auth/logout');
+  return baseRequestClient.post('/auth/logout', {
+    withCredentials: true,
+  });
 }
 
 /**

+ 3 - 1
apps/web-ele/src/api/core/auth.ts

@@ -42,7 +42,9 @@ export async function refreshTokenApi() {
  * 退出登录
  */
 export async function logoutApi() {
-  return requestClient.post('/auth/logout');
+  return baseRequestClient.post('/auth/logout', {
+    withCredentials: true,
+  });
 }
 
 /**

+ 3 - 1
apps/web-naive/src/api/core/auth.ts

@@ -42,7 +42,9 @@ export async function refreshTokenApi() {
  * 退出登录
  */
 export async function logoutApi() {
-  return requestClient.post('/auth/logout');
+  return baseRequestClient.post('/auth/logout', {
+    withCredentials: true,
+  });
 }
 
 /**

+ 3 - 1
playground/src/api/core/auth.ts

@@ -42,7 +42,9 @@ export async function refreshTokenApi() {
  * 退出登录
  */
 export async function logoutApi() {
-  return requestClient.post('/auth/logout');
+  return baseRequestClient.post('/auth/logout', {
+    withCredentials: true,
+  });
 }
 
 /**