日志功能封装

This commit is contained in:
2024-05-22 18:02:48 +08:00
parent d757f99b5d
commit 68262d0519
5 changed files with 40 additions and 4 deletions

View File

@@ -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 || {};