优化接口请求
This commit is contained in:
parent
a599adc63e
commit
90be0d21b2
|
|
@ -5,7 +5,7 @@ export const enum ResultEnum {
|
|||
/**
|
||||
* 成功
|
||||
*/
|
||||
SUCCESS = "00000",
|
||||
SUCCESS = 200,
|
||||
/**
|
||||
* 错误
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ service.interceptors.response.use(
|
|||
}
|
||||
|
||||
const { code, data, msg } = response.data;
|
||||
if (code === ResultEnum.SUCCESS || code === undefined || code === null || code === 200) {
|
||||
if (code === ResultEnum.SUCCESS || code === undefined || code === null) {
|
||||
return data ? data : response.data;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue