Commit 8308739e by 王昆

gsb

parent ce007b5d
var system = require("../../../system")
const CtlBase = require("../../ctlms.base");
class ChannelCtl extends CtlBase {
constructor() {
super();
this.orderSve = system.getObject("service.saas.orderSve");
}
async microAdd(params, pobj2, req) {
try {
return await this.orderSve.microAdd(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async info(params, pobj2, req) {
try {
return await this.orderSve.info(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async page(params, pobj2, req) {
try {
return await this.orderSve.page(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = ChannelCtl;
\ No newline at end of file
......@@ -42,12 +42,8 @@ class UserCtl extends CtlBase {
}
async setLogin(user) {
let loginsid = "saasp_" + uuidv4();
// if(settings.env == 'dev') {
// user.loginsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// user.subsid = "sub_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// }
loginsid = "saasp_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7";
let loginsid = "saasmcth_" + uuidv4();
loginsid = "saasmcth_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7";
await this.redisClient.setWithEx(loginsid, JSON.stringify(user), 60 * 60 * 5);
return loginsid;
}
......
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
const settings = require("../../../../config/settings")
class OrderService extends ServiceBase {
constructor() {
super();
}
async microAdd(params) {
var rs = await this.callms("order", "saasOrderMicroAdd", params);
return rs;
}
async info(params) {
var rs = await this.callms("order", "saasOrderInfo", params);
return rs;
}
async page(params) {
var rs = await this.callms("order", "saasOrderPage", params);
return rs;
}
}
module.exports = OrderService;
\ No newline at end of file
......@@ -10,23 +10,7 @@ class UserService extends ServiceBase {
async login(params) {
try {
return await this.callms("uc", "platformLogin", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async registerInner(params) {
try {
return await this.callms("uc", "platformRegisterInner", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async resetPasswordInner(params) {
try {
return await this.callms("uc", "platformResetPasswordInner", params);
return await this.callms("uc", "merchantLogin", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
......@@ -34,15 +18,7 @@ class UserService extends ServiceBase {
async info(params) {
try {
return await this.callms("uc", "platformInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async enabled(params) {
try {
return await this.callms("uc", "platformEnabled", params);
return await this.callms("uc", "merchantInfo", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
......@@ -50,12 +26,11 @@ class UserService extends ServiceBase {
async mapByIds(params) {
try {
return await this.callms("uc", "platforMapByIds", params);
return await this.callms("uc", "merchantMapByIds", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = UserService;
\ No newline at end of file
......@@ -182,7 +182,7 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
order: domain2 + ":3103" + path,
order: domain + ":3103" + path,
// order: "http://127.0.0.1:3103" + path,
// 发票服务
......
......@@ -10,7 +10,7 @@ module.exports = function (app) {
var jsonUser = req.session.user;
// var jsonUser = null;
if(!jsonUser) {
loginsid = req.headers["xggsaasplatformsid"] || "";
loginsid = req.headers["xggsaamerchantsid"] || "";
jsonUser = await redisClient.get(loginsid);
if(jsonUser) {
jsonUser = JSON.parse(jsonUser);
......@@ -63,6 +63,7 @@ module.exports = function (app) {
if(req.loginUser) {
req.query = req.query || {};
req.query.saas_id = req.loginUser.saas_id;
req.query.saas_merchant_id = req.loginUser.saas_merchant_id;
}
params.push(methodName);
params.push(req.body);
......@@ -94,6 +95,7 @@ module.exports = function (app) {
if(req.loginUser) {
req.body.saas_id = req.loginUser.saas_id;
req.body.saas_merchant_id = req.loginUser.saas_merchant_id;
}
params.push(methodName);
......
......@@ -16,6 +16,10 @@
#### 返回结果
```javascript
header传值key
"xggsaamerchantsid": "xxxxxxx"
{
"status": 0,
"msg": "success",
......
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