Commit c4874ae9 by 王昆

gsb

parent 60e79c44
/xgg-saas-merchant/node_modules/ */node_modules/
.idea/* .idea/*
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"type": "node", "type": "node",
"request": "launch", "request": "launch",
"name": "Launch Program", "name": "Launch Program",
"program": "${workspaceFolder}/xgg-saas-merchant/main.js" "program": "${workspaceFolder}/esign-admin/main.js"
} }
] ]
} }
\ No newline at end of file
#!/bin/bash #!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2 FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com" MAINTAINER jy "jiangyong@gongsibao.com"
ADD xgg-saas-merchant /apps/xgg-saas-merchant/ ADD esign-admin /apps/esign-admin/
WORKDIR /apps/xgg-saas-merchant/ WORKDIR /apps/esign-admin/
RUN cnpm install -S RUN cnpm install -S
CMD ["node","/apps/xgg-saas-merchant/main.js"] CMD ["node","/apps/esign-admin/main.js"]
......
var APIBase = require("../../api.base"); var APIBase = require("../../api.base");
var system = require("../../../system"); var system = require("../../../system");
class PlatformuserAPI extends APIBase { class ADUserAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.userSve = system.getObject("service.uc.userSve"); this.userSve = system.getObject("service.uc.userSve");
...@@ -44,4 +44,4 @@ class PlatformuserAPI extends APIBase { ...@@ -44,4 +44,4 @@ class PlatformuserAPI extends APIBase {
]; ];
} }
} }
module.exports = PlatformuserAPI; module.exports = ADUserAPI;
\ No newline at end of file \ No newline at end of file
var system = require("../../../system")
const http = require("http")
const querystring = require('querystring');
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
const logCtl = system.getObject("web.common.oplogCtl");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4');
var cacheBaseComp = null;
class UserCtl extends CtlBase {
constructor() {
super("auth", CtlBase.getServiceName(UserCtl));
}
}
module.exports = UserCtl;
\ No newline at end of file
...@@ -10,9 +10,6 @@ class UserCtl extends CtlBase { ...@@ -10,9 +10,6 @@ class UserCtl extends CtlBase {
super(); super();
this.userSve = system.getObject("service.uc.userSve"); this.userSve = system.getObject("service.uc.userSve");
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
this.captchaSve = system.getObject("service.common.captchaSve");
this.deliverSve = system.getObject("service.common.deliverSve");
this.merchantSve = system.getObject("service.saas.merchantSve");
} }
async login(pobj, pobj2, req, res) { async login(pobj, pobj2, req, res) {
......
const system=require("../../../system");
const Dao=require("../../dao.base");
class UserDao extends Dao{
constructor(){
super(Dao.getModelName(UserDao));
}
}
module.exports=UserDao;
// var u=new UserDao();
// var roledao=system.getObject("db.roleDao");
// (async ()=>{
// var users=await u.model.findAll({where:{app_id:1}});
// var role=await roledao.model.findOne({where:{code:"guest"}});
// console.log(role);
// for(var i=0;i<users.length;i++){
// await users[i].setRoles([role]);
// console.log(i);
// }
//
// })();
module.exports = function test(req, res, next) {
console.log("test interceptor");
test2(req, res);
next();
};
/**
* Create a getter for the given string.
*/
function test2 (req, res) {
console.log(req, res);
}
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
const settings = require("../../../../config/settings")
class UserService extends ServiceBase {
constructor() {
super("auth", ServiceBase.getDaoName(UserService));
}
}
module.exports = UserService;
// var task=new UserService();
// task.getUserStatisticGroupByApp().then(function(result){
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
...@@ -8,7 +8,7 @@ class UserService extends ServiceBase { ...@@ -8,7 +8,7 @@ class UserService extends ServiceBase {
async login(params) { async login(params) {
try { try {
return await this.callms("uc", "merchantLogin", params); return await this.callms("sve_uc", "login", params);
} catch (error) { } catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
...@@ -21,14 +21,6 @@ class UserService extends ServiceBase { ...@@ -21,14 +21,6 @@ class UserService extends ServiceBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
async mapByIds(params) {
try {
return await this.callms("uc", "merchantMapByIds", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
} }
module.exports = UserService; module.exports = UserService;
\ No newline at end of file
...@@ -183,37 +183,32 @@ class System { ...@@ -183,37 +183,32 @@ class System {
console.log(settings.env, "-------------- microsetting env ------------------"); console.log(settings.env, "-------------- microsetting env ------------------");
var path = "/api/op/action/springboard"; var path = "/api/op/action/springboard";
if (settings.env == "dev") { if (settings.env == "dev") {
// var domain = "http://192.168.18.237";
let local = "http://127.0.0.1"; let local = "http://127.0.0.1";
let dev = "http://39.107.234.14"; let dev = "http://39.107.234.14";
return { return {
// 公共服务 // 计费引擎
common: dev + ":3102" + path, engine_fee: local + ":3103" + path,
// 认证引擎
engine_auth: local + ":3103" + path,
// 签约引擎
engine_sign: local + ":3103" + path,
// 用户服务
sve_uc: dev + ":3651" + path,
// 商户服务 // 商户服务
merchant: dev + ":3101" + path, sve_merchant: dev + ":3103" + path,
// 订单服务 // 订单服务
order: local + ":3103" + path, sve_order: dev + ":3103" + path,
// 发票服务
invoice: dev + ":3105" + path,
// 用户服务
uc: dev + ":3106" + path,
// 交易
trade: dev + ":3107" + path,
} }
} else { } else {
return { return {
common: "xggsvecommon-service" + path, // common: "xggsvecommon-service" + path,
// merchant: "xggsvemerchant-service" + path, // // merchant: "xggsvemerchant-service" + path,
merchant: "http://123.57.217.203:20500" + path, // merchant: "http://123.57.217.203:20500" + path,
order: "xggsveorder-service" + path, // order: "xggsveorder-service" + path,
invoice: "xggsveinvoice-service" + path, // invoice: "xggsveinvoice-service" + path,
uc: "xggsveuc-service" + path, // uc: "xggsveuc-service" + path,
trade: "xggsvetrade-service" + path, // trade: "xggsvetrade-service" + path,
} }
} }
} }
......
...@@ -27,7 +27,7 @@ module.exports = function (app) { ...@@ -27,7 +27,7 @@ module.exports = function (app) {
app.all('*', function (req, res, next) { app.all('*', function (req, res, next) {
req.objs = system; req.objs = system;
res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, xggsaamerchantsid'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, esignadminsid');
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS'); res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
// res.header('Access-Control-Allow-Credentials', 'true'); // res.header('Access-Control-Allow-Credentials', 'true');
res.header('content-type', 'text/html;charset=UTF-8'); res.header('content-type', 'text/html;charset=UTF-8');
......
...@@ -6,7 +6,7 @@ var settings={ ...@@ -6,7 +6,7 @@ var settings={
db:10, db:10,
}, },
database:{ database:{
dbname : "xgg", dbname : "esign-admin",
user: "write", user: "write",
password: "write", password: "write",
config: { config: {
......
...@@ -7,10 +7,9 @@ const redisClient = system.getObject("util.redisClient"); ...@@ -7,10 +7,9 @@ const redisClient = system.getObject("util.redisClient");
module.exports = function (app) { module.exports = function (app) {
app.all("/web/*", async function (req, res, next) { app.all("/web/*", async function (req, res, next) {
var loginsid; var loginsid;
var jsonUser = req.session.user;
// var jsonUser = null; // var jsonUser = null;
if(!jsonUser) { if(!jsonUser) {
loginsid = req.headers["xggsaamerchantsid"] || ""; loginsid = req.headers["esignadminsid"] || "";
jsonUser = await redisClient.get(loginsid); jsonUser = await redisClient.get(loginsid);
if(jsonUser) { if(jsonUser) {
jsonUser = JSON.parse(jsonUser); jsonUser = JSON.parse(jsonUser);
......
...@@ -8,10 +8,11 @@ var ENVINPUT = { ...@@ -8,10 +8,11 @@ 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.XGGSAASMERCHANT_DB_NAME, DB_NAME: process.env.ESIGNADMIN_DB_NAME,
REDIS_DB: process.env.XGGSAASMERCHANT_REDIS_DB, REDIS_DB: process.env.ESIGNADMIN_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 = {
env: ENVINPUT.APP_ENV, env: ENVINPUT.APP_ENV,
platformid: 1, platformid: 1,
...@@ -27,7 +28,7 @@ var settings = { ...@@ -27,7 +28,7 @@ var settings = {
salt: "%iatpD1gcxz7iF#B", salt: "%iatpD1gcxz7iF#B",
defaultpwd: "987456", defaultpwd: "987456",
basepath: path.normalize(path.join(__dirname, '../..')), basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 3702, port: process.env.NODE_PORT || 3601,
localpath: function () { localpath: function () {
let platform = os.platform() || ""; let platform = os.platform() || "";
// windows // windows
......
This diff is collapsed. Click to expand it.
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