mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-29 22:56:41 +08:00
feat(project): 如果接口返回类型不是json,则直接走成功逻辑
This commit is contained in:
parent
0d45b86cde
commit
210f087492
@ -48,6 +48,11 @@ function createCommonRequest<ResponseData = any>(
|
|||||||
|
|
||||||
instance.interceptors.response.use(
|
instance.interceptors.response.use(
|
||||||
async response => {
|
async response => {
|
||||||
|
const responseType = response.config.headers.getContentType() || 'json';
|
||||||
|
if (responseType !== 'json') {
|
||||||
|
return Promise.resolve(response);
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.isBackendSuccess(response)) {
|
if (opts.isBackendSuccess(response)) {
|
||||||
return Promise.resolve(response);
|
return Promise.resolve(response);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user