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
58c677d2
Commit
58c677d2
authored
May 22, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
4e62dab9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
+36
-1
center-manage/app/base/controller/impl/auth/userCtl.js
+12
-1
center-manage/app/base/service/impl/auth/userSve.js
+24
-0
No files found.
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
58c677d2
...
...
@@ -7,7 +7,18 @@ class UserCtl extends CtlBase {
constructor
()
{
super
(
"auth"
,
CtlBase
.
getServiceName
(
UserCtl
));
}
async
pmgetUserByCode
(
pobj
,
qobj
,
req
){
let
code
=
pobj
.
code
let
rtn
=
await
this
.
service
.
pmgetUserByCode
(
code
)
return
system
.
getResult
(
rtn
)
}
async
loginApp
(
pobj
,
qobj
,
req
){
let
appkey
=
pobj
.
appkey
let
uname
=
pobj
.
username
let
rtn
=
await
this
.
service
.
loginApp
(
appkey
,
uname
)
return
system
.
getResult
(
rtn
);
}
async
resetPassword
(
pobj
,
qobj
,
req
){
await
this
.
service
.
resetPassword
(
req
.
xctx
.
username
,
pobj
.
onepassword
)
return
system
.
getResult
({});
...
...
center-manage/app/base/service/impl/auth/userSve.js
View file @
58c677d2
...
...
@@ -9,7 +9,31 @@ class UserService extends ServiceBase {
this
.
roleDao
=
system
.
getObject
(
"db.auth.roleDao"
);
this
.
authS
=
system
.
getObject
(
"service.auth.authSve"
);
}
async
pmgetUserByCode
(
code
){
let
ux
=
await
this
.
cacheManager
[
"UserCache"
].
getCache
(
code
);
return
ux
;
}
async
loginApp
(
appkey
,
uname
){
let
rtn
=
{}
let
app
=
await
this
.
cacheManager
[
"AppCache"
].
cache
(
appkey
);
let
url
=
app
.
homePage
let
userLogined
=
this
.
cacheManager
[
"UserCache"
].
cache
(
uname
);
rtn
.
user
=
userLogined
if
(
userLogined
)
{
let
token
=
await
self
.
cmakejwt
(
userLogined
.
jwtkey
,
userLogined
.
jwtsecret
,
null
);
rtn
.
token
=
token
;
}
let
roleids
=
userLogined
.
Roles
.
map
(
item
=>
{
return
item
.
id
})
let
auths
=
await
this
.
authS
.
findAuthsByRole
(
roleids
)
rtn
.
user
.
access
=
auths
let
code
=
this
.
getUUID
()
this
.
cacheManager
[
"UserCache"
].
cache
(
code
,
rtn
,
60000
);
let
url
=
app
.
homePage
+
"?code="
+
code
return
{
url
:
url
};
}
//登录后的租户创建属于租户的用户
//需要在控制器里取出公司ID
//和租户绑定同一家公司
...
...
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