Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
b5220f75
Commit
b5220f75
authored
Apr 27, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-deliver-ali' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-deliver-ali
parents
18840f22
c44768e9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
32 deletions
+70
-32
xgg-deliver/app/base/controller/impl/uc/userCtl.js
+39
-29
xgg-deliver/app/base/service/impl/uc/userSve.js
+1
-1
xgg-deliver/app/config/routes/web.js
+1
-1
xgg-deliver/app/config/settings.js
+1
-1
xgg-deliver/app/front/entry/public/apidoc/user/login.md
+28
-0
No files found.
xgg-deliver/app/base/controller/impl/uc/userCtl.js
View file @
b5220f75
...
...
@@ -51,8 +51,8 @@ class UserCtl extends CtlBase {
let
rs
=
{
key
:
loginKey
.
xggadminsid
,
taxLoginUrl
:
ntapi
.
taxLoginUrl
+
`?username=
${
loginUser
.
ucname
}
&cookieId=
${
loginKey
.
subsid
}
&target=tax&baseurl=
${
loginBaseUrl
}
`
,
finLoginUrl
:
ntapi
.
taxLoginUrl
+
`?username=
${
loginUser
.
ucname
}
&cookieId=
${
loginKey
.
subsid
}
&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}`,
loginname
:
loginUser
.
ucname
,
auth
:
loginUser
.
auth
,
isManager
:
loginUser
.
isManager
,
...
...
@@ -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
)
{
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
.
redisClientTax
.
setWithEx
(
user
.
subsid
,
(
user
.
nt_user_id
||
""
).
toString
(),
60
*
60
*
5
);
return
{
xggadminsid
:
user
.
loginsid
,
subsid
:
user
.
subsid
,
xggadminsid
:
user
.
loginsid
};
}
...
...
@@ -115,10 +130,13 @@ class UserCtl extends CtlBase {
"name"
:
"订单中心"
,
"icon"
:
"iconfont icon-gth-gsdingdanzhongxin"
,
"team"
:
[
{
"name"
:
"订单管理"
,
"path"
:
"/trading/ordersAll"
},
{
"name"
:
"全部订单"
,
"path"
:
"/trading/ordersAll"
},
{
"name"
:
"我的业务订单"
,
"path"
:
"/trading/glyorderInformation"
},
{
"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 {
},
]
},
// {
// "name": "用户中心",
// "icon": "iconfont icon-gth-gsgetihuzhongxin",
// "team": [
// {
// "name": "用户管理",
// "path": "/user/userCenter"
// }
// ]
// }
];
}
else
{
return
[
...
...
@@ -158,10 +166,12 @@ class UserCtl extends CtlBase {
"name"
:
"订单中心"
,
"icon"
:
"iconfont icon-gth-gsdingdanzhongxin"
,
"team"
:
[
{
"name"
:
"我的业务订单"
,
"path"
:
"/trading/orderInformation"
}
{
"name"
:
"我的业务订单"
,
"path"
:
"/trading/orderInformation"
},
{
"name"
:
"工商注册"
,
"path"
:
"/trading/ywyRegister"
},
{
"name"
:
"刻章办理"
,
"path"
:
"/trading/ywyHandle"
},
{
"name"
:
"银行开户"
,
"path"
:
"/trading/ywyBank"
},
{
"name"
:
"税务报道"
,
"path"
:
"/trading/ywyReport"
},
{
"name"
:
"代理记账"
,
"path"
:
"/trading/ywyAccount"
},
]
},
{
...
...
xgg-deliver/app/base/service/impl/uc/userSve.js
View file @
b5220f75
...
...
@@ -132,7 +132,7 @@ class UserService extends ServiceBase {
async
salesmanList
(
params
)
{
try
{
let
rs
=
await
this
.
callms
(
"common"
,
"deliverUser
s
"
,
params
);
let
rs
=
await
this
.
callms
(
"common"
,
"deliverUser
All
"
,
params
);
return
rs
;
}
catch
(
error
)
{
console
.
log
(
error
);
...
...
xgg-deliver/app/config/routes/web.js
View file @
b5220f75
...
...
@@ -16,7 +16,7 @@ module.exports = function (app) {
jsonUser
=
JSON
.
parse
(
jsonUser
);
}
}
req
.
sid
=
xggadminsid
||
""
;
if
(
req
.
url
.
indexOf
(
"auth/userCtl/login"
)
>
0
||
req
.
url
.
indexOf
(
"uc/userCtl/login"
)
>
0
||
req
.
url
.
indexOf
(
"auth/userCtl/smsCode"
)
>
0
||
...
...
xgg-deliver/app/config/settings.js
View file @
b5220f75
...
...
@@ -26,7 +26,7 @@ var settings = {
salt
:
"%iatpD1gcxz7iF#B"
,
defaultpwd
:
"987456"
,
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
3
0
12
,
port
:
process
.
env
.
NODE_PORT
||
3
1
12
,
reqEsAddr
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
...
...
xgg-deliver/app/front/entry/public/apidoc/user/login.md
View file @
b5220f75
<a
name=
"menu"
>
目录
</a>
1.
[
登录
](
#login
)
1.
[
财税登录
](
#ngaLogin
)
1.
[
当前用户信息查询
](
#currentUser
)
## **<a name="login"> 登录</a>**
...
...
@@ -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>**
[
返回到目录
](
#menu
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment