瀏覽代碼

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

Li Kui 7 月之前
父節點
當前提交
08acaf05f1

+ 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,
+  });
 }
 
 /**