Commit 4bbc200d by 王昆

gbs

parent bd9b4d82
......@@ -64,7 +64,8 @@ class APIBase extends DocBase {
"test.testInvoice",
];
var x = lst.indexOf(fullname);
return x >= 0;
// return x >= 0;
return true;
}
async checkAcck(gname, methodname, pobj, query, req) {
var appInfo = null;
......@@ -72,33 +73,35 @@ class APIBase extends DocBase {
var ispass = await this.isCheckWhiteList(gname, methodname);
var appkey = req.headers["accesskey"];
var app_id = req.headers["app_id"];
if (ispass) {
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值失效,请重新获取";
}
return result;
var signResult = await this.verifySign(pobj.action_body, appInfo.appSecret);
if (signResult.status != 0) {
result.status = system.signFail;
result.msg = signResult.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 = "请求头没有相关访问参数,请验证后在进行请求";
}
// if (ispass) {
// 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 (signResult.status != 0) {
// result.status = system.signFail;
// result.msg = signResult.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;
}
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 {
var opResult = null;
switch (action_type) {
// sy
case "queryMerchant"://查询商户
opResult = await this.merchantSve.apiQueryMerchant(action_body);
break;
case "addOrder"://添加订单
opResult = await this.orderSve.addOrder(action_body);
break;
case "putOrder"://修改订单
opResult = await this.orderSve.putOrder(action_body);
break;
case "queryOrder"://订单查询
opResult = await this.orderSve.queryOrder(action_body);
break;
case "orderClose"://订单查询
opResult = await this.orderSve.orderClose(action_body);
break;
case "putContract"://个体工商户合同接收接口
opResult = await this.businessmenSve.putContract(action_body);
break;
case "queryBusinessmen"://个体工商户信息查询接口
opResult = await this.businessmenSve.queryBusinessmen(action_body);
break;
case "rechargeApplication":// 商户充值申请
opResult = await this.merchantrechargeSve.add(action_body);
break;
case "queryMerchantAccount":// 商户充值申请
opResult = await this.merchantaccountSve.infoByMerchantId(action_body);
break;
case "calcInvoice": // 发票试算接口
opResult = await this.invoiceSve.apiCalcInvoice(action_body);
break;
case "saveInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiSaveInvoice(action_body);
break;
case "cancelInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiCancelInvoice(action_body);
break;
case "queryInvoice": // 发票提交接口
opResult = await this.invoiceSve.apiQueryInvoice(action_body);
break;
case "queryTaxInvoice":
opResult = await this.invoiceSve.apiQueryTaxInvoice(action_body);
break;
case "queryCourierTrace":
opResult = await this.courierSve.queryCourierTrace(action_body);
break;
// case "queryMerchant"://查询商户
// opResult = await this.merchantSve.apiQueryMerchant(action_body);
// break;
// case "addOrder"://添加订单
// opResult = await this.orderSve.addOrder(action_body);
// break;
// case "putOrder"://修改订单
// opResult = await this.orderSve.putOrder(action_body);
// break;
// case "queryOrder"://订单查询
// opResult = await this.orderSve.queryOrder(action_body);
// break;
// case "orderClose"://订单查询
// opResult = await this.orderSve.orderClose(action_body);
// break;
//
// case "putContract"://个体工商户合同接收接口
// opResult = await this.businessmenSve.putContract(action_body);
// break;
// case "queryBusinessmen"://个体工商户信息查询接口
// opResult = await this.businessmenSve.queryBusinessmen(action_body);
// break;
//
// case "rechargeApplication":// 商户充值申请
// opResult = await this.merchantrechargeSve.add(action_body);
// break;
// case "queryMerchantAccount":// 商户充值申请
// opResult = await this.merchantaccountSve.infoByMerchantId(action_body);
// break;
// case "calcInvoice": // 发票试算接口
// opResult = await this.invoiceSve.apiCalcInvoice(action_body);
// break;
// case "saveInvoice": // 发票提交接口
// opResult = await this.invoiceSve.apiSaveInvoice(action_body);
// break;
// case "cancelInvoice": // 发票提交接口
// opResult = await this.invoiceSve.apiCancelInvoice(action_body);
// break;
// case "queryInvoice": // 发票提交接口
// opResult = await this.invoiceSve.apiQueryInvoice(action_body);
// break;
// case "queryTaxInvoice":
// opResult = await this.invoiceSve.apiQueryTaxInvoice(action_body);
// break;
//
// case "queryCourierTrace":
// opResult = await this.courierSve.queryCourierTrace(action_body);
// break;
// // 以下接口为推送测试
// case "testRechargeAudit":// 发票信息查询接口
// 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