Commit dcafa940 by 王昆

gsb

parent 3b26f526
/xgg-deliver/node_modules/ /bpo-stat/node_modules/
.idea/* .idea/*
\ No newline at end of file
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class ActionAPI extends APIBase {
constructor() {
super();
}
/**
* 接口跳转
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springboard(pobj, qobj, req) {
console.log(pobj, pobj.action_type, !pobj.action_type, "--------------------------------------this is xgg admin ----------------------");
if (!pobj.action_process) {
return system.getResult(null, "action_process参数不能为空");
}
if (!pobj.action_type) {
return system.getResult(null, "action_type参数不能为空");
}
var result = null;
switch (pobj.action_process) {
case "sijibao"://司机宝
result = await this.sijibaoOpActionProcess(pobj.action_process, pobj.action_type, pobj.action_body);
break;
default:
result = system.getResult(null, "action_process参数错误");
break;
}
return result;
}
async sijibaoOpActionProcess(action_process, action_type, action_body) {
var opResult = null;
switch (action_type) {
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
exam() {
return `<pre><pre/>`;
}
classDesc() {
return {
groupName: "op",
groupDesc: "元数据服务包",
name: "ActionAPI",
desc: "此类是对外提供接口服务",
exam: "",
};
}
methodDescs() {
return [
{
methodDesc: `<pre><pre/>`,
methodName: "springboard",
paramdescs: [
{
paramDesc: "请求的行为,传递如:sijibao",
paramName: "action_process",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "业务操作类型,详情见方法中的描述",
paramName: "action_type",
paramType: "string",
defaultValue: null,
},
{
paramDesc: "请求体",
paramName: "action_body",
paramType: "json",
defaultValue: null,
}
],
rtnTypeDesc: `<pre><pre/>`,
rtnType: `<pre><pre/>`
}
];
}
}
module.exports = ActionAPI;
\ No newline at end of file
...@@ -4,48 +4,28 @@ const querystring = require('querystring'); ...@@ -4,48 +4,28 @@ const querystring = require('querystring');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
const logCtl = system.getObject("web.common.oplogCtl"); const logCtl = system.getObject("web.common.oplogCtl");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
var svgCaptcha = require('svg-captcha');
var cacheBaseComp = null; var cacheBaseComp = null;
class MerchanttradeprocessCtl extends CtlBase { class UserCtl extends CtlBase {
constructor() { constructor() {
super("merchant", CtlBase.getServiceName(MerchanttradeprocessCtl)); super("auth", CtlBase.getServiceName(UserCtl));
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
this.merchantSve = system.getObject("service.merchant.merchantSve");
} }
async processList(pobj, pobj2, req) { async login(pobj, pobj2, req, res) {
try { var loginName = this.trim(pobj.loginName);
var condition = { var password = this.trim(pobj.password);
currentPage: pobj.currentPage,
pageSize: pobj.pageSize,
merchantId: pobj.merchantId,
busiType: pobj.busiType,
invoiceApplyNo: this.trim(pobj.invoiceApplyNo),
createdBegin: this.trim(pobj.createdBegin),
createdEnd: this.trim(pobj.createdEnd),
}
this.doTimeCondition(condition, ["createdBegin", "createdEnd"]);
var page = await this.service.pageByCondition(condition); try {
return system.getResultSuccess(page); return system.getResultSuccess(1);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
return system.getResultFail(500, "接口异常:" + error.message); return system.getResultFail(500, "接口异常:" + error.message);
} }
} }
// try {
// } catch (error) {
// return system.getResultFail(500, "接口异常:" + error.message);
// }
} }
module.exports = MerchanttradeprocessCtl; module.exports = UserCtl;
\ No newline at end of file \ No newline at end of file
...@@ -4,8 +4,6 @@ const settings = require("../../../config/settings"); ...@@ -4,8 +4,6 @@ const settings = require("../../../config/settings");
class ApiAppIdCheckCache extends CacheBase { class ApiAppIdCheckCache extends CacheBase {
constructor() { constructor() {
super(); super();
this.merchantSve = system.getObject("service.merchant.merchantSve");
} }
desc() { desc() {
return "应用中来访访问appid缓存"; return "应用中来访访问appid缓存";
...@@ -14,11 +12,12 @@ class ApiAppIdCheckCache extends CacheBase { ...@@ -14,11 +12,12 @@ class ApiAppIdCheckCache extends CacheBase {
return settings.cacheprefix + "_verify_appid:"; return settings.cacheprefix + "_verify_appid:";
} }
async buildCacheVal(cachekey, inputkey, val, ex, ...items) { async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
var item = await this.merchantSve.getById(inputkey); // var item = await this.merchantSve.getById(inputkey);
if (!item && item.data) { // if (!item && item.data) {
return null; // return null;
} // }
return JSON.stringify(item.data); // return JSON.stringify(item.data);
return {};
} }
} }
module.exports = ApiAppIdCheckCache; module.exports = ApiAppIdCheckCache;
\ No newline at end of file
...@@ -7,8 +7,8 @@ var ENVINPUT = { ...@@ -7,8 +7,8 @@ var ENVINPUT = {
REDIS_HOST: process.env.REDIS_HOST, REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT, REDIS_PORT: process.env.REDIS_PORT,
REDIS_PWD: process.env.REDIS_PWD, REDIS_PWD: process.env.REDIS_PWD,
DB_NAME: process.env.XGGDELIVER_DB_NAME, DB_NAME: process.env.BPOSTAT_DB_NAME,
REDIS_DB: process.env.XGGDELIVER_REDIS_DB, REDIS_DB: process.env.BPOSTAT_REDIS_DB,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev" APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev"
}; };
var settings = { var settings = {
......
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