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
4d393709
Commit
4d393709
authored
May 12, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
61bcb046
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
center-manage/app/base/db/impl/common/connection.js
+8
-6
center-manage/app/base/db/models/auth/user.js
+1
-1
No files found.
center-manage/app/base/db/impl/common/connection.js
View file @
4d393709
...
@@ -32,20 +32,22 @@ class DbFactory{
...
@@ -32,20 +32,22 @@ class DbFactory{
/*建立用户和角色之间的关系*/
/*建立用户和角色之间的关系*/
this
.
db
.
models
.
user
.
belongsToMany
(
this
.
db
.
models
.
role
,
{
as
:
"Roles"
,
through
:
'p_userrole'
,
constraints
:
false
,});
this
.
db
.
models
.
user
.
belongsToMany
(
this
.
db
.
models
.
role
,
{
as
:
"Roles"
,
through
:
'p_userrole'
,
constraints
:
false
,});
this
.
db
.
models
.
role
.
belongsToMany
(
this
.
db
.
models
.
user
,
{
as
:
"Users"
,
through
:
'p_userrole'
,
constraints
:
false
,});
this
.
db
.
models
.
role
.
belongsToMany
(
this
.
db
.
models
.
user
,
{
as
:
"Users"
,
through
:
'p_userrole'
,
constraints
:
false
,});
/*组织机构*/
/*组织机构
自引用
*/
this
.
db
.
models
.
org
.
belongsTo
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
this
.
db
.
models
.
org
.
belongsTo
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
this
.
db
.
models
.
org
.
hasMany
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
this
.
db
.
models
.
org
.
hasMany
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
//组织机构和角色是多对多关系
//组织机构和角色是多对多关系,建立兼职岗位,给岗位赋予多个角色,从而同步修改用户的角色
this
.
db
.
models
.
org
.
belongsTo
(
this
.
db
.
models
.
role
,{
constraints
:
false
,});
//通过岗位接口去修改用户的角色
// this.db.models.role.belongsToMany(this.db.models.org,{through: this.db.models.orgrole,constraints: false,});
this
.
db
.
models
.
role
.
belongsToMany
(
this
.
db
.
models
.
org
,{
through
:
this
.
db
.
models
.
orgrole
,
constraints
:
false
,});
this
.
db
.
models
.
org
.
belongsToMany
(
this
.
db
.
models
.
role
,{
through
:
this
.
db
.
models
.
orgrole
,
constraints
:
false
,});
//组织机构和用户是
多对多关系
//组织机构和用户是
1对多,
this
.
db
.
models
.
user
.
belongsTo
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
this
.
db
.
models
.
user
.
belongsTo
(
this
.
db
.
models
.
org
,{
constraints
:
false
,});
this
.
db
.
models
.
org
.
hasMany
(
this
.
db
.
models
.
user
,{
constraints
:
false
,});
this
.
db
.
models
.
user
.
belongsTo
(
this
.
db
.
models
.
app
,{
constraints
:
false
,});
this
.
db
.
models
.
user
.
belongsTo
(
this
.
db
.
models
.
app
,{
constraints
:
false
,});
this
.
db
.
models
.
role
.
belongsTo
(
this
.
db
.
models
.
app
,
{
constraints
:
false
,});
this
.
db
.
models
.
role
.
belongsTo
(
this
.
db
.
models
.
app
,
{
constraints
:
false
,});
this
.
db
.
models
.
org
.
belongsTo
(
this
.
db
.
models
.
app
,{
constraints
:
false
,});
this
.
db
.
models
.
auth
.
belongsTo
(
this
.
db
.
models
.
app
,{
constraints
:
false
,});
this
.
db
.
models
.
auth
.
belongsTo
(
this
.
db
.
models
.
app
,{
constraints
:
false
,});
this
.
db
.
models
.
auth
.
belongsTo
(
this
.
db
.
models
.
company
,{
constraints
:
false
,});
this
.
db
.
models
.
auth
.
belongsTo
(
this
.
db
.
models
.
company
,{
constraints
:
false
,});
...
...
center-manage/app/base/db/models/auth/user.js
View file @
4d393709
...
@@ -46,7 +46,7 @@ module.exports = (db, DataTypes) => {
...
@@ -46,7 +46,7 @@ module.exports = (db, DataTypes) => {
defaultValue
:
true
defaultValue
:
true
},
},
opath
:
DataTypes
.
STRING
,
//作业务时,需要在业务表冗余当前处理人的opath
opath
:
DataTypes
.
STRING
,
//作业务时,需要在业务表冗余当前处理人的opath
p
path
:
DataTypes
.
STRING
,
//权限路径,主岗下的人大于opath一级,查询时按照opath去查询
p
tags
:
DataTypes
.
STRING
,
//权限标签,逗号分隔,可以按照标签查看opath中含有标签的数据
},{
},{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
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