Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
c40fbb91
Commit
c40fbb91
authored
May 10, 2021
by
mayongxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据鉴权
parent
73d07fda
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
40 deletions
+127
-40
.env
.env
+1
-1
index.jsx
src/pages/authcontrol/index.jsx
+42
-10
AuthModal.jsx
src/pages/userCenter/userManage/AuthModal.jsx
+34
-17
UserManage.js
src/pages/userCenter/userManage/UserManage.js
+29
-4
config.js
src/routes/config.js
+7
-7
api.js
src/services/database/api.js
+11
-0
api.js
src/services/userCenter/userManage/api.js
+3
-1
No files found.
.env
View file @
c40fbb91
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY=/Cityinterface:http://192.168.1
0.150:8777;/Publish:http://192.168.10.150:8777;/Web4:http://192.168.10.150:8777;/CityTemp:http://192.168.10.150:8777
PROXY=/Cityinterface:http://192.168.1
9.105:8049;/Publish:http://192.168.19.105:8049;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/
...
...
src/pages/authcontrol/index.jsx
View file @
c40fbb91
import
React
,
{
useEffect
,
useState
}
from
'react'
import
PageContainer
from
'@/components/BasePageContainer'
;
import
{
Card
,
Form
,
Input
,
Button
,
Switch
,
message
}
from
'antd'
import
{
GetAuthSet
,
AuthSetting
}
from
'@/services/database/api'
import
styles
from
'./index.less'
import
{
useTheme
}
from
'bizcharts'
;
const
AuthControl
=
()
=>
{
const
[
checked
,
setChecked
]
=
useState
()
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
[
auChecked
,
setAuChecked
]
=
useState
()
const
[
cacheChecked
,
setCacheAuChecked
]
=
useState
()
useEffect
(()
=>
{
GetAuthSet
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setAuChecked
(
res
.
IsOpenAuth
)
setCacheAuChecked
(
res
.
IsUseCache
)
}
}
)
},
[])
},
[
flag
])
const
loadConfig
=
()
=>
{
}
const
operateControl
=
()
=>
{
const
operateControl
=
value
=>
{
AuthSetting
({
IsOpenAuth
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
0
){
setFlag
(
flag
+
1
)
message
.
success
(
"设置成功!"
)
}
}
)
}
return
(
<>
<
PageContainer
>
<
Card
title=
"数据管理"
style=
{
{
width
:
350
,
marginLeft
:
15
}
}
>
<
div
className=
{
styles
.
auth_container
}
>
<
div
className=
{
styles
.
operate_item
}
>
<
div
>
数据库鉴权
</
div
>
<
Switch
checkedChildren=
'开启'
unCheckedChildren=
'关闭'
checked=
{
checked
}
onChange=
{
operateControl
}
/>
<
div
style=
{
{
display
:
"flex"
,
flexWrap
:
"wrap"
}
}
>
<
Card
title=
"数据管理"
style=
{
{
width
:
350
,
marginLeft
:
15
}
}
>
<
div
className=
{
styles
.
auth_container
}
>
<
div
className=
{
styles
.
operate_item
}
>
<
div
>
数据库鉴权
</
div
>
<
Switch
checkedChildren=
'开启'
unCheckedChildren=
'关闭'
checked=
{
auChecked
}
onChange=
{
operateControl
}
/>
</
div
>
</
div
>
</
div
>
</
Card
>
</
Card
>
<
Card
title=
"缓存管理"
style=
{
{
width
:
350
,
marginLeft
:
15
}
}
>
<
div
className=
{
styles
.
auth_container
}
>
<
div
className=
{
styles
.
operate_item
}
>
<
div
>
开启缓存
</
div
>
<
Switch
checkedChildren=
'开启'
unCheckedChildren=
'关闭'
checked=
{
cacheChecked
}
disabled=
{
true
}
/>
</
div
>
</
div
>
</
Card
>
</
div
>
</
PageContainer
>
</>
)
...
...
src/pages/userCenter/userManage/AuthModal.jsx
View file @
c40fbb91
import
React
,
{
useState
}
from
'react'
import
{
Modal
,
Form
,
Input
,
notification
,
message
,
Radio
,
Checkbox
}
from
'antd'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
Modal
,
Form
,
Input
,
notification
,
message
,
Radio
,
Checkbox
}
from
'antd'
;
import
{
GetUserAuthSet
,}
from
'@/services/database/api'
import
SiteModal
from
'@/components/Modal/SiteModa'
;
const
AuthModal
=
props
=>
{
const
plainOptions
=
[
'
新增'
,
'编辑'
,
'删除'
];
const
plainOptions
=
[
'
访客'
,
'普通用户'
,
'管理员'
,
"超级管理员"
];
const
[
form
]
=
Form
.
useForm
();
const
{
Item
}
=
Form
;
const
{
title
,
visible
,
onCancel
,
onSelect
}
=
props
;
const
{
title
,
visible
,
onCancel
,
onSelect
,
currentUser
}
=
props
;
useEffect
(()
=>
{
currentUser
.
userID
&&
visible
GetUserAuthSet
({
UserId
:
currentUser
.
userID
}).
then
(
res
=>
{
}
)
},[
currentUser
])
const
onTypeChange
=
()
=>
{
}
...
...
@@ -17,26 +31,29 @@ const AuthModal = props => {
return
(
<
Modal
<
Site
Modal
title=
{
title
}
visible=
{
visible
}
onCancel=
{
onCancel
}
onOk=
{
onSubmit
}
okText=
"确认"
cancelText=
"取消"
width=
"800px"
>
<
Form
form=
{
form
}
labelCol=
{
{
span
:
4
}
}
>
<
Item
label=
"允许操作"
name=
"operate_type"
>
<
Checkbox
.
Group
options=
{
plainOptions
}
onChange=
{
onTypeChange
}
/>
</
Item
>
</
Form
>
</
Modal
>
<
div
style=
{
{
width
:
'800px'
}
}
>
<
Form
form=
{
form
}
>
<
Item
label=
"数据权限"
name=
"operate_type"
>
<
Checkbox
.
Group
options=
{
plainOptions
}
onChange=
{
onTypeChange
}
/>
</
Item
>
</
Form
>
</
div
>
</
SiteModal
>
)
}
...
...
src/pages/userCenter/userManage/UserManage.js
View file @
c40fbb91
...
...
@@ -46,7 +46,8 @@ import {
multiDeleteUsers
,
setOrgArea
,
getOrgArea
,
GetMapSetByGroupID
GetMapSetByGroupID
,
GetOUTreeNew
}
from
'@/services/userCenter/userManage/api'
;
import
Tree
from
'@/components/ExpendableTree'
;
import
classnames
from
'classnames'
;
...
...
@@ -323,9 +324,32 @@ const UserManage = () => {
// 重新渲染树
const
updateTrees
=
()
=>
{
setTreeLoading
(
true
);
getUserTree
(
-
1
,
-
1
)
.
then
(
res
=>
{
if
(
res
.
length
>
0
)
{
// getUserTree(-1, -1)
// .then(res => {
// if (res.length > 0) {
// setTreeLoading(false);
// setTreeData(res);
// setTreeDataCopy(res);
// // 第一次加载,默认选择第一个组织
// if (treeState) {
// onSelect([res[0].id], false);
// setTreeState(false);
// }
// } else {
// setTreeLoading(false);
// notification.error({
// message: '获取失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setTreeLoading(false);
// message.error(err);
// });
GetOUTreeNew
({
selectOU
:
-
1
}).
then
(
newres
=>
{
if
(
newres
.
code
==
0
)
{
let
res
=
newres
.
data
setTreeLoading
(
false
);
setTreeData
(
res
);
setTreeDataCopy
(
res
);
...
...
@@ -544,6 +568,7 @@ const UserManage = () => {
};
//用户鉴权
const
authUser
=
record
=>
{
setCurrentUser
(
record
);
setAuthUserVisible
(
true
)
}
// 查找用户
...
...
src/routes/config.js
View file @
c40fbb91
...
...
@@ -81,13 +81,6 @@ export default {
authority
:
superAuthority
,
component
:
CurrentSolution
,
},
{
path
:
'/authcontrol'
,
name
:
'数据鉴权'
,
icon
:
<
SolutionOutlined
style
=
{
iconStyle
}
/>
,
authority
:
superAuthority
,
component
:
AuthControl
,
},
{
path
:
'/dbm'
,
name
:
'数据库管理'
,
...
...
@@ -113,8 +106,15 @@ export default {
authority
:
adminAuthority
,
component
:
DatabaseConnectConfig
,
},
{
path
:
'/dbm/authcontrol'
,
name
:
'数据鉴权'
,
authority
:
superAuthority
,
component
:
AuthControl
,
},
],
},
{
path
:
'/userCenter'
,
name
:
'用户中心'
,
...
...
src/services/database/api.js
View file @
c40fbb91
...
...
@@ -196,5 +196,16 @@ export const editMySQLConnString = params =>
export
const
GetConnTest
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/DBManager/GetConnectionTest`
,
params
);
//接口鉴权
export
const
AuthSetting
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/AuthSetting`
,
params
);
export
const
GetAuthSet
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/GetAuthSet`
,
params
);
export
const
AddUserAuthSetting
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/AddUserAuthSetting`
,
params
);
export
const
GetUserAuthSet
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/WebSite/GetUserAuthSet`
,
params
);
src/services/userCenter/userManage/api.js
View file @
c40fbb91
...
...
@@ -174,5 +174,7 @@ export const setOrgArea = params =>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/SetOrgUserArea`
,
params
)
export
const
getOrgArea
=
params
=>
get
(
`
${
CITY_SERVICE
}
/OMS.svc/GetOrgUserArea`
,
params
)
export
const
GetMapSetByGroupID
=
params
=>
export
const
GetMapSetByGroupID
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/GetMapSetByGroupID`
,
params
)
export
const
GetOUTreeNew
=
params
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/GetOUTree`
,
params
)
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