lrf 1 년 전
부모
커밋
1a1ec5cd3e
1개의 변경된 파일21개의 추가작업 그리고 20개의 파일을 삭제
  1. 21 20
      app/service/util/kd100.js

+ 21 - 20
app/service/util/kd100.js

@@ -13,26 +13,27 @@ class Kd100Service extends CrudService {
   }
   }
 
 
   async search({ no, type }) {
   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) {
   isCheck(value) {