diff --git a/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx index 626b26b..ad7dc52 100644 --- a/src/components/GlobalHeader/RightContent.tsx +++ b/src/components/GlobalHeader/RightContent.tsx @@ -1,6 +1,6 @@ import { Avatar, Dropdown, Menu, message, Modal } from 'antd'; import { DownOutlined, UserOutlined, UserSwitchOutlined, CarryOutOutlined, HomeOutlined, ImportOutlined } from '@ant-design/icons'; -import React, { useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; import moment from 'moment' import { connect, history } from 'umi'; import { ConnectState } from '@/models/connect'; @@ -8,11 +8,13 @@ import logo from '../../assets/logo.svg'; import './index.less'; import { getMenu, getLogout } from './services' import { getSessionUserData } from "@/utils/session"; +import { getToSecondUrl } from '@/pages/LoadingPage/service'; const GlobalHeaderRight: React.FC<{}> = (props) => { // let className = styles.right; let data = getSessionUserData(); const [dataMenu, setDataMenu] = React.useState([]); + const urlRef = useRef(null); const handelRole = (item: any) => { sessionStorage.setItem('roleData', JSON.stringify(item)); sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode])); @@ -74,13 +76,23 @@ const GlobalHeaderRight: React.FC<{}> = (props) => { ); + useEffect(() => { + const getUrl = async () => { + const response = await getToSecondUrl(); + if (response?.success) { + urlRef.current = response?.data; + } + } + getUrl(); + }, []) + return (
中国联通智慧供应链平台 | 招标采购中心
- +
{ window.open("/ElecMonitor/Supplier") }}> diff --git a/src/pages/userformal/login/index.tsx b/src/pages/userformal/login/index.tsx index 47eb909..d20c59d 100644 --- a/src/pages/userformal/login/index.tsx +++ b/src/pages/userformal/login/index.tsx @@ -309,10 +309,10 @@ const Index: React.FC<{}> = () => { } const handleOk = () => { // 确定修改密码 - if (changeForm.getFieldValue("newPassword") !== changeForm.getFieldValue("newPassword1")) { - message.warn('两次密码输入不一致,请重新输入') - } else { - changeForm.validateFields().then(res => { + changeForm.validateFields().then(res => { + if (changeForm.getFieldValue("newPassword") !== changeForm.getFieldValue("newPassword1")) { + message.warn('两次密码输入不一致,请重新输入') + } else { setSping(true); const date = { identityCard: changeForm.getFieldValue("identityCard"), @@ -330,9 +330,9 @@ const Index: React.FC<{}> = () => { } }).finally(() => { setSping(false); - });; - }) - } + }); + } + }) } //浏览器类型 const BrowserType = () => { @@ -652,62 +652,65 @@ const Index: React.FC<{}> = () => { { + // const oNumber = new RegExp(/\d/); + // const oLetter = new RegExp(/[a-zA-Z]/); + // const oSpecial = '.~!@#$%^&*()_+=-{}|:<>?,./[]-;\\"'; + // if (!value) { + // callback('请输入新密码'); + // return; + // } + // if (value.length < 6) { + // callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); + // return; + // } + // try { + // [...value].forEach(val => { + // if ( + // !( + // oNumber.test(val) || + // oLetter.test(val) || + // oSpecial.indexOf(val) >= 0 + // ) + // ) { + // throw new Error(); + // } + // }); + // } catch (e) { + // callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); + // } + // const contain: boolean[] = []; + // [...value].forEach(val => { + // if (oNumber.test(val)) { + // contain[0] = true; + // } + // if (oLetter.test(val)) { + // contain[1] = true; + // } + // if (oSpecial.indexOf(val) >= 0) { + // contain[2] = true; + // } + // }); + // if (contain.filter(item => item === true).length < 2) { + // callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); + // return; + // } + // callback(); + // } + // } + // ]} rules={[ { required: true, - validator: (rule, value, callback) => { - const oNumber = new RegExp(/\d/); - const oLetter = new RegExp(/[a-zA-Z]/); - const oSpecial = '.~!@#$%^&*()_+=-{}|:<>?,./[]-;\\"'; - if (!value) { - callback('请输入新密码'); - return; - } - if (value.length < 6) { - callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); - return; - } - try { - [...value].forEach(val => { - if ( - !( - oNumber.test(val) || - oLetter.test(val) || - oSpecial.indexOf(val) >= 0 - ) - ) { - throw new Error(); - } - }); - } catch (e) { - callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); - } - const contain: boolean[] = []; - [...value].forEach(val => { - if (oNumber.test(val)) { - contain[0] = true; - } - if (oLetter.test(val)) { - contain[1] = true; - } - if (oSpecial.indexOf(val) >= 0) { - contain[2] = true; - } - }); - if (contain.filter(item => item === true).length < 2) { - callback('密码不能小于六位,至少含字母、数字、特殊字符其中的2种!'); - return; - } - callback(); - } + message: '请输入新密码', + }, { + pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[`~!@#$%^&*()\-_=+\\|[{}\];:'",<.>/?])[a-zA-Z0-9`~!@#$%^&*()\-_=+\\|[{}\];:'",<.>/?]{8,20}$/, + message: "密码不符合规则,密码长度8-20位,必须包含大小写字母、数字和特殊字符", } ]} - // rules={[ - // { - // required: true, - // message: '请输入新密码', - // }, - // ]} >