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
f7460d8d
Commit
f7460d8d
authored
Dec 16, 2024
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: web登录添加验证码配置
parent
3172c4c7
Pipeline
#94663
waiting for manual action with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
94 additions
and
45 deletions
+94
-45
index.tsx
src/components/Upload/index.tsx
+0
-1
ColorLinear.jsx
src/pages/productCenter/webConfig/components/ColorLinear.jsx
+0
-1
HomeConfigModal.jsx
...es/productCenter/webConfig/components/HomeConfigModal.jsx
+16
-19
HomePageConfigs.jsx
...es/productCenter/webConfig/components/HomePageConfigs.jsx
+0
-1
siteConfigDrawer.js
...es/productCenter/webConfig/components/siteConfigDrawer.js
+55
-16
index.jsx
src/pages/productCenter/webConfig/index.jsx
+20
-7
api.js
src/services/webConfig/api.js
+3
-0
No files found.
src/components/Upload/index.tsx
View file @
f7460d8d
...
...
@@ -99,7 +99,6 @@ class PicturesWall extends React.Component<PicturesWallType> {
static
getDerivedStateFromProps
=
(
props
,
state
)
=>
{
const
{
value
,
uploadContext
=
{}
}
=
props
;
const
{
imgBed
,
update
}
=
uploadContext
;
console
.
log
(
imgBed
,
'imgBedimgBedimgBedimgBed'
);
const
fileList
=
state
.
fileList
;
const
shouldUpdate
=
fileList
.
every
(
f
=>
Array
.
isArray
(
value
)
?
!
value
.
some
(
v
=>
f
.
url
===
v
)
:
f
.
url
!==
value
)
...
...
src/pages/productCenter/webConfig/components/ColorLinear.jsx
View file @
f7460d8d
...
...
@@ -64,7 +64,6 @@ const ColorLinear = props => {
onSubumit
(
colorValue
);
handleCancel
();
};
console
.
log
(
angle
,
'angle'
);
return
(
<
Modal
title=
"顶部颜色配置"
...
...
src/pages/productCenter/webConfig/components/HomeConfigModal.jsx
View file @
f7460d8d
...
...
@@ -198,7 +198,6 @@ const HomeConfigModal = props => {
setCheckList
(
list
);
};
const
checkRender
=
list
=>
{
console
.
log
(
list
,
'fasldfjaslkdjf'
);
let
num
=
list
?.
roleGroups
?.
filter
(
ele
=>
ele
.
isCheck
||
ele
.
indeterminate
).
length
;
return
(
<>
...
...
@@ -214,23 +213,21 @@ const HomeConfigModal = props => {
</
Checkbox
>
</
div
>
)
}
{
list
?.
roleGroups
.
map
(
item
=>
{
return
(
<>
{
item
.
roleGroups
?
(
checkRender
(
item
)
)
:
(
<
Checkbox
onChange=
{
e
=>
onChange
(
e
,
item
)
}
style=
{
{
width
:
'150px'
,
marginLeft
:
'0px'
,
marginBottom
:
'10px'
}
}
checked=
{
item
.
isCheck
}
>
{
item
.
roleName
}
</
Checkbox
>
)
}
</>
);
})
}
{
list
?.
roleGroups
.
map
(
item
=>
(
<>
{
item
.
roleGroups
?
(
checkRender
(
item
)
)
:
(
<
Checkbox
onChange=
{
e
=>
onChange
(
e
,
item
)
}
style=
{
{
width
:
'150px'
,
marginLeft
:
'0px'
,
marginBottom
:
'10px'
}
}
checked=
{
item
.
isCheck
}
>
{
item
.
roleName
}
</
Checkbox
>
)
}
</>
))
}
</
div
>
</>
);
...
...
@@ -263,7 +260,7 @@ const HomeConfigModal = props => {
</Form.Item> */
}
<
Form
.
Item
label=
"主页Url"
name=
"homePage"
>
{
/* <Input placeholder="请输入主页路径" autoComplete="off" /> */
}
<
TreeSelect
menuChange=
{
val
=>
{
}
}
userMode=
{
userMode
}
curWeb=
{
curWeb
}
/>
<
TreeSelect
menuChange=
{
val
=>
{}
}
userMode=
{
userMode
}
curWeb=
{
curWeb
}
/>
</
Form
.
Item
>
</
Form
>
<
div
className=
{
styles
.
roleCheck
}
>
{
checkRender
(
checkList
)
}
</
div
>
...
...
src/pages/productCenter/webConfig/components/HomePageConfigs.jsx
View file @
f7460d8d
...
...
@@ -17,7 +17,6 @@ const HomePageConfigs = (props, ref) => {
getHomePageConfig
:
()
=>
orderTable
,
}));
useEffect
(()
=>
{
console
.
log
(
roleHomePages
,
'homePageConfig'
);
if
(
!
roleHomePages
)
{
return
;
}
...
...
src/pages/productCenter/webConfig/components/siteConfigDrawer.js
View file @
f7460d8d
...
...
@@ -24,6 +24,7 @@ import {
Col
,
Switch
,
message
,
InputNumber
,
}
from
'antd'
;
import
RMSComponents
from
'@/components/RolePmSite/index'
;
import
PersonnelSelector
from
'@/components/PersonnelSelector/index'
;
...
...
@@ -77,8 +78,10 @@ export default props => {
userMode
,
webs
,
curWeb
,
codeTypeList
=
[],
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
isVerificationCode
=
Form
.
useWatch
(
'isVerificationCode'
,
form
);
const
[
loginPages
,
setLoginPages
]
=
useState
([]);
const
[
checkedList
,
setCheckedList
]
=
useState
([]);
const
[
indeterminate
,
setIndeterminate
]
=
useState
(
false
);
...
...
@@ -123,7 +126,7 @@ export default props => {
}
else
{
setIndeterminate
(
!!
config
.
topMenu
.
split
(
','
).
length
&&
config
.
topMenu
.
split
(
','
).
length
<
plainOptions
.
length
,
config
.
topMenu
.
split
(
','
).
length
<
plainOptions
.
length
,
);
}
...
...
@@ -174,7 +177,7 @@ export default props => {
setVisibleChecked4
(
config
.
messageVoice
);
setVisibleChecked7
(
config
.
useCoverMap
==
'true'
);
setHomePageConfig
(
config
.
roleHomePages
);
setVisibleAmap
(
config
.
IsGodFirst
)
setVisibleAmap
(
config
.
IsGodFirst
)
;
setVisibleAnn
(
config
.
OpenAnnouncement
);
form
.
setFieldsValue
({
...
config
,
...
...
@@ -194,6 +197,10 @@ export default props => {
headerPrimaryColor
:
config
.
headerPrimaryColor
?
config
.
headerPrimaryColor
:
'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)'
,
isVerificationCode
:
config
.
VerificationConfig
?.
IsVerificationCode
||
false
,
verificationCodeType
:
config
.
VerificationConfig
?.
VerificationCodeType
||
'图片验证码'
,
verificationCodeTimeOut
:
config
.
VerificationConfig
?.
VerificationCodeTimeOut
||
1
,
});
setColor
(
config
.
headerPrimaryColor
...
...
@@ -224,7 +231,7 @@ export default props => {
setVisibleChecked4
(
true
);
setVisibleChecked5
(
true
);
setVisibleChecked7
(
true
);
setVisibleAmap
(
true
)
setVisibleAmap
(
true
)
;
setHomePageConfig
([]);
form
.
setFieldsValue
({
shortcutIcon
:
'assets
\\
images
\\
icon
\\
熊猫-蓝色.png'
,
...
...
@@ -245,6 +252,9 @@ export default props => {
OpenAnnouncement
:
false
,
isGodFirst
:
true
,
headerPrimaryColor
:
'linear-gradient(0deg, #0066D6 0%, #39A9FF 100%)'
,
isVerificationCode
:
config
.
VerificationConfig
?.
IsVerificationCode
||
false
,
verificationCodeType
:
config
.
VerificationConfig
?.
VerificationCodeType
||
'图片验证码'
,
verificationCodeTimeOut
:
config
.
VerificationConfig
?.
VerificationCodeTimeOut
||
1
,
});
setVisibleAnn
(
false
);
setCheckValue
([]);
...
...
@@ -258,7 +268,7 @@ export default props => {
setVisibleChecked2
(
''
);
setVisibleChecked3
(
''
);
setVisibleChecked4
(
''
);
setVisibleAmap
(
''
)
setVisibleAmap
(
''
)
;
setVisibleChecked5
(
''
);
setVisibleAnn
(
''
);
setHomePageConfig
([]);
...
...
@@ -320,13 +330,13 @@ export default props => {
// return;
// }
validate
.
topMenu
=
checkedList
.
toString
();
validate
.
navTheme
=
validate
.
primaryColor
===
'#009A3E'
?
'chinaWater'
:
visibleChecked
?
'light'
:
'dark'
;
validate
.
navTheme
=
validate
.
primaryColor
===
'#009A3E'
?
'chinaWater'
:
visibleChecked
?
'light'
:
'dark'
;
validate
.
CloudStyle
=
visibleChecked1
?
'是'
:
'否'
;
validate
.
messageMarking
=
visibleChecked3
?
'All'
:
'One'
;
validate
.
menuState
=
visibleChecked5
?
'open'
:
'close'
;
validate
.
afterSales
=
checkValue
&&
checkValue
.
toString
();
console
.
log
(
validate
);
if
(
validate
.
homePage
)
{
let
arr
=
validate
.
homePage
.
split
(
'/'
);
// 用const声明常量
let
allProList
=
JSON
.
parse
(
JSON
.
stringify
(
allProductList
));
...
...
@@ -336,7 +346,6 @@ export default props => {
arr
.
shift
();
validate
.
homePage
=
arr
.
join
(
'/'
);
}
console
.
log
(
product
,
'product'
);
validate
.
productType
=
product
?.
PackageName
||
'civweb4'
;
let
proList
=
JSON
.
parse
(
JSON
.
stringify
(
productList
));
proList
.
push
({
PackageName
:
'civ_base'
});
...
...
@@ -349,27 +358,28 @@ export default props => {
}
}
console
.
log
(
validate
,
'validatevalidate'
);
if
(
validate
)
{
const
colorIndex
=
colorList
.
findIndex
(
item
=>
item
.
color
===
validate
.
primaryColor
);
let
pages
=
homepageConfigRef
.
current
.
getHomePageConfig
().
map
((
item
,
index
)
=>
{
let
str
=
item
.
homePage
.
replace
(
/^
[^\/]
+
\/
+/
,
''
);
console
.
log
(
str
,
'fasdasd'
);
return
{
...
item
,
homePage
:
item
.
homePage
.
replace
(
/^
[^\/]
+
\/
+/
,
''
),
index
,
};
});
console
.
log
(
pages
,
'pages'
);
const
verificationConfig
=
{
isVerificationCode
:
validate
.
isVerificationCode
||
false
,
VerificationCodeType
:
validate
.
verificationCodeType
||
'图片验证码'
,
verificationCodeTimeOut
:
validate
.
verificationCodeTimeOut
||
1
,
};
onOk
({
...
validate
,
roleHomePages
:
pages
,
headerPrimaryColor
:
colorList
[
colorIndex
].
headerColor
,
mode
:
'single'
,
menu
:
'banner-left'
,
verificationConfig
,
});
}
});
...
...
@@ -421,9 +431,9 @@ export default props => {
setVisibleAnn
(
e
);
};
const
changeAmapShow
=
(
e
)
=>
{
setVisibleAmap
(
e
)
}
const
changeAmapShow
=
e
=>
{
setVisibleAmap
(
e
)
;
}
;
const
change5
=
e
=>
{
setVisibleChecked5
(
e
);
...
...
@@ -555,6 +565,35 @@ export default props => {
<
Form
.
Item
label
=
"登录模板"
name
=
"loginTemplate"
>
<
AutoComplete
placeholder
=
"请选择登录模板"
options
=
{
loginPages
}
allowClear
filterOption
/>
<
/Form.Item
>
<
Form
.
Item
label
=
"登录验证码"
name
=
"isVerificationCode"
valuePropName
=
"checked"
>
<
Switch
checkedChildren
=
"开启"
unCheckedChildren
=
"关闭"
/>
<
/Form.Item
>
{
isVerificationCode
?
(
<>
<
Form
.
Item
label
=
"验证码类型"
name
=
"verificationCodeType"
rules
=
{[
{
required
:
true
,
message
:
'请选择验证码类型'
,
},
]}
>
<
Select
placeholder
=
"请选择验证码类型"
options
=
{
codeTypeList
}
/
>
<
/Form.Item
>
<
Form
.
Item
label
=
"验证码超时"
name
=
"verificationCodeTimeOut"
>
<
InputNumber
style
=
{{
width
:
'100%'
}}
placeholder
=
"请输入验证码超时时间"
min
=
{
1
}
addonAfter
=
"分钟"
/>
<
/Form.Item
>
<
/
>
)
:
null
}
<
Form
.
Item
label
=
"页面缓存"
name
=
"isCache"
valuePropName
=
"checked"
>
<
Switch
checkedChildren
=
"开启"
unCheckedChildren
=
"关闭"
/>
<
/Form.Item
>
...
...
@@ -565,7 +604,7 @@ export default props => {
主页配置
<
/Divider
>
<
Form
.
Item
label
=
"主页地址(默认)"
name
=
"homePage"
>
<
TreeSelect
menuChange
=
{
val
=>
{
}}
userMode
=
{
userMode
}
curWeb
=
{
curWeb
}
/
>
<
TreeSelect
menuChange
=
{
val
=>
{}}
userMode
=
{
userMode
}
curWeb
=
{
curWeb
}
/
>
<
/Form.Item
>
<
HomePageConfigs
ref
=
{
homepageConfigRef
}
...
...
src/pages/productCenter/webConfig/index.jsx
View file @
f7460d8d
...
...
@@ -15,6 +15,7 @@ import {
omsDeleteWebsite
,
SyncMapComponent
,
BatchDragSingleWebsite
,
GetVerificationCodeType
,
}
from
'@/services/webConfig/api'
;
import
debounce
from
'lodash/debounce'
;
import
{
EditTwoTone
,
ExclamationCircleOutlined
,
OrderedListOutlined
}
from
'@ant-design/icons'
;
...
...
@@ -34,6 +35,7 @@ const WebConfigPage = props => {
const
[
configVisible
,
setConfigVisible
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
webs
,
setWebs
]
=
useState
([]);
const
[
codeTypeList
,
setCodeTypeList
]
=
useState
([]);
// 验证码类型
const
[
curWeb
,
setCurWeb
]
=
useState
(
''
);
// 当前展示的web
const
[
configObj
,
setConfigObj
]
=
useState
({});
// 获取当前的web的配置
const
[
toEdit
,
setToEdit
]
=
useState
(
null
);
// 编辑展示用的配置
...
...
@@ -53,13 +55,13 @@ const WebConfigPage = props => {
if
(
!
canceled
.
cancel
)
setConfigFiles
(
res
.
data
);
});
getProduct
();
getCodeType
();
// 获取验证码类型
return
()
=>
{
canceled
.
cancel
=
true
;
};
},
[]);
useEffect
(()
=>
{
console
.
log
(
curWeb
,
'curWeb'
);
let
canceled
=
{
cancel
:
false
};
if
(
!
curWeb
)
return
;
const
title
=
curWeb
.
text
;
...
...
@@ -70,6 +72,20 @@ const WebConfigPage = props => {
canceled
.
cancel
=
true
;
};
},
[
curWeb
]);
const
getCodeType
=
()
=>
{
GetVerificationCodeType
({}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setCodeTypeList
(
(
res
.
data
||
[]).
map
(
item
=>
({
label
:
item
,
value
:
item
,
})),
);
}
});
};
// 获取产品列表
const
getProduct
=
()
=>
{
getProductList
({
isDel
:
0
}).
then
(
res
=>
{
...
...
@@ -110,7 +126,6 @@ const WebConfigPage = props => {
),
].
flat
(
2
);
if
(
!
canceled
.
cancel
)
{
console
.
log
(
websArr
,
'websArr'
);
setWebs
(
websArr
);
if
(
!
curWeb
)
setCurWeb
(
websArr
[
0
]);
setLoading
(
false
);
...
...
@@ -225,8 +240,8 @@ const WebConfigPage = props => {
}
else
{
url
=
localStorage
.
getItem
(
'pd2-baseUrl'
)
&&
localStorage
.
getItem
(
'pd2-baseUrl'
)
!=
'null'
&&
localStorage
.
getItem
(
'pd2-baseUrl'
)
!=
'undefined'
localStorage
.
getItem
(
'pd2-baseUrl'
)
!=
'null'
&&
localStorage
.
getItem
(
'pd2-baseUrl'
)
!=
'undefined'
?
localStorage
.
getItem
(
'pd2-baseUrl'
)
+
val
:
val
;
}
...
...
@@ -302,7 +317,6 @@ const WebConfigPage = props => {
};
const
SyncMap
=
e
=>
{
console
.
log
(
e
);
SyncMapComponent
({
visible
:
e
.
subSystemValue
}).
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
notification
.
success
({
...
...
@@ -324,7 +338,6 @@ const WebConfigPage = props => {
const
delayedSyncMap
=
debounce
(
data
=>
SyncMap
(
data
),
500
);
const
sort
=
()
=>
{
console
.
log
(
webs
);
setSortVisible
(
true
);
};
...
...
@@ -404,7 +417,6 @@ const WebConfigPage = props => {
const
onOK
=
e
=>
{
setSortVisible
(
false
);
console
.
log
(
e
.
str
);
BatchDragSingleWebsite
(
e
.
str
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
updateModuleTree
(
userMode
||
'super'
);
...
...
@@ -485,6 +497,7 @@ const WebConfigPage = props => {
onOk=
{
handleSubmit
}
submitting=
{
submitting
}
hasIntegerate=
{
hasIntegerate
()
}
codeTypeList=
{
codeTypeList
}
/>
<
SortModal
visible=
{
sortVisible
}
...
...
src/services/webConfig/api.js
View file @
f7460d8d
...
...
@@ -351,3 +351,6 @@ export const ProductRepair = param => get(`${PUBLISH_SERVICE}/DBManager/ProductR
export
const
GetMapLayerStationList
=
param
=>
get
(
`
${
PANDA_GIS
}
/MapLayer/GetMapLayerStationList`
,
param
);
export
const
GetVerificationCodeType
=
param
=>
get
(
`/PandaCore/GCK/BussinessAuth/GetVerificationCodeType`
,
param
);
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