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
f7ecff90
Commit
f7ecff90
authored
Nov 29, 2019
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
78a765c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
31 deletions
+96
-31
xggsve-uc/app/base/api/impl/op/action.js
+13
-7
xggsve-uc/app/base/service/impl/org/orgSve.js
+29
-22
xggsve-uc/app/base/service/impl/role/roleSve.js
+27
-0
xggsve-uc/app/base/service/impl/saas/saasSve.js
+27
-2
No files found.
xggsve-uc/app/base/api/impl/op/action.js
View file @
f7ecff90
...
@@ -56,6 +56,9 @@ class ActionAPI extends APIBase {
...
@@ -56,6 +56,9 @@ class ActionAPI extends APIBase {
case
"listSaas"
:
case
"listSaas"
:
opResult
=
await
this
.
saasSve
.
apiListSaas
(
action_body
);
opResult
=
await
this
.
saasSve
.
apiListSaas
(
action_body
);
break
;
break
;
case
"saasQueryById"
:
opResult
=
await
this
.
saasSve
.
apiQueryById
(
action_body
);
break
;
// 组织机构
// 组织机构
case
"addOrg"
:
case
"addOrg"
:
...
@@ -70,8 +73,8 @@ class ActionAPI extends APIBase {
...
@@ -70,8 +73,8 @@ class ActionAPI extends APIBase {
case
"listOrg"
:
case
"listOrg"
:
opResult
=
await
this
.
orgSve
.
apiListOrg
(
action_body
);
opResult
=
await
this
.
orgSve
.
apiListOrg
(
action_body
);
break
;
break
;
case
"
find
ById"
:
case
"
orgQuery
ById"
:
opResult
=
await
this
.
orgSve
.
api
Find
ById
(
action_body
);
opResult
=
await
this
.
orgSve
.
api
Query
ById
(
action_body
);
break
;
break
;
case
"byPid"
:
case
"byPid"
:
opResult
=
await
this
.
orgSve
.
apiByPid
(
action_body
);
opResult
=
await
this
.
orgSve
.
apiByPid
(
action_body
);
...
@@ -82,20 +85,20 @@ class ActionAPI extends APIBase {
...
@@ -82,20 +85,20 @@ class ActionAPI extends APIBase {
// 菜单权限
// 菜单权限
case
"addAuth"
:
case
"addAuth"
:
return
this
.
authSve
.
add
(
action_body
);
opResult
=
this
.
authSve
.
add
(
action_body
);
break
;
break
;
case
"updAuth"
:
case
"updAuth"
:
return
this
.
authSve
.
upd
(
action_body
);
opResult
=
this
.
authSve
.
upd
(
action_body
);
break
;
break
;
case
"tree"
:
case
"tree"
:
return
this
.
authSve
.
tree
(
action_body
);
opResult
=
this
.
authSve
.
tree
(
action_body
);
break
;
break
;
case
"byPid"
:
case
"byPid"
:
return
this
.
authSve
.
byPid
(
action_body
);
opResult
=
this
.
authSve
.
byPid
(
action_body
);
break
;
break
;
case
"delAuth"
:
case
"delAuth"
:
// TODO 验证是否有角色关联
// TODO 验证是否有角色关联
return
this
.
authSve
.
del
(
action_body
);
opResult
=
this
.
authSve
.
del
(
action_body
);
break
;
break
;
// 角色
// 角色
...
@@ -111,6 +114,9 @@ class ActionAPI extends APIBase {
...
@@ -111,6 +114,9 @@ class ActionAPI extends APIBase {
case
"listRole"
:
case
"listRole"
:
opResult
=
await
this
.
roleSve
.
apiListRole
(
action_body
);
opResult
=
await
this
.
roleSve
.
apiListRole
(
action_body
);
break
;
break
;
case
"roleQueryById"
:
opResult
=
await
this
.
roleSve
.
apiQueryById
(
action_body
);
break
;
// 用户
// 用户
case
"addUser"
:
case
"addUser"
:
...
...
xggsve-uc/app/base/service/impl/org/orgSve.js
View file @
f7ecff90
...
@@ -67,7 +67,7 @@ class OrgService extends ServiceBase {
...
@@ -67,7 +67,7 @@ class OrgService extends ServiceBase {
* 根据ID查明细
* 根据ID查明细
* @param {*} params
* @param {*} params
*/
*/
async
api
Find
ById
(
params
){
async
api
Query
ById
(
params
){
try
{
try
{
return
await
this
.
queryById
(
params
)
return
await
this
.
queryById
(
params
)
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -249,33 +249,39 @@ class OrgService extends ServiceBase {
...
@@ -249,33 +249,39 @@ class OrgService extends ServiceBase {
}
}
async
byPid
(
obj
)
{
async
byPid
(
obj
)
{
var
list
=
await
this
.
dao
.
findAll
({
try
{
pid
:
obj
.
pid
||
0
,
var
list
=
await
this
.
dao
.
findAll
({
});
pid
:
obj
.
pid
||
0
,
return
list
;
});
return
system
.
getResult
(
list
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
/**
* 结构树
*/
async
tree
()
{
async
tree
()
{
var
all
=
await
this
.
dao
.
all
();
try
{
var
pmap
=
{};
var
all
=
await
this
.
dao
.
all
();
for
(
var
item
of
all
)
{
var
pmap
=
{};
var
list
=
pmap
[
item
.
pid
];
for
(
var
item
of
all
)
{
if
(
!
list
)
{
var
list
=
pmap
[
item
.
pid
];
list
=
[];
if
(
!
list
)
{
list
=
[];
}
list
.
push
(
item
);
pmap
[
item
.
pid
]
=
list
;
}
}
list
.
push
(
item
);
for
(
var
item
of
all
)
{
pmap
[
item
.
pid
]
=
list
;
item
.
childs
=
pmap
[
item
.
id
]
||
[];
if
(
item
.
pid
===
0
)
{
tree
=
item
;
}
}
console
.
log
(
item
.
pid
);
return
system
.
getResult
(
pmap
[
0
]);
}
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
for
(
var
item
of
all
)
{
item
.
childs
=
pmap
[
item
.
id
]
||
[];
}
}
return
pmap
[
0
];
}
}
}
}
module
.
exports
=
OrgService
;
module
.
exports
=
OrgService
;
\ No newline at end of file
xggsve-uc/app/base/service/impl/role/roleSve.js
View file @
f7ecff90
...
@@ -17,6 +17,14 @@ class RoleService extends ServiceBase {
...
@@ -17,6 +17,14 @@ class RoleService extends ServiceBase {
}
}
}
}
async
apiQueryById
(
params
){
try
{
return
await
this
.
queryById
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
/**
* role 更新
* role 更新
* @param {*} params
* @param {*} params
...
@@ -136,6 +144,25 @@ class RoleService extends ServiceBase {
...
@@ -136,6 +144,25 @@ class RoleService extends ServiceBase {
}
}
/**
/**
* 根据ID查询明细
* @param {*} params
*/
async
queryById
(
params
){
try
{
if
(
!
params
.
id
){
return
system
.
getResult
(
-
1
,
`参数错误 ID不能为空`
);
}
let
_role
=
await
this
.
findById
(
this
.
trim
(
params
.
id
));
if
(
!
_role
){
return
system
.
getResult
(
-
1
,
`角色不存在`
);
}
return
system
.
getResult
(
_role
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 查询列表
* 查询列表
* @param {*} params
* @param {*} params
*/
*/
...
...
xggsve-uc/app/base/service/impl/saas/saasSve.js
View file @
f7ecff90
...
@@ -53,8 +53,17 @@ class SaasService extends ServiceBase {
...
@@ -53,8 +53,17 @@ class SaasService extends ServiceBase {
}
}
}
}
/**
* asss明细
* @param {*} params
*/
async
apiQueryById
(
params
){
try
{
return
this
.
queryById
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/********************************************************************** */
/********************************************************************** */
...
@@ -168,5 +177,20 @@ class SaasService extends ServiceBase {
...
@@ -168,5 +177,20 @@ class SaasService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
async
queryById
(
params
){
try
{
if
(
!
params
.
id
){
return
system
.
getResult
(
-
1
,
`参数错误 ID不能为空`
);
}
let
_saas
=
await
this
.
findById
(
this
.
trim
(
params
.
id
));
if
(
!
_saas
){
return
system
.
getResult
(
-
1
,
`当前信息不存在`
);
}
return
system
.
getResult
(
_saas
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
module
.
exports
=
SaasService
;
module
.
exports
=
SaasService
;
\ No newline at end of file
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