diff --git a/shared/pubUtils/httpUtil.ts b/shared/pubUtils/httpUtil.ts index 2969e0103..9e69d07ea 100644 --- a/shared/pubUtils/httpUtil.ts +++ b/shared/pubUtils/httpUtil.ts @@ -41,7 +41,7 @@ export async function httpRequest(url: string, method: string, body: any, header } } -export async function httpRequestForm(url: string, method: string, form: any, timeout = 150) { +export async function httpRequestForm(url: string, method: string, form: any, timeout = 150, printRes = true) { console.log(`httpRequest*********: ${url}, ${method}, ${JSON.stringify(form)}`) let options = { @@ -62,7 +62,9 @@ export async function httpRequestForm(url: string, method: string, form: any, ti try { let res = await request(options); console.log('*****request result*****'); - console.log(JSON.stringify(res)); + if (printRes) { + console.log(JSON.stringify(res)); + } return res; } catch (e) { console.error('******', e); @@ -184,6 +186,6 @@ export async function request37CheckChat(url: string, body: Chat37Params, key: s export async function request37GetWord(url: string, body: GetWordParam, key: string) { body.setSign(get37Md5SignB(body.getBody(), key)); - let result = await httpRequestForm(url, HTTP_METHOD.GET, body, 5 * 60 * 1000); + let result = await httpRequestForm(url, HTTP_METHOD.GET, body, 5 * 60 * 1000, false); return result; }