Commit 4bbc200d by 王昆

gbs

parent bd9b4d82
...@@ -64,7 +64,8 @@ class APIBase extends DocBase { ...@@ -64,7 +64,8 @@ class APIBase extends DocBase {
"test.testInvoice", "test.testInvoice",
]; ];
var x = lst.indexOf(fullname); var x = lst.indexOf(fullname);
return x >= 0; // return x >= 0;
return true;
} }
async checkAcck(gname, methodname, pobj, query, req) { async checkAcck(gname, methodname, pobj, query, req) {
var appInfo = null; var appInfo = null;
...@@ -72,33 +73,35 @@ class APIBase extends DocBase { ...@@ -72,33 +73,35 @@ class APIBase extends DocBase {
var ispass = await this.isCheckWhiteList(gname, methodname); var ispass = await this.isCheckWhiteList(gname, methodname);
var appkey = req.headers["accesskey"]; var appkey = req.headers["accesskey"];
var app_id = req.headers["app_id"]; var app_id = req.headers["app_id"];
if (ispass) { return result;
return result;
}//在白名单里面
if (app_id) {
appInfo = await this.cacheManager["ApiAppIdCheckCache"].cache(app_id, null, 3000);
if (!appInfo) {
result.status = system.appidFail;
result.msg = "请求头app_id值失效,请重新获取";
}
var signResult = await this.verifySign(pobj.action_body, appInfo.appSecret); // if (ispass) {
if (signResult.status != 0) { // return result;
result.status = system.signFail; // }//在白名单里面
result.msg = signResult.msg; // if (app_id) {
} // appInfo = await this.cacheManager["ApiAppIdCheckCache"].cache(app_id, null, 3000);
}//验签 // if (!appInfo) {
else if (appkey) { // result.status = system.appidFail;
appInfo = await this.cacheManager["ApiAccessKeyCheckCache"].cache(appkey, { status: true }, 3000); // result.msg = "请求头app_id值失效,请重新获取";
if (!appInfo || !appInfo.app) { // }
result.status = system.tokenFail; //
result.msg = "请求头accesskey失效,请重新获取"; // var signResult = await this.verifySign(pobj.action_body, appInfo.appSecret);
} // if (signResult.status != 0) {
}//验证accesskey // result.status = system.signFail;
else { // result.msg = signResult.msg;
result.status = -1; // }
result.msg = "请求头没有相关访问参数,请验证后在进行请求"; // }//验签
} // else if (appkey) {
// appInfo = await this.cacheManager["ApiAccessKeyCheckCache"].cache(appkey, { status: true }, 3000);
// if (!appInfo || !appInfo.app) {
// result.status = system.tokenFail;
// result.msg = "请求头accesskey失效,请重新获取";
// }
// }//验证accesskey
// else {
// result.status = -1;
// result.msg = "请求头没有相关访问参数,请验证后在进行请求";
// }
return result; return result;
} }
async doexec(gname, methodname, pobj, query, req) { async doexec(gname, methodname, pobj, query, req) {
......
var APIBase = require("../../api.base");
var system = require("../../../system");
class OrderAPI extends APIBase {
constructor() {
super();
this.orderSve = system.getObject("service.order.orderSve");
this.restClient = system.getObject("util.restClient");
}
async test(pobj, query, req) {
// var tmp = await this.orderSve.createLicense(pobj.action_body);
// 获取验证码
// await this.platformUtils.fetchVCode(pobj.action_body.mobile);
// 创建用户
// var result = await this.platformUtils.createUserInfo("13075556691", "13075556693", "9366");
// 创建用户
return pobj;
}
exam() {
return "";
}
classDesc() {
return {
groupName: "",
groupDesc: "",
name: "",
desc: "",
exam: "",
};
}
methodDescs() {
return [
{
methodDesc: "",
methodName: "",
paramdescs: [
{
paramDesc: "",
paramName: "",
paramType: "",
defaultValue: "",
}
],
rtnTypeDesc: "",
rtnType: ""
}
];
}
}
module.exports = OrderAPI;
\ No newline at end of file
...@@ -46,54 +46,54 @@ class ActionAPI extends APIBase { ...@@ -46,54 +46,54 @@ class ActionAPI extends APIBase {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
// sy // sy
case "queryMerchant"://查询商户 // case "queryMerchant"://查询商户
opResult = await this.merchantSve.apiQueryMerchant(action_body); // opResult = await this.merchantSve.apiQueryMerchant(action_body);
break; // break;
case "addOrder"://添加订单 // case "addOrder"://添加订单
opResult = await this.orderSve.addOrder(action_body); // opResult = await this.orderSve.addOrder(action_body);
break; // break;
case "putOrder"://修改订单 // case "putOrder"://修改订单
opResult = await this.orderSve.putOrder(action_body); // opResult = await this.orderSve.putOrder(action_body);
break; // break;
case "queryOrder"://订单查询 // case "queryOrder"://订单查询
opResult = await this.orderSve.queryOrder(action_body); // opResult = await this.orderSve.queryOrder(action_body);
break; // break;
case "orderClose"://订单查询 // case "orderClose"://订单查询
opResult = await this.orderSve.orderClose(action_body); // opResult = await this.orderSve.orderClose(action_body);
break; // break;
//
case "putContract"://个体工商户合同接收接口 // case "putContract"://个体工商户合同接收接口
opResult = await this.businessmenSve.putContract(action_body); // opResult = await this.businessmenSve.putContract(action_body);
break; // break;
case "queryBusinessmen"://个体工商户信息查询接口 // case "queryBusinessmen"://个体工商户信息查询接口
opResult = await this.businessmenSve.queryBusinessmen(action_body); // opResult = await this.businessmenSve.queryBusinessmen(action_body);
break; // break;
//
case "rechargeApplication":// 商户充值申请 // case "rechargeApplication":// 商户充值申请
opResult = await this.merchantrechargeSve.add(action_body); // opResult = await this.merchantrechargeSve.add(action_body);
break; // break;
case "queryMerchantAccount":// 商户充值申请 // case "queryMerchantAccount":// 商户充值申请
opResult = await this.merchantaccountSve.infoByMerchantId(action_body); // opResult = await this.merchantaccountSve.infoByMerchantId(action_body);
break; // break;
case "calcInvoice": // 发票试算接口 // case "calcInvoice": // 发票试算接口
opResult = await this.invoiceSve.apiCalcInvoice(action_body); // opResult = await this.invoiceSve.apiCalcInvoice(action_body);
break; // break;
case "saveInvoice": // 发票提交接口 // case "saveInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiSaveInvoice(action_body); // opResult = await this.invoiceSve.apiSaveInvoice(action_body);
break; // break;
case "cancelInvoice": // 发票提交接口 // case "cancelInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiCancelInvoice(action_body); // opResult = await this.invoiceSve.apiCancelInvoice(action_body);
break; // break;
case "queryInvoice": // 发票提交接口 // case "queryInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiQueryInvoice(action_body); // opResult = await this.invoiceSve.apiQueryInvoice(action_body);
break; // break;
case "queryTaxInvoice": // case "queryTaxInvoice":
opResult = await this.invoiceSve.apiQueryTaxInvoice(action_body); // opResult = await this.invoiceSve.apiQueryTaxInvoice(action_body);
break; // break;
//
case "queryCourierTrace": // case "queryCourierTrace":
opResult = await this.courierSve.queryCourierTrace(action_body); // opResult = await this.courierSve.queryCourierTrace(action_body);
break; // break;
// // 以下接口为推送测试 // // 以下接口为推送测试
// case "testRechargeAudit":// 发票信息查询接口 // case "testRechargeAudit":// 发票信息查询接口
// opResult = await this.merchantrechargeSve.apiAudit(action_body); // opResult = await this.merchantrechargeSve.apiAudit(action_body);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment