Skip to content

Commit c2c48b4

Browse files
committed
fix(promise):
1 parent 16804d1 commit c2c48b4

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
VUE_APP_BASE_URL = 'http://digital.7yue.pro/'
3+
VUE_APP_BASE_URL = 'http://pedro.7yue.pro/'

src/lin/plugins/axios.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ _axios.interceptors.response.use(
124124
const { origin } = window.location
125125
window.location.href = origin
126126
}, 1500)
127-
resolve(null)
128-
return
127+
return resolve(null)
129128
}
130129
// 令牌相关,刷新令牌
131130
if (error_code === 10040 || error_code === 10041 || error_code === 10050 || error_code === 10051) {
@@ -136,14 +135,12 @@ _axios.interceptors.response.use(
136135
saveAccessToken(refreshResult.access_token)
137136
// 将上次失败请求重发
138137
const result = await _axios(res.config)
139-
resolve(result)
140-
return
138+
return resolve(result)
141139
}
142140
}
143141
// 本次请求添加 params 参数:handleError 为 true,用户自己try catch,框架不做处理
144142
if (params && params.handleError) {
145-
reject(res)
146-
return
143+
return reject(res)
147144
}
148145
console.log('msg', msg)
149146
if (Config.useFrontEndErrorMsg) {

0 commit comments

Comments
 (0)