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
bba774f2
Commit
bba774f2
authored
4 years ago
by
Maofei94
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of g.civnet.cn:test/maintenance
parents
84ddf94d
e24f991f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
246 additions
and
124 deletions
+246
-124
.env
.env
+1
-1
addDevMiddlewares.js
server/middlewares/addDevMiddlewares.js
+121
-57
app.js
src/app.js
+2
-2
index.js
src/components/BaseForm/index.js
+2
-1
index.tsx
src/components/Upload/index.tsx
+36
-34
index.js
src/containers/App/index.js
+2
-2
BasicLayout.js
src/layouts/BasicLayout.js
+7
-5
AppMenu.js
src/pages/appConfig/AppMenu.js
+1
-1
index.js
src/pages/user/login/index.js
+8
-5
UserManage.js
src/pages/userCenter/UserManage.js
+0
-0
UserManage.less
src/pages/userCenter/UserManage.less
+34
-10
siteConfigDrawer.js
src/pages/webConfig/components/siteConfigDrawer.js
+6
-1
config.js
src/routes/config.js
+5
-5
api.js
src/services/common/api.js
+4
-0
api.js
src/services/userCenter/userManage/api.js
+17
-0
No files found.
.env
View file @
bba774f2
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY
= http://localhost:8005/
PROXY
=/Cityinterface:http://192.168.10.151:8055;/Publish:http://192.168.10.151:8055;/Web4:http://192.168.10.151:8055;/CityTemp:http://192.168.10.151:8055
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/
...
...
This diff is collapsed.
Click to expand it.
server/middlewares/addDevMiddlewares.js
View file @
bba774f2
...
...
@@ -14,6 +14,116 @@ function createWebpackMiddleware(compiler, publicPath) {
});
}
const
setupProxyFeature
=
(
app
,
webpackConfig
)
=>
{
console
.
log
(
webpackConfig
);
if
(
!
Array
.
isArray
(
webpackConfig
.
proxy
))
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
webpackConfig
.
proxy
,
'target'
))
{
webpackConfig
.
proxy
=
[
webpackConfig
.
proxy
];
}
else
{
webpackConfig
.
proxy
=
Object
.
keys
(
webpackConfig
.
proxy
).
map
(
context
=>
{
let
proxyOptions
;
// For backwards compatibility reasons.
const
correctedContext
=
context
.
replace
(
/^
\*
$/
,
'**'
)
.
replace
(
/
\/\*
$/
,
''
);
if
(
typeof
webpackConfig
.
proxy
[
context
]
===
'string'
)
{
proxyOptions
=
{
context
:
correctedContext
,
target
:
webpackConfig
.
proxy
[
context
],
};
}
else
{
proxyOptions
=
Object
.
assign
({},
webpackConfig
.
proxy
[
context
]);
proxyOptions
.
context
=
correctedContext
;
}
proxyOptions
.
logLevel
=
proxyOptions
.
logLevel
||
'warn'
;
return
proxyOptions
;
});
}
}
// eslint-disable-next-line consistent-return
const
getProxyMiddleware
=
proxyConfig
=>
{
const
context
=
proxyConfig
.
context
||
proxyConfig
.
path
;
// It is possible to use the `bypass` method without a `target`.
// However, the proxy middleware has no use in this case, and will fail to instantiate.
if
(
proxyConfig
.
target
)
{
return
createProxyMiddleware
(
context
,
proxyConfig
);
}
};
/**
* Assume a proxy configuration specified as:
* proxy: [
* {
* context: ...,
* ...options...
* },
* // or:
* function() {
* return {
* context: ...,
* ...options...
* };
* }
* ]
*/
webpackConfig
.
proxy
.
forEach
(
proxyConfigOrCallback
=>
{
let
proxyMiddleware
;
let
proxyConfig
=
typeof
proxyConfigOrCallback
===
'function'
?
proxyConfigOrCallback
()
:
proxyConfigOrCallback
;
proxyMiddleware
=
getProxyMiddleware
(
proxyConfig
);
if
(
proxyConfig
.
ws
)
{
this
.
websocketProxies
.
push
(
proxyMiddleware
);
}
// eslint-disable-next-line consistent-return
const
handle
=
(
req
,
res
,
next
)
=>
{
if
(
typeof
proxyConfigOrCallback
===
'function'
)
{
const
newProxyConfig
=
proxyConfigOrCallback
();
if
(
newProxyConfig
!==
proxyConfig
)
{
proxyConfig
=
newProxyConfig
;
proxyMiddleware
=
getProxyMiddleware
(
proxyConfig
);
}
}
// - Check if we have a bypass function defined
// - In case the bypass function is defined we'll retrieve the
// bypassUrl from it otherwise bypassUrl would be null
const
isByPassFuncDefined
=
typeof
proxyConfig
.
bypass
===
'function'
;
const
bypassUrl
=
isByPassFuncDefined
?
proxyConfig
.
bypass
(
req
,
res
,
proxyConfig
)
:
null
;
if
(
typeof
bypassUrl
===
'boolean'
)
{
// skip the proxy
req
.
url
=
null
;
next
();
}
else
if
(
typeof
bypassUrl
===
'string'
)
{
// byPass to that url
req
.
url
=
bypassUrl
;
next
();
}
else
if
(
proxyMiddleware
)
{
return
proxyMiddleware
(
req
,
res
,
next
);
}
else
{
next
();
}
};
app
.
use
(
handle
);
// Also forward error requests to the proxy so it can handle them.
app
.
use
((
error
,
req
,
res
,
next
)
=>
handle
(
req
,
res
,
next
));
});
};
module
.
exports
=
function
addDevMiddlewares
(
app
,
webpackConfig
)
{
const
compiler
=
webpack
(
webpackConfig
);
const
middleware
=
createWebpackMiddleware
(
...
...
@@ -27,65 +137,19 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
// Since webpackDevMiddleware uses memory-fs internally to store build
// artifacts, we use it instead
const
fs
=
middleware
.
fileSystem
;
let
proxyHost
=
process
.
env
.
PROXY
;
const
proxyPrefix
=
process
.
env
.
PROXY_PREFIX
||
'/Cityinterface'
;
app
.
get
(
'/setproxy'
,
(
req
,
res
)
=>
{
if
(
req
.
query
&&
req
.
query
.
host
)
{
proxyHost
=
req
.
query
.
host
;
res
.
send
(
200
);
}
else
{
res
.
send
(
400
);
}
});
if
(
proxyHost
&&
(
proxyHost
.
toLowerCase
()
!==
'origin'
||
proxyHost
.
toLowerCase
()
!==
'off'
||
proxyHost
!==
'0'
)
)
{
logger
.
info
(
`using proxy at:
${
proxyHost
}
`
);
logger
.
info
(
`proxy prefix:
${
proxyPrefix
}
`
);
app
.
use
(
proxyPrefix
,
createProxyMiddleware
({
target
:
proxyHost
,
if
(
process
.
env
.
PROXY
)
{
const
proxies
=
process
.
env
.
PROXY
.
split
(
';'
);
// 设置代理
setupProxyFeature
(
app
,
{
proxy
:
proxies
.
map
(
proxyStr
=>
{
const
mathes
=
proxyStr
.
match
(
/^
\s
*
([/\w]
+
)\s
*:
\s
*
(
.+
)\s
*$/
);
return
{
path
:
mathes
[
1
],
target
:
mathes
[
2
],
changeOrigin
:
true
,
// eslint-disable-next-line no-unused-vars
onProxyReq
:
(
_prexyReq
,
_req
,
_res
)
=>
{
logger
.
info
(
'onProxyReq'
);
},
// eslint-disable-next-line no-unused-vars
onProxyRes
(
_proxyRes
,
_req
,
_res
)
{
logger
.
info
(
'onProxyRes'
);
},
};
}),
);
const
proxy2
=
process
.
env
.
PROXY2
;
if
(
proxy2
)
{
const
reg
=
/
([/\w]
+
)\s
*:
\s
*
([\w
:.
/]
*
)
/
;
const
match
=
proxy2
.
match
(
reg
);
const
[,
pre
,
host
]
=
match
;
logger
.
info
(
`using proxy2 at:
${
host
}
`
);
const
prefix
=
`
${
pre
[
0
]
===
'/'
?
pre
:
`/
${
pre
}
`
}
`
;
logger
.
info
(
`proxy2 prefix:
${
prefix
}
`
);
app
.
use
(
prefix
,
createProxyMiddleware
({
target
:
host
,
changeOrigin
:
true
,
// eslint-disable-next-line no-unused-vars
onProxyReq
:
(
_prexyReq
,
_req
,
_res
)
=>
{
logger
.
info
(
'onProxyReq2'
);
},
// eslint-disable-next-line no-unused-vars
onProxyRes
(
_proxyRes
,
_req
,
_res
)
{
logger
.
info
(
'onProxyRes2'
);
},
}),
);
}
});
}
app
.
get
(
'*'
,
(
_req
,
res
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app.js
View file @
bba774f2
...
...
@@ -17,7 +17,7 @@ import zhCN from 'antd/es/locale/zh_CN';
import
configureStore
from
'./configureStore'
;
import
App
from
'./containers/App'
;
import
history
from
'./utils/history'
;
import
config
from
'./routes/config'
;
const
initialState
=
Immutable
.
Map
();
const
store
=
configureStore
(
initialState
,
history
);
const
MOUNT_NODE
=
document
.
getElementById
(
'app'
);
...
...
@@ -27,7 +27,7 @@ const render = () => {
<
Provider
store
=
{
store
}
>
<
ConnectedRouter
history
=
{
history
}
>
<
ConfigProvider
locale
=
{
zhCN
}
>
<
App
/>
<
App
routesConfig
=
{
config
}
/
>
<
/ConfigProvider
>
<
/ConnectedRouter
>
<
/Provider>
,
...
...
This diff is collapsed.
Click to expand it.
src/components/BaseForm/index.js
View file @
bba774f2
...
...
@@ -70,6 +70,7 @@ const BaseForm = props => {
getForm
,
// 用来获取表单实例
formProps
,
children
,
...
restProps
}
=
props
;
const
[
form
]
=
useForm
();
...
...
@@ -81,7 +82,7 @@ const BaseForm = props => {
},
[]);
return
(
<
Form
size
=
"small"
form
=
{
form
}
{...
formProps
}
>
<
Form
size
=
"small"
form
=
{
form
}
{...
formProps
}
{...
restProps
}
>
{
items
&&
items
.
map
(
item
=>
{
const
{
...
...
This diff is collapsed.
Click to expand it.
src/components/Upload/index.tsx
View file @
bba774f2
...
...
@@ -4,9 +4,10 @@ import { PlusOutlined, CheckCircleFilled } from '@ant-design/icons';
import
ImgCrop
from
'antd-img-crop'
;
import
classnames
from
'classnames'
;
import
{
UploadFile
,
UploadChangeParam
,
RcFile
}
from
'antd/lib/upload/interface'
;
import
{
isDev
,
unParams
,
uuid
}
from
'@/utils/tools'
;
import
{
get
}
from
'@/services'
;
import
{
uuid
}
from
'@/utils/tools'
;
import
{
get
,
PUBLISH_SERVICE
}
from
'@/services'
;
import
styles
from
'./index.less'
;
import
{
getImageBases
}
from
'@/services/common/api'
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -35,6 +36,7 @@ interface PicturesWallType {
onChange
?:
(
v
:
any
)
=>
void
;
cropRate
?:
number
|
boolean
;
isCrop
?:
boolean
;
type
?:
'CityTemp'
|
'icon'
|
'androidMenu'
|
'menuNew'
}
class
PicturesWall
extends
React
.
Component
<
PicturesWallType
>
{
...
...
@@ -43,11 +45,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
previewImage
:
''
,
wallModalVisible
:
false
,
previewTitle
:
''
,
imgBed
:
{
icon
:
[],
bg
:
[],
uploaded
:
[],
},
imgBed
:
[],
curSelectedImg
:
''
,
fileList
:
this
.
props
.
fileList
||
[],
};
...
...
@@ -90,9 +88,9 @@ class PicturesWall extends React.Component<PicturesWallType> {
const
fileList
=
[
{
uid
:
uuid
(
8
,
16
),
name
:
'
h5-dooring图片库
'
,
name
:
'
熊猫运维中台系统
'
,
status
:
'done'
,
url
:
this
.
state
.
curSelectedImg
,
url
:
this
.
getImageUrl
(
this
.
state
.
curSelectedImg
)
,
},
];
this
.
props
.
onChange
&&
this
.
props
.
onChange
(
fileList
);
...
...
@@ -103,11 +101,11 @@ class PicturesWall extends React.Component<PicturesWallType> {
this
.
setState
({
fileList
});
if
(
file
.
status
===
'done'
)
{
const
files
=
fileList
.
map
(
item
=>
{
const
{
uid
,
name
,
status
}
=
item
;
const
url
=
item
.
url
||
item
.
response
.
result
.
url
;
return
{
uid
,
name
,
status
,
url
};
const
{
status
,
data
,
name
,
thumbUrl
}
=
item
;
const
url
=
thumbUrl
||
this
.
getImageUrl
(
data
)
;
return
{
uid
:
uuid
(
8
,
16
)
,
name
,
status
,
url
};
});
this
.
props
.
onChange
&&
this
.
props
.
onChange
(
files
);
this
.
props
.
onChange
&&
this
.
props
.
onChange
(
this
.
props
.
maxLen
===
1
?
files
[
0
].
url
:
files
.
map
(
f
=>
f
.
url
)
);
}
};
...
...
@@ -128,12 +126,19 @@ class PicturesWall extends React.Component<PicturesWallType> {
};
componentDidMount
()
{
get
(
`/visible/bed/get?tid=
${
unParams
(
location
.
search
)
!
.
tid
}
`
).
then
(
res
=>
{
// res &&
// this.setState({
// imgBed: res,
// });
});
const
{
type
=
''
}
=
this
.
props
;
getImageBases
(
type
).
then
(
res
=>
{
if
(
res
.
code
===
0
){
this
.
setState
({
imgBed
:
res
.
data
})
}
})
}
getImageUrl
(
path
){
if
(
path
.
indexOf
(
'http'
)
===
0
){
return
path
}
return
`
${
window
.
location
.
origin
}
/
${
path
}
`
.
replace
(
/
\\
/g
,
'/'
)
}
render
()
{
...
...
@@ -147,7 +152,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
curSelectedImg
,
}
=
this
.
state
;
const
{
action
=
isDev
?
'http://192.168.1.8:3000/api/v0/files/upload/free'
:
'你的服务器地址'
,
action
=
`
${
window
.
location
.
origin
}${
PUBLISH_SERVICE
}
/FileCenter/UploadSingleFile`
,
headers
,
withCredentials
=
true
,
maxLen
=
1
,
...
...
@@ -162,8 +167,6 @@ class PicturesWall extends React.Component<PicturesWallType> {
</
div
>
);
const
cates
=
Object
.
keys
(
imgBed
);
return
(
<>
{
isCrop
?
(
...
...
@@ -178,14 +181,14 @@ class PicturesWall extends React.Component<PicturesWallType> {
fileList=
{
fileList
}
onPreview=
{
this
.
handlePreview
}
onChange=
{
this
.
handleChange
}
name=
"
f
ile"
name=
"
singleF
ile"
listType=
"picture-card"
className=
{
styles
.
avatarUploader
}
action=
{
action
}
withCredentials=
{
withCredentials
}
headers=
{
{
'x-requested-with'
:
localStorage
.
getItem
(
'user'
)
||
''
,
authorizatio
n
:
localStorage
.
getItem
(
'token'
)
||
''
,
toke
n
:
localStorage
.
getItem
(
'token'
)
||
''
,
...
headers
,
}
}
beforeUpload=
{
this
.
handleBeforeUpload
}
...
...
@@ -198,14 +201,14 @@ class PicturesWall extends React.Component<PicturesWallType> {
fileList=
{
fileList
}
onPreview=
{
this
.
handlePreview
}
onChange=
{
this
.
handleChange
}
name=
"
f
ile"
name=
"
singleF
ile"
listType=
"picture-card"
className=
{
styles
.
avatarUploader
}
action=
{
action
}
withCredentials=
{
withCredentials
}
headers=
{
{
'x-requested-with'
:
localStorage
.
getItem
(
'user'
)
||
''
,
authorizatio
n
:
localStorage
.
getItem
(
'token'
)
||
''
,
toke
n
:
localStorage
.
getItem
(
'token'
)
||
''
,
...
headers
,
}
}
beforeUpload=
{
this
.
handleBeforeUpload
}
...
...
@@ -214,7 +217,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
</
Upload
>
)
}
<
div
className=
{
styles
.
wallBtn
}
onClick=
{
this
.
handleWallShow
}
>
图片库
从图片库选择
</
div
>
<
Modal
visible=
{
previewVisible
}
...
...
@@ -222,7 +225,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
footer=
{
null
}
onCancel=
{
this
.
handleCancel
}
>
<
img
alt=
"预览图片"
style=
{
{
width
:
'100%'
}
}
src=
{
previewImage
}
/>
<
img
alt=
"预览图片"
style=
{
{
width
:
'100%'
}
}
src=
{
this
.
getImageUrl
(
previewImage
)
}
/>
</
Modal
>
<
Modal
visible=
{
wallModalVisible
}
...
...
@@ -233,13 +236,12 @@ class PicturesWall extends React.Component<PicturesWallType> {
onCancel=
{
this
.
handleModalCancel
}
onOk=
{
this
.
handleModalOk
}
>
<
Tabs
defaultActiveKey=
{
cates
[
0
]
}
tabPosition=
"left"
style=
{
{
height
:
520
}
}
>
{
cates
.
map
((
item
,
i
)
=>
{
<
Tabs
defaultActiveKey=
{
imgBed
[
0
]?.
moduleName
}
tabPosition=
"left"
style=
{
{
height
:
520
}
}
>
{
imgBed
.
map
((
item
,
i
)
=>
{
return
(
<
TabPane
tab=
{
wallCateName
[
item
]
}
key=
{
item
}
>
<
TabPane
tab=
{
item
.
moduleName
}
key=
{
item
.
moduleName
}
>
<
div
className=
{
styles
.
imgBox
}
>
{
(
imgBed
as
any
)[
item
]
&&
(
imgBed
as
any
)[
item
].
map
((
item
:
string
,
i
:
number
)
=>
{
{
item
.
child
?.
map
(
m
=>
m
.
fileUrls
).
flat
(
Infinity
).
map
((
item
:
string
,
i
:
number
)
=>
{
return
(
<
div
className=
{
classnames
(
...
...
@@ -249,7 +251,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
key=
{
i
}
onClick=
{
()
=>
this
.
handleImgSelected
(
item
)
}
>
<
img
src=
{
item
}
alt=
"熊猫运维中台系统"
/>
<
img
src=
{
this
.
getImageUrl
(
item
)
}
alt=
"熊猫运维中台系统"
/>
<
span
className=
{
styles
.
iconBtn
}
>
<
CheckCircleFilled
/>
</
span
>
...
...
This diff is collapsed.
Click to expand it.
src/containers/App/index.js
View file @
bba774f2
...
...
@@ -3,12 +3,12 @@ import { Helmet } from 'react-helmet';
import
{
renderRoutes
}
from
'react-router-config'
;
import
{
BrowserRouter
as
Router
,
Switch
}
from
'react-router-dom'
;
import
{
appConnector
}
from
'./store'
;
import
config
from
'../../routes/config'
;
import
Authozed
from
'@/utils/authority'
;
import
UserLogin
from
'@/pages/user/login'
;
import
UserLayout
from
'@/layouts/UserLayout'
;
import
{
AUTHORITY
,
BASENAME
}
from
'@/utils/constants'
;
export
default
appConnector
(
function
App
(
props
)
{
const
{
routesConfig
}
=
props
;
return
(
<>
<
Helmet
titleTemplate
=
"%s - 运维平台"
defaultTitle
=
"运维平台"
>
...
...
@@ -23,7 +23,7 @@ export default appConnector(function App(props) {
}
authority
=
{[
AUTHORITY
.
LOGIN
]}
>
<
Switch
>
{
renderRoutes
(
c
onfig
.
routes
)}
<
/Switch
>
<
Switch
>
{
renderRoutes
(
routesC
onfig
.
routes
)}
<
/Switch
>
<
/Authozed
>
<
/Router
>
<
/
>
...
...
This diff is collapsed.
Click to expand it.
src/layouts/BasicLayout.js
View file @
bba774f2
...
...
@@ -7,6 +7,7 @@ import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
import
logo
from
'../assets/images/logo/panda-logo.svg'
;
import
RightContent
from
'../components/GlobalHeader/RightContent'
;
import
{
BASENAME
}
from
'@/utils/constants'
;
// const noMatch = (
// <Result
...
...
@@ -27,15 +28,16 @@ const defaultFooterDom = (
const
BasicLayout
=
props
=>
{
/* eslint-disable no-unused-vars */
const
[
pathname
,
setPathname
]
=
useState
(
'/welcome'
);
const
[
pathname
,
setPathname
]
=
useState
(
`/
${
BASENAME
}
`
);
const
filterMenu
=
menuRoutes
=>
menuRoutes
.
map
(
route
=>
{
if
(
route
.
routes
)
route
.
routes
=
filterMenu
(
route
.
routes
);
return
route
.
hideMenu
||
(
route
.
authority
&&
!
check
(
route
.
authority
,
true
,
false
))
const
routeCopy
=
{
...
route
};
if
(
routeCopy
.
routes
)
routeCopy
.
routes
=
filterMenu
(
routeCopy
.
routes
);
return
routeCopy
.
hideMenu
||
(
routeCopy
.
authority
&&
!
check
(
routeCopy
.
authority
,
true
,
false
))
?
null
:
route
;
:
route
Copy
;
})
.
filter
(
Boolean
);
const
handleMenuCollapse
=
()
=>
{};
// get children authority
...
...
This diff is collapsed.
Click to expand it.
src/pages/appConfig/AppMenu.js
View file @
bba774f2
...
...
@@ -153,7 +153,7 @@ const AppMenu = () => {
<
/
>
),
key
:
menu
.
menuID
,
icon
:
menu
.
leaf
?
<
FileOutlined
/>
:
<
FolderOpenOutlined
/>
,
//
icon: menu.leaf ? <FileOutlined /> : <FolderOpenOutlined />,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children
:
haveChildren
?
menu
.
children
.
map
(
i
=>
mapTree
(
i
))
:
[],
};
...
...
This diff is collapsed.
Click to expand it.
src/pages/user/login/index.js
View file @
bba774f2
...
...
@@ -48,10 +48,13 @@ const Login = props => {
history
.
push
(
`/dbm/dbInit/`
);
}
if
(
userMode
===
USER_MODE
.
COMMON
)
{
const
authority
=
[
AUTHORITY
.
LOGIN
,
AUTHORITY
.
COMMON
];
setAuthority
(
authority
);
setAuth
(
authority
);
history
.
push
(
`/ou/orgList/`
);
// const authority = [AUTHORITY.LOGIN, AUTHORITY.COMMON];
// setAuthority(authority);
// setAuth(authority);
// history.push(`/ou/orgList/`);
notification
.
warning
({
message
:
msg
||
'没有权限!'
,
});
}
}
else
{
notification
.
warning
({
...
...
@@ -60,7 +63,7 @@ const Login = props => {
}
setLoading
(
false
);
})
.
then
(
e
=>
{
.
catch
(
e
=>
{
setLoading
(
false
);
notification
.
error
({
message
:
e
.
message
||
'没有权限!'
,
...
...
This diff is collapsed.
Click to expand it.
src/pages/userCenter/UserManage.js
View file @
bba774f2
This diff is collapsed.
Click to expand it.
src/pages/userCenter/UserManage.less
View file @
bba774f2
...
...
@@ -30,7 +30,15 @@
display: block;
}
}
.ant-pagination-prev,.ant-pagination-next{
line-height: 8px !important;
}
.ant-input-search-button{
line-height: 1;
}
.ant-dropdown-menu-item > .anticon:first-child {
vertical-align: 0.15em !important;
}
}
.redText{
color: red;
...
...
@@ -78,9 +86,13 @@
height: calc(100vh - 74px);
float: left;
padding: 10px;
width: 200px;
padding-right: 22px;
width: 240px;
background: white;
overflow: auto;
margin-right:10px;
transform: translateX(0px);
transition: transform 0.5s;
.ant-tree{
padding-top: 6px;
.ant-tree-switcher{
...
...
@@ -91,14 +103,23 @@
}
}
}
.switcher{
color: #1890FF;
font-size: 18px;
position: absolute;
left: 220px;
top: 46%;
}
}
.hide{
display: none;
.orgContainerHide{
transform: translateX(-230px);
}
.userContainer{
height: calc(100vh -
168
px) !important;
height: calc(100vh -
74
px) !important;
flex: 1;
min-width:
84
0px;
min-width:
76
0px;
background: white;
.ant-table-pagination{
padding-right: 12px;
...
...
@@ -106,14 +127,13 @@
margin: 1px 0;
padding:8px;
padding-right: 20px;
.ant-pagination-prev,.ant-pagination-next{
line-height: 8px !important;
}
}
.ant-btn{
margin: 0px 10px;
.ant-btn-primary{
margin-left: 20px;
background: #50aefc;
}
}
.ant-input-search-button{
margin-left: 0px !important;
}
...
...
@@ -133,6 +153,10 @@
border-right: white;
overflow: auto !important;
}
.ant-pagination{
z-index: 999;
border-top: 1px solid #f0eded;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/pages/webConfig/components/siteConfigDrawer.js
View file @
bba774f2
...
...
@@ -193,7 +193,12 @@ export default props => {
visible
=
{
visible
}
maskClosable
=
{
false
}
>
<
BaseForm
{...
formConfig
}
/
>
<
BaseForm
{...
formConfig
}
onFinish
=
{
values
=>
{
console
.
log
(
values
);
}}
/
>
<
/Drawer
>
<
/div
>
);
...
...
This diff is collapsed.
Click to expand it.
src/routes/config.js
View file @
bba774f2
...
...
@@ -33,7 +33,7 @@ const iconStyle = { verticalAlign: '0.125em' };
const
superAuthority
=
[
USER_MODE
.
SUPER
];
const
adminAuthority
=
[...
superAuthority
,
USER_MODE
.
ADMIN
];
const
commonAuthority
=
[...
adminAuthority
,
USER_MODE
.
COMMON
];
//
const commonAuthority = [...adminAuthority, USER_MODE.COMMON];
export
default
{
routes
:
[
...
...
@@ -102,7 +102,7 @@ export default {
path
:
'/userCenter'
,
name
:
'用户中心'
,
component
:
BlankLayout
,
authority
:
commo
nAuthority
,
authority
:
admi
nAuthority
,
icon
:
<
UsergroupAddOutlined
style
=
{
iconStyle
}
/>
,
routes
:
[
{
...
...
@@ -133,7 +133,7 @@ export default {
component
:
BlankLayout
,
name
:
'平台中心'
,
icon
:
<
SettingOutlined
style
=
{
iconStyle
}
/>
,
authority
:
commo
nAuthority
,
authority
:
admi
nAuthority
,
routes
:
[
{
path
:
'/platformCenter/gis'
,
...
...
@@ -188,7 +188,7 @@ export default {
component
:
BlankLayout
,
name
:
'应用中心'
,
icon
:
<
HomeOutlined
style
=
{
iconStyle
}
/>
,
authority
:
commo
nAuthority
,
authority
:
admi
nAuthority
,
routes
:
[
{
path
:
'/productCenter/web'
,
...
...
@@ -212,7 +212,7 @@ export default {
component
:
BlankLayout
,
name
:
'系统日志'
,
icon
:
<
CopyOutlined
style
=
{
iconStyle
}
/>
,
authority
:
commo
nAuthority
,
authority
:
admi
nAuthority
,
routes
:
[
{
path
:
'/log/common'
,
...
...
This diff is collapsed.
Click to expand it.
src/services/common/api.js
0 → 100644
View file @
bba774f2
import
{
post
,
postForm
,
get
,
PUBLISH_SERVICE
}
from
'../index'
;
export
const
getImageBases
=
moduleName
=>
get
(
`
${
PUBLISH_SERVICE
}
/FileCenter/GetFileUrls`
,
{
moduleName
});
This diff is collapsed.
Click to expand it.
src/services/userCenter/userManage/api.js
View file @
bba774f2
...
...
@@ -100,6 +100,15 @@ export const addToOrg = (userID, orgID, newOrgID) =>
oldOUID
:
orgID
,
newOUID
:
newOrgID
,
});
// 批量更改机构
export
const
addToOrgs
=
(
userIDs
,
orgIDs
,
newOrgID
)
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/ModifyUserRole`
,
{
_version
:
9999
,
_dc
:
Date
.
now
(),
userIds
:
userIDs
,
oldGroupIds
:
orgIDs
,
newGroupId
:
newOrgID
,
});
export
const
updateUserPassword
=
(
userID
,
...
...
@@ -141,6 +150,14 @@ export const deleteUser = userID =>
_dc
:
Date
.
now
(),
userID
,
});
// 批量删除用户
export
const
multiDeleteUsers
=
(
userIDs
,
orgIDs
)
=>
get
(
`
${
PUBLISH_SERVICE
}
/UserCenter/DeleteUsers`
,
{
_version
:
9999
,
_dc
:
Date
.
now
(),
userIds
:
userIDs
,
groupId
:
orgIDs
,
});
export
const
setUserRelation
=
(
userID
,
roleList
=
[],
stationList
)
=>
post
(
...
...
This diff is collapsed.
Click to expand it.
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