优化接口请求
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user