关闭网络请求的log

This commit is contained in:
XiuYun CHEN 2025-08-15 11:09:46 +08:00
parent 9e8c96ccd3
commit b63d268712

View File

@ -61,12 +61,12 @@ class HdHttp {
return httpInstance.request(fullUrl, options).then((res) => {
logger.info('Response param' + JSON.stringify(extraDatas))
logger.info('Response fullUrl:' + fullUrl + res.result);
// logger.info('Response param' + JSON.stringify(extraDatas))
// logger.info('Response fullUrl:' + fullUrl + res.result);
const result = res.result as HdResponse<T>
return result
}).catch((err: BusinessError) => {
logger.info(fullUrl + `Response succeeded: ${err}`);
// logger.info(fullUrl + `Response succeeded: ${err}`);
promptAction.showToast({ message: err.message || '网络错误' })
return Promise.reject(err)
}).finally(() => {
@ -110,12 +110,12 @@ class HdHttp {
let fullUrl = this.baseURL + path
return httpInstance.request(fullUrl, options).then((res) => {
logger.info('Response param' + JSON.stringify(extraDatas))
logger.info('Response fullUrl:' + fullUrl + res.result);
// logger.info('Response param' + JSON.stringify(extraDatas))
// logger.info('Response fullUrl:' + fullUrl + res.result);
const result = res.result as HdResponse<T>
return result
}).catch((err: BusinessError) => {
logger.info(fullUrl + `Response succeeded: ${err}`);
// logger.info(fullUrl + `Response succeeded: ${err}`);
promptAction.showToast({ message: err.message || '网络错误' })
return Promise.reject(err)
}).finally(() => {
@ -150,11 +150,11 @@ class HdHttp {
}
return httpInstance.request(fullUrl, options).then((res) => {
logger.info('Response fullUrl:' + fullUrl + res.result);
// logger.info('Response fullUrl:' + fullUrl + res.result);
const result = res.result as HdResponse<T>
return result
}).catch((err: BusinessError) => {
logger.info(fullUrl + `Response succeeded: ${err}`);
// logger.info(fullUrl + `Response succeeded: ${err}`);
promptAction.showToast({ message: err.message || '网络错误' })
return Promise.reject(err)
}).finally(() => {
@ -208,7 +208,7 @@ class HdHttp {
// 处理响应结果。
return promise.then(async (data) => {
if (data.responseCode === http.ResponseCode.OK) {
logger.info('Response httpReq:' + data.result);
// logger.info('Response httpReq:' + data.result);
let json: TimestampBean = JSON.parse(data.result.toString()) as TimestampBean;
let tp = json.timestamp;
datas.set("user_uuid", authStore.getUser().uuid ? authStore.getUser().uuid : '');
@ -221,7 +221,7 @@ class HdHttp {
}
}
).catch((err: BusinessError) => {
logger.info('Response httpReq error:' + JSON.stringify(err));
// logger.info('Response httpReq error:' + JSON.stringify(err));
return Promise.reject(err);
}).finally(() => {
httpRequest.destroy()
@ -250,7 +250,7 @@ class HdHttp {
// 处理响应结果。
return promise.then(async (data) => {
if (data.responseCode === http.ResponseCode.OK) {
logger.info('Response httpReq:' + data.result);
// logger.info('Response httpReq:' + data.result);
let json: TimestampBean = JSON.parse(data.result.toString()) as TimestampBean;
let tp = json.timestamp;
datas.set("user_uuid", authStore.getUser().uuid ? authStore.getUser().uuid : '');
@ -263,7 +263,7 @@ class HdHttp {
}
}
).catch((err: BusinessError) => {
logger.info('Response httpReq error:' + JSON.stringify(err));
// logger.info('Response httpReq error:' + JSON.stringify(err));
return Promise.reject(err);
}).finally(() => {
httpRequest.destroy()
@ -290,12 +290,12 @@ class HdHttp {
});
// 处理响应结果。
return promise.then((data) => {
logger.info('Response httpReqSimply:' + JSON.stringify(data));
// logger.info('Response httpReqSimply:' + JSON.stringify(data));
const result = data.result as HdResponse<T>
return result
}
).catch((err: BusinessError) => {
logger.info('Response httpReq error:' + JSON.stringify(err));
// logger.info('Response httpReq error:' + JSON.stringify(err));
return Promise.reject(err);
}).finally(() => {
httpRequest.destroy()