Преглед на файлове

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

Li Kui преди 1 година
родител
ревизия
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,
+  });
 }
 
 /**