|
@@ -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)
|