Browse Source

处理登录数据正在处理,请勿重复提交

kwenhao 1 year ago
parent
commit
f743a89b53
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/utils/request.js

+ 4 - 1
src/utils/request.js

@@ -31,6 +31,8 @@ service.interceptors.request.use(
     // 是否存在列表查询
     const isQueryList =
       config.url.includes("/list") || config.url.includes("/query");
+    //是否存在其他登录方式
+    const isSSO = config.url.includes("/login/sso");
     if (getToken() && !isToken) {
       config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
     }
@@ -44,6 +46,7 @@ service.interceptors.request.use(
     if (
       !isRepeatSubmit &&
       !isQueryList &&
+      !isSSO &&
       (config.method === "post" || config.method === "put")
     ) {
       const requestObj = {
@@ -114,7 +117,7 @@ service.interceptors.response.use(
             url: res.config.url,
             data: res.config.data,
             method: res.config.method,
-            params: { ...res.config.params, DName: "蒙奇·D·伟涛" },
+            params: { ...res.config.params},
           });
         }
       } catch (err) {