Commit f7460d8d authored by 周宏民's avatar 周宏民

pref: web登录添加验证码配置

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