|
@@ -52,11 +52,7 @@ service.interceptors.response.use(
|
|
|
* Here is just an example
|
|
|
* You can also judge the status by HTTP Status Code
|
|
|
*/ response => {
|
|
|
- const res = replaceStringInObject(
|
|
|
- response.data,
|
|
|
- 'https://zfire-jsm-h.oss-cn-shenzhen.aliyuncs.com/',
|
|
|
- `${process.env.VUE_APP_BASE_API}img/get?key=`
|
|
|
- )
|
|
|
+ const res = response.data
|
|
|
|
|
|
// if the custom code is not 20000, it is judged as an error.
|
|
|
if (whiteCodes.indexOf(res.code) < 0) {
|
|
@@ -94,8 +90,21 @@ service.interceptors.response.use(
|
|
|
}
|
|
|
return Promise.reject(new Error(res.message || 'Error'))
|
|
|
} else {
|
|
|
- console.log(res)
|
|
|
- return res
|
|
|
+ console.log(
|
|
|
+ replaceStringInObject(
|
|
|
+ res,
|
|
|
+ 'https://zf-mall-test.oss-cn-shenzhen.aliyuncs.com/',
|
|
|
+ `${process.env.VUE_APP_BASE_API}img/get?key=`
|
|
|
+ ),
|
|
|
+ '------------'
|
|
|
+ )
|
|
|
+
|
|
|
+ return replaceStringInObject(
|
|
|
+ res,
|
|
|
+ 'https://zf-mall-test.oss-cn-shenzhen.aliyuncs.com/',
|
|
|
+ `${process.env.VUE_APP_BASE_API}img/get?key=`
|
|
|
+ )
|
|
|
+ // return res
|
|
|
}
|
|
|
},
|
|
|
error => {
|