|
|
@@ -19,6 +19,10 @@ const alovaInstance = createAlova({
|
|
|
throw new Error(response.statusText);
|
|
|
}
|
|
|
const json = await response.json();
|
|
|
+ console.log(json)
|
|
|
+ if(json.length){
|
|
|
+ return json;
|
|
|
+ }
|
|
|
if (json.code !== 200) {
|
|
|
// 抛出错误或返回reject状态的Promise实例时,此请求将抛出错误
|
|
|
throw new Error(json.message);
|
|
|
@@ -32,7 +36,7 @@ const alovaInstance = createAlova({
|
|
|
// 请求错误时将会进入该拦截器。
|
|
|
// 第二个参数为当前请求的method实例,你可以用它同步请求前后的配置信息
|
|
|
onError: (err, method) => {
|
|
|
- alert(err.message);
|
|
|
+ console.log(err);
|
|
|
},
|
|
|
|
|
|
// 请求完成的拦截器
|