日志功能封装
This commit is contained in:
@@ -26,6 +26,7 @@ function requestInterceptors() {
|
||||
|
||||
// config.header.contentType = "x-www-form-urlencoded"
|
||||
}
|
||||
getApp().globalData?.logger.info('request: ', config);
|
||||
return config;
|
||||
},
|
||||
(
|
||||
@@ -52,6 +53,8 @@ function responseInterceptors() {
|
||||
return data;
|
||||
}
|
||||
|
||||
getApp().globalData?.logger.info('response: ', config);
|
||||
|
||||
// 请求成功则返回结果
|
||||
if(data.code === 200 || data?.retcode == 0) {
|
||||
return data || {};
|
||||
|
Reference in New Issue
Block a user