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
74c42368
Commit
74c42368
authored
Apr 27, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
c1aaceed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
center-manage/app/base/controller/impl/auth/userCtl.js
+9
-1
center-manage/app/base/service/impl/auth/userSve.js
+2
-2
No files found.
center-manage/app/base/controller/impl/auth/userCtl.js
View file @
74c42368
...
...
@@ -38,6 +38,14 @@ class UserCtl extends CtlBase {
return
rtn
;
}
async
create
(
p
,
q
,
req
){
//检查是否有用户名和密码
if
(
!
pobj
.
userName
)
{
return
system
.
getResult
(
null
,
"请检查用户名和密码是否存在"
)
}
let
rtn
=
await
this
.
service
.
registerByTantent
(
p
,
q
);
return
rtn
;
}
//登录后的租户创建属于租户的用户
//需要在控制器里取出公司ID
//和租户绑定同一家公司
...
...
@@ -45,7 +53,7 @@ class UserCtl extends CtlBase {
//控制器端检查用户名和密码非空
async
registerByTantent
(
p
,
q
,
req
)
{
//检查是否有用户名和密码
if
(
!
pobj
.
userName
||
!
pobj
.
password
)
{
if
(
!
pobj
.
userName
)
{
return
system
.
getResult
(
null
,
"请检查用户名和密码是否存在"
)
}
let
rtn
=
await
this
.
service
.
registerByTantent
(
p
,
q
);
...
...
center-manage/app/base/service/impl/auth/userSve.js
View file @
74c42368
...
...
@@ -103,7 +103,7 @@ class UserService extends ServiceBase {
//先
let
userfind
=
await
self
.
dao
.
model
.
findOne
({
where
:
{
userName
:
p
.
userName
,
app_id
:
settings
.
pmappid
},
attributes
:
[
'userName'
,
'nickName'
,
'headUrl'
,
'jwtkey'
,
'jwtsecret'
],
attributes
:
[
'userName'
,
'nickName'
,
'headUrl'
,
'jwtkey'
,
'jwtsecret'
,
'created_at'
,
'isSuper'
,
'isAdmin'
],
include
:
[{
model
:
self
.
db
.
models
.
company
,
raw
:
true
,
attributes
:
[
"companykey"
]
}]
});
...
...
@@ -122,7 +122,7 @@ class UserService extends ServiceBase {
async
getUserInfo
(
uname
){
let
userfind
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
userName
:
uname
,
app_id
:
settings
.
pmappid
},
attributes
:
[
'userName'
,
'nickName'
,
"headUrl"
],
attributes
:
[
'userName'
,
'nickName'
,
"headUrl"
,
'isSuper'
,
'isAdmin'
],
include
:
[{
model
:
this
.
db
.
models
.
company
,
raw
:
true
,
attributes
:
[
"companykey"
]
}]
});
return
userfind
;
...
...
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