Commit ef12f280 by 王昆

gsb

parent eda491c4
...@@ -26,6 +26,8 @@ class UserCtl extends CtlBase { ...@@ -26,6 +26,8 @@ class UserCtl extends CtlBase {
} }
loginUser = loginUser.data; loginUser = loginUser.data;
// TODO 查询商户名称
let rs = this.loginDTO(loginUser) let rs = this.loginDTO(loginUser)
rs.key = await this.setLogin(loginUser); rs.key = await this.setLogin(loginUser);
return system.getResultSuccess(rs); return system.getResultSuccess(rs);
...@@ -36,9 +38,9 @@ class UserCtl extends CtlBase { ...@@ -36,9 +38,9 @@ class UserCtl extends CtlBase {
} }
async setLogin(user) { async setLogin(user) {
let loginsid = "esa_" + uuidv4(); let loginsid = "e-mcht-" + uuidv4();
if (settings.env = "dev") { if (settings.env = "dev") {
loginsid = "esa_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7"; loginsid = "e-mcht-" + user.id;
} }
await this.redisClient.setWithEx(loginsid, JSON.stringify(user), 60 * 60 * 5); await this.redisClient.setWithEx(loginsid, JSON.stringify(user), 60 * 60 * 5);
return loginsid; return loginsid;
......
...@@ -8,22 +8,6 @@ class FeeService extends ServiceBase { ...@@ -8,22 +8,6 @@ class FeeService extends ServiceBase {
} }
/** /**
* 创建计费账户
* @param params
* app_id: 电子签订单 100001
* app_data_id: 订单id
* balance: 余额,整数(分或份)
* @returns {status:0, msg: "", data: {account_id: 1111}}
*/
async createAccount(params) {
try {
return await this.callms("engine_fee", "accountCreate", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 账户查询 * 账户查询
* @param params * @param params
* account_id: 账户id * account_id: 账户id
...@@ -38,41 +22,6 @@ class FeeService extends ServiceBase { ...@@ -38,41 +22,6 @@ class FeeService extends ServiceBase {
} }
/** /**
* 账户查询批量
* @param params
* account_ids: 账户id
* @returns
*/
async accountBulk(params) {
try {
return await this.callms("engine_fee", "accountBulkInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 账户查询批量
* @param params
* {
* "account_id": "1",
* "trade_amt": 57,
* "trade_no": "123314",
* "trade_desc": "三要素验证"
* }
* +
* account_ids: 账户id
* @returns
*/
async accountTrade(params) {
try {
return await this.callms("engine_fee", "accountTrade", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* @param params * @param params
* { * {
* "currentPage": 1, * "currentPage": 1,
......
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
class UserService extends ServiceBase {
constructor() {
super();
}
async saveMerchantUser(params) {
try {
return await this.callms("sve_uc", "saveMerchantUser", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async login(params) {
try {
return await this.callms("sve_uc", "merchantLogin", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async page(params) {
try {
return await this.callms("sve_uc", "userPage", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async info(params) {
try {
return await this.callms("sve_uc", "userInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async mapByIds(params) {
try {
return await this.callms("sve_uc", "userMapByIds", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = UserService;
\ No newline at end of file
...@@ -196,7 +196,7 @@ class System { ...@@ -196,7 +196,7 @@ class System {
engine_sign: local + ":3574" + path, engine_sign: local + ":3574" + path,
// 用户服务 // 用户服务
sve_uc: dev + ":3651" + path, sve_uc: local + ":3651" + path,
// 商户服务 // 商户服务
sve_merchant: local + ":3652" + path, sve_merchant: local + ":3652" + 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, esignadminsid'); res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild, esignmerchantsid');
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');
......
...@@ -9,7 +9,7 @@ module.exports = function (app) { ...@@ -9,7 +9,7 @@ module.exports = function (app) {
var loginsid; var loginsid;
var jsonUser = null; var jsonUser = null;
if(!jsonUser) { if(!jsonUser) {
loginsid = req.headers["esignadminsid"] || ""; loginsid = req.headers["esignmerchantsid"] || "";
jsonUser = await redisClient.get(loginsid); jsonUser = await redisClient.get(loginsid);
if(jsonUser) { if(jsonUser) {
jsonUser = JSON.parse(jsonUser); jsonUser = JSON.parse(jsonUser);
...@@ -91,7 +91,8 @@ module.exports = function (app) { ...@@ -91,7 +91,8 @@ module.exports = function (app) {
req.body.classname = classPath; req.body.classname = classPath;
if(req.loginUser) { if(req.loginUser) {
req.body.merchant_id = req.loginUser.uctype_id;
req.body.uctype_id = req.loginUser.uctype_id;
} }
params.push(methodName); params.push(methodName);
......
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