chore: 响应拦截器顺序
This commit is contained in:
parent
6c43d818a0
commit
0a2bc105f6
@ -158,6 +158,12 @@ function createRequestClient(baseURL: string) {
|
||||
},
|
||||
});
|
||||
|
||||
// 通用的错误处理, 如果没有进入上面的错误处理逻辑,就会进入这里
|
||||
// 主要处理http状态码不为200的情况 必须放在在下面的响应拦截器之前
|
||||
client.addResponseInterceptor(
|
||||
errorMessageResponseInterceptor((msg: string) => message.error(msg)),
|
||||
);
|
||||
|
||||
client.addResponseInterceptor<HttpResponse>({
|
||||
fulfilled: (response) => {
|
||||
const encryptKey = (response.headers || {})['encrypt-key'];
|
||||
@ -273,11 +279,6 @@ function createRequestClient(baseURL: string) {
|
||||
}),
|
||||
);
|
||||
|
||||
// 通用的错误处理, 如果没有进入上面的错误处理逻辑,就会进入这里
|
||||
client.addResponseInterceptor(
|
||||
errorMessageResponseInterceptor((msg: string) => message.error(msg)),
|
||||
);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user