网络请求可以不打印返回,如屏蔽词
This commit is contained in:
@@ -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)}`)
|
console.log(`httpRequest*********: ${url}, ${method}, ${JSON.stringify(form)}`)
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
@@ -62,7 +62,9 @@ export async function httpRequestForm(url: string, method: string, form: any, ti
|
|||||||
try {
|
try {
|
||||||
let res = await request(options);
|
let res = await request(options);
|
||||||
console.log('*****request result*****');
|
console.log('*****request result*****');
|
||||||
console.log(JSON.stringify(res));
|
if (printRes) {
|
||||||
|
console.log(JSON.stringify(res));
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('******', 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) {
|
export async function request37GetWord(url: string, body: GetWordParam, key: string) {
|
||||||
body.setSign(get37Md5SignB(body.getBody(), key));
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user