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
b8994f6a
Commit
b8994f6a
authored
May 21, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
565e22a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
center-manage/app/base/service/impl/auth/userSve.js
+11
-4
No files found.
center-manage/app/base/service/impl/auth/userSve.js
View file @
b8994f6a
...
@@ -59,11 +59,18 @@ class UserService extends ServiceBase {
...
@@ -59,11 +59,18 @@ class UserService extends ServiceBase {
//设置默认角色,租户
//设置默认角色,租户
//设置默认普通角色,由于有了租户概念,所以注册时,需要知道当前租户和应用的id 才可以设置默认角色 todo
//设置默认普通角色,由于有了租户概念,所以注册时,需要知道当前租户和应用的id 才可以设置默认角色 todo
//如果是非租户,那么按照当前应用ID是找不到指定的角色,所以是空的
//如果是非租户,那么按照当前应用ID是找不到指定的角色,所以是空的
if
(
p
.
isAdmin
){
var
roles
=
await
self
.
roleDao
.
model
.
findAll
({
where
:
{
id
:
{
[
self
.
db
.
Op
.
in
]:
rolecodes
},
app_id
:
roleappid
,
company_id
:
p
.
company_id
},
transaction
:
t
});
var
roles
=
await
self
.
roleDao
.
model
.
findAll
({
where
:
{
id
:
{
[
self
.
db
.
Op
.
in
]:
rolecodes
},
app_id
:
roleappid
,
company_id
:
settings
.
pmcompanyid
},
transaction
:
t
});
if
(
roles
&&
roles
.
length
>
0
)
{
if
(
roles
&&
roles
.
length
>
0
)
{
await
u
.
setRoles
(
roles
,
{
transaction
:
t
});
await
u
.
setRoles
(
roles
,
{
transaction
:
t
});
}
}
else
{
var
roles
=
await
self
.
roleDao
.
model
.
findAll
({
where
:
{
id
:
{
[
self
.
db
.
Op
.
in
]:
rolecodes
},
app_id
:
roleappid
,
company_id
:
p
.
company_id
},
transaction
:
t
});
if
(
roles
&&
roles
.
length
>
0
)
{
await
u
.
setRoles
(
roles
,
{
transaction
:
t
});
}
}
}
//创建统一账号 to add extra fields
//创建统一账号 to add extra fields
let
cred
=
await
self
.
cregister
(
u
.
userName
,
p
.
company_id
,
p
.
password
,
u
.
id
+
""
)
let
cred
=
await
self
.
cregister
(
u
.
userName
,
p
.
company_id
,
p
.
password
,
u
.
id
+
""
)
console
.
log
(
"......................................"
);
console
.
log
(
"......................................"
);
...
...
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