|
@@ -13,26 +13,27 @@ class Kd100Service extends CrudService {
|
|
|
}
|
|
|
|
|
|
async search({ no, type }) {
|
|
|
- const customer = '5EC65D1966B410C333013563B7156AEE';
|
|
|
- const key = 'jrwohIUD2299';
|
|
|
- const param = { com: type, num: no, resultv2: '4' };
|
|
|
- const md5Str = `${JSON.stringify(param)}${key}${customer}`;
|
|
|
- const sign = _.toUpper(await this.getSign(md5Str));
|
|
|
- const body = { customer, sign, param: JSON.stringify(param) };
|
|
|
- const res = await this.ctx.curl(this.kd100Api, {
|
|
|
- method: 'POST',
|
|
|
- data: body,
|
|
|
- dataType: 'json',
|
|
|
- contentType: 'application/x-www-form-urlencoded',
|
|
|
- });
|
|
|
- if (res.status === 200) {
|
|
|
- const { ischeck, data, nu, status, returnCode, message } = res.data;
|
|
|
- if (!returnCode) {
|
|
|
- const list = this.resetData(data);
|
|
|
- const is_check = this.isCheck(ischeck);
|
|
|
- return { list, is_check, no: nu, status };
|
|
|
- } else if (returnCode !== '200') throw new BusinessError(ErrorCode.SERVICE_FAUL, message);
|
|
|
- }
|
|
|
+ throw new BusinessError(ErrorCode.SERVICE_FAULT, '物流查询接口需要第三方服务支持.目前无法使用!');
|
|
|
+ // const customer = '5EC65D1966B410C333013563B7156AEE';
|
|
|
+ // const key = 'jrwohIUD2299';
|
|
|
+ // const param = { com: type, num: no, resultv2: '4' };
|
|
|
+ // const md5Str = `${JSON.stringify(param)}${key}${customer}`;
|
|
|
+ // const sign = _.toUpper(await this.getSign(md5Str));
|
|
|
+ // const body = { customer, sign, param: JSON.stringify(param) };
|
|
|
+ // const res = await this.ctx.curl(this.kd100Api, {
|
|
|
+ // method: 'POST',
|
|
|
+ // data: body,
|
|
|
+ // dataType: 'json',
|
|
|
+ // contentType: 'application/x-www-form-urlencoded',
|
|
|
+ // });
|
|
|
+ // if (res.status === 200) {
|
|
|
+ // const { ischeck, data, nu, status, returnCode, message } = res.data;
|
|
|
+ // if (!returnCode) {
|
|
|
+ // const list = this.resetData(data);
|
|
|
+ // const is_check = this.isCheck(ischeck);
|
|
|
+ // return { list, is_check, no: nu, status };
|
|
|
+ // } else if (returnCode !== '200') throw new BusinessError(ErrorCode.SERVICE_FAUL, message);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
isCheck(value) {
|