Commit b5220f75 by 孙亚楠

Merge branch 'xgg-deliver-ali' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-deliver-ali

parents 18840f22 c44768e9
...@@ -51,8 +51,8 @@ class UserCtl extends CtlBase { ...@@ -51,8 +51,8 @@ class UserCtl extends CtlBase {
let rs = { let rs = {
key: loginKey.xggadminsid, key: loginKey.xggadminsid,
taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&target=tax&baseurl=${loginBaseUrl}`, // taxLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&target=tax&baseurl=${loginBaseUrl}`,
finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&baseurl=${loginBaseUrl}`, // finLoginUrl: ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${loginKey.subsid}&baseurl=${loginBaseUrl}`,
loginname: loginUser.ucname, loginname: loginUser.ucname,
auth: loginUser.auth, auth: loginUser.auth,
isManager: loginUser.isManager, isManager: loginUser.isManager,
...@@ -67,19 +67,34 @@ class UserCtl extends CtlBase { ...@@ -67,19 +67,34 @@ class UserCtl extends CtlBase {
} }
} }
async ngaLogin(params, pobj2, req, res) {
// 登录用户
let loginUser = req.loginUser;
// 登录地址加密
let ntapi = settings.ntapi();
let loginUrl = settings.protocalPrefix + req.headers['host'] + "/#/logins";
console.log(loginUrl, "---------------loginUrl--------------");
let loginBaseUrl = system.base64_encode(loginUrl);
let url;
// 登录用户key
let subsid = "sub_" + req.sid.replace("jfs_", "");
await this.redisClientTax.setWithEx(subsid, (loginUser.nt_user_id || "").toString(), 60 * 60 * 5);
if (params.type == "tax") {
url = ntapi.taxLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&target=tax&baseurl=${loginBaseUrl}`;
} else {
url = ntapi.finLoginUrl + `?username=${loginUser.ucname}&cookieId=${subsid}&baseurl=${loginBaseUrl}`;
}
return system.getResult(url);
}
async setLogin(user) { async setLogin(user) {
user.loginsid = "jfs_" + uuidv4(); user.loginsid = "jfs_" + uuidv4();
user.subsid = "sub_" + uuidv4();
// if(settings.env == 'dev') {
// user.loginsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// user.subsid = "sub_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// }
// xggadminsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
await this.redisClient.setWithEx(user.loginsid, JSON.stringify(user), 60 * 60 * 5); await this.redisClient.setWithEx(user.loginsid, JSON.stringify(user), 60 * 60 * 5);
await this.redisClientTax.setWithEx(user.subsid, (user.nt_user_id || "").toString(), 60 * 60 * 5);
return { return {
xggadminsid: user.loginsid, xggadminsid: user.loginsid
subsid: user.subsid,
}; };
} }
...@@ -115,10 +130,13 @@ class UserCtl extends CtlBase { ...@@ -115,10 +130,13 @@ class UserCtl extends CtlBase {
"name": "订单中心", "name": "订单中心",
"icon": "iconfont icon-gth-gsdingdanzhongxin", "icon": "iconfont icon-gth-gsdingdanzhongxin",
"team": [ "team": [
{ {"name": "全部订单", "path": "/trading/ordersAll"},
"name": "订单管理", {"name": "我的业务订单", "path": "/trading/glyorderInformation"},
"path": "/trading/ordersAll" {"name": "工商注册", "path": "/trading/glyRegister"},
}, {"name": "刻章办理", "path": "/trading/glyHandle"},
{"name": "银行开户", "path": "/trading/glyBank"},
{"name": "税务报道", "path": "/trading/glyReport"},
{"name": "代理记账", "path": "/trading/glyAccount"},
] ]
}, },
{ {
...@@ -131,16 +149,6 @@ class UserCtl extends CtlBase { ...@@ -131,16 +149,6 @@ class UserCtl extends CtlBase {
}, },
] ]
}, },
// {
// "name": "用户中心",
// "icon": "iconfont icon-gth-gsgetihuzhongxin",
// "team": [
// {
// "name": "用户管理",
// "path": "/user/userCenter"
// }
// ]
// }
]; ];
} else { } else {
return [ return [
...@@ -158,10 +166,12 @@ class UserCtl extends CtlBase { ...@@ -158,10 +166,12 @@ class UserCtl extends CtlBase {
"name": "订单中心", "name": "订单中心",
"icon": "iconfont icon-gth-gsdingdanzhongxin", "icon": "iconfont icon-gth-gsdingdanzhongxin",
"team": [ "team": [
{ {"name": "我的业务订单", "path": "/trading/orderInformation"},
"name": "我的业务订单", {"name": "工商注册", "path": "/trading/ywyRegister"},
"path": "/trading/orderInformation" {"name": "刻章办理", "path": "/trading/ywyHandle"},
} {"name": "银行开户", "path": "/trading/ywyBank"},
{"name": "税务报道", "path": "/trading/ywyReport"},
{"name": "代理记账", "path": "/trading/ywyAccount"},
] ]
}, },
{ {
......
...@@ -132,7 +132,7 @@ class UserService extends ServiceBase { ...@@ -132,7 +132,7 @@ class UserService extends ServiceBase {
async salesmanList(params) { async salesmanList(params) {
try { try {
let rs = await this.callms("common", "deliverUsers", params); let rs = await this.callms("common", "deliverUserAll", params);
return rs; return rs;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
......
...@@ -16,7 +16,7 @@ module.exports = function (app) { ...@@ -16,7 +16,7 @@ module.exports = function (app) {
jsonUser = JSON.parse(jsonUser); jsonUser = JSON.parse(jsonUser);
} }
} }
req.sid = xggadminsid || "";
if (req.url.indexOf("auth/userCtl/login") > 0 || if (req.url.indexOf("auth/userCtl/login") > 0 ||
req.url.indexOf("uc/userCtl/login") > 0 || req.url.indexOf("uc/userCtl/login") > 0 ||
req.url.indexOf("auth/userCtl/smsCode") > 0 || req.url.indexOf("auth/userCtl/smsCode") > 0 ||
......
...@@ -26,7 +26,7 @@ var settings = { ...@@ -26,7 +26,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 || 3012, port: process.env.NODE_PORT || 3112,
reqEsAddr: function () { reqEsAddr: function () {
if (this.env == "dev") { if (this.env == "dev") {
var localsettings = require("./localsettings"); var localsettings = require("./localsettings");
......
<a name="menu">目录</a> <a name="menu">目录</a>
1. [登录](#login) 1. [登录](#login)
1. [财税登录](#ngaLogin)
1. [当前用户信息查询](#currentUser) 1. [当前用户信息查询](#currentUser)
## **<a name="login"> 登录</a>** ## **<a name="login"> 登录</a>**
...@@ -35,6 +36,33 @@ ...@@ -35,6 +36,33 @@
``` ```
## **<a name="ngaLogin"> 财税登录</a>**
[返回到目录](#menu)
##### URL
[/web/uc/userCtl/ngaLogin]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
| 参数 | 必选 | 类型 | 说明|
| -------- | -------- | ------------|---------|
| **type** | 是 | String | 税务或者财务(tax, fin)|
```javascript
{
"type": "tax" // 登录类型 tax税务 fin财务
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": "https://nt.gongsibao.com/web/auth?..." // 登录地址,判断一下不为空的话,window.open这个
}
```
## **<a name="currentUser"> 当前用户信息查询</a>** ## **<a name="currentUser"> 当前用户信息查询</a>**
[返回到目录](#menu) [返回到目录](#menu)
......
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