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
733c8590
Commit
733c8590
authored
Jan 16, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
2a92bd1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
2 deletions
+48
-2
xgg-admin/app/base/controller/impl/uc/userCtl.js
+47
-1
xgg-admin/app/base/system.js
+1
-1
No files found.
xgg-admin/app/base/controller/impl/uc/userCtl.js
View file @
733c8590
...
...
@@ -38,6 +38,9 @@ class UserCtl extends CtlBase {
loginUser
=
loginUser
.
data
;
// 处理用户菜单
this
.
buildMenu
(
loginUser
);
var
xggadminsid
=
await
this
.
setLogin
(
loginUser
);
return
system
.
getResultSuccess
(
xggadminsid
);
}
catch
(
error
)
{
...
...
@@ -46,6 +49,35 @@ class UserCtl extends CtlBase {
}
}
buildMenu
(
loginUser
)
{
if
(
!
loginUser
||
!
loginUser
.
menus
||
loginUser
.
menus
.
length
==
0
)
{
return
;
}
let
menus
=
loginUser
.
menus
;
let
sysMenus
=
[];
for
(
let
menu
of
menus
)
{
let
sm
=
{
name
:
menu
.
name
||
""
,
icon
:
menu
.
icon
||
""
,
}
let
team
=
[];
if
(
menu
.
childs
)
{
for
(
let
child
of
menu
.
childs
)
{
team
.
push
({
name
:
child
.
name
||
""
,
path
:
child
.
path
||
""
,
});
}
}
sm
.
team
=
team
;
sysMenus
.
push
(
sm
);
}
loginUser
.
menus
=
sysMenus
;
}
async
setLogin
(
user
)
{
var
xggadminsid
=
"pt_"
+
uuidv4
();
xggadminsid
=
"pt_"
+
"3cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
...
...
@@ -90,10 +122,12 @@ class UserCtl extends CtlBase {
return
system
.
getResult
(
null
,
"请选择用户组织机构"
);
}
if
(
user
.
uctype
!=
1
)
{
user
.
org_id
=
null
;
user
.
roles
=
[];
}
user
.
roles
=
this
.
transRoles
(
user
.
roles
);
return
await
this
.
userSve
.
addUser
(
user
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -136,7 +170,7 @@ class UserCtl extends CtlBase {
user
.
org_id
=
null
;
user
.
roles
=
[];
}
user
.
roles
=
this
.
transRoles
(
user
.
roles
);
try
{
return
await
this
.
userSve
.
updUser
(
user
);
}
catch
(
error
)
{
...
...
@@ -218,5 +252,16 @@ class UserCtl extends CtlBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
transRoles
(
roles
)
{
let
rs
=
[];
if
(
!
roles
||
roles
.
length
==
0
)
{
return
;
}
for
(
let
role
of
roles
)
{
rs
.
push
({
role_id
:
role
});
}
return
rs
;
}
}
module
.
exports
=
UserCtl
;
\ No newline at end of file
xgg-admin/app/base/system.js
View file @
733c8590
...
...
@@ -189,7 +189,7 @@ class System {
// invoice: "http://127.0.0.1:3105" + path,
// 发票服务
uc
:
domain
+
":3106"
+
path
,
uc
:
domain
+
":3106"
+
path
,
// uc: "http://127.0.0.1:3106" + path,
}
}
else
{
...
...
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