Bladeren bron

Fix 修复重新授权后url参数错误的问题

Yue 2 jaren geleden
bovenliggende
commit
381bb7ecfb
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3 3
      UI/XYH.APP/src/core/services/RequestService.ts

+ 3 - 3
UI/XYH.APP/src/core/services/RequestService.ts

@@ -41,7 +41,7 @@ function beforeRequest(config: any) {
     config.header["Content-Type"] = config.contentType
     config.header["Content-Type"] = config.contentType
   }
   }
   // 映射params参数
   // 映射params参数
-  if (config.params) {
+  if (config.params && config.retryCount == 0) {
     const url = config.url + "?" + tansParams(config.params).slice(0, -1)
     const url = config.url + "?" + tansParams(config.params).slice(0, -1)
     config.url = url
     config.url = url
   }
   }
@@ -79,10 +79,10 @@ function handleResponse(result: any, config: any, resolve: (v: any) => void, rej
     if (code === 401) {
     if (code === 401) {
       if (config.retryCount < 2) {
       if (config.retryCount < 2) {
         config.retryCount = config.retryCount + 1
         config.retryCount = config.retryCount + 1
-        console.log("RS Retry", new Date(), config.retryCount)
+        //console.log("RS Retry", new Date(), config.retryCount)
         setTimeout(() => {
         setTimeout(() => {
           appStore.authStore.xcxLogin().then(() => {
           appStore.authStore.xcxLogin().then(() => {
-            console.log("RS Retry [重新授权]", new Date())
+            //console.log("RS Retry [重新授权]", new Date())
             request(config).then(resolve).catch(reject)
             request(config).then(resolve).catch(reject)
           })
           })
         }, 5000)
         }, 5000)