Merge branch '20230329-0330电子商城渗透测试修改' into 'release_20230331'
3.31 0330电子商城渗透测试修改 See merge request eshop/fe_service_ebtp_frontend!198
This commit is contained in:
@ -12,6 +12,7 @@ import FrameFaceLogin from '../faceLogin/FrameFaceLogin';
|
|||||||
import LivingNotIE from './living.min.js';
|
import LivingNotIE from './living.min.js';
|
||||||
import { _KJUR } from './jsrsasign-latest-all-min';
|
import { _KJUR } from './jsrsasign-latest-all-min';
|
||||||
import { time } from 'echarts';
|
import { time } from 'echarts';
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
const layout = {
|
const layout = {
|
||||||
labelCol: { span: 7 },
|
labelCol: { span: 7 },
|
||||||
@ -28,6 +29,7 @@ const Index: React.FC<{}> = () => {
|
|||||||
const [form2] = Form.useForm();
|
const [form2] = Form.useForm();
|
||||||
const [imgUrl, setImgUrl] = useState<any>('');
|
const [imgUrl, setImgUrl] = useState<any>('');
|
||||||
const [tmpToken, setTmpToken] = useState<any>('');
|
const [tmpToken, setTmpToken] = useState<any>('');
|
||||||
|
const [imgUrlEdit, setImgUrlEdit] = useState<any>('');
|
||||||
const remainingTime = 3 //刷新token的剩余时间,单位小时
|
const remainingTime = 3 //刷新token的剩余时间,单位小时
|
||||||
const [changeForm] = Form.useForm();
|
const [changeForm] = Form.useForm();
|
||||||
const [isModalVisible, setIsModalVisible] = useState<boolean>(false)
|
const [isModalVisible, setIsModalVisible] = useState<boolean>(false)
|
||||||
@ -43,6 +45,7 @@ const Index: React.FC<{}> = () => {
|
|||||||
const [itemShow, setItemShow] = useState<boolean>(false);
|
const [itemShow, setItemShow] = useState<boolean>(false);
|
||||||
const [action, setAction] = useState<number>(1);
|
const [action, setAction] = useState<number>(1);
|
||||||
const [timer, setTimer] = useState<number>(10000);
|
const [timer, setTimer] = useState<number>(10000);
|
||||||
|
const urlRef = useRef<any>("");
|
||||||
/**
|
/**
|
||||||
* 设置活体检测token
|
* 设置活体检测token
|
||||||
*/
|
*/
|
||||||
@ -192,6 +195,32 @@ const Index: React.FC<{}> = () => {
|
|||||||
setTmpToken(tmpToken);
|
setTmpToken(tmpToken);
|
||||||
setImgUrl(url);
|
setImgUrl(url);
|
||||||
};
|
};
|
||||||
|
const changeCaptchaEdit = async () => {//修改密码-获取验证码
|
||||||
|
let tmpToken = genRandomString(16);
|
||||||
|
|
||||||
|
// 获取window的URL对像 并做好浏览器兼容性处理
|
||||||
|
const windowUrl = window.URL || window.webkitURL
|
||||||
|
windowUrl.revokeObjectURL(urlRef.current);
|
||||||
|
// 开始ajax请求
|
||||||
|
const xhr = new XMLHttpRequest()
|
||||||
|
// 验证码请求地址
|
||||||
|
const url = '/api/api/mall-expe/v1/expebaseinfo/getCaptcha?token=' + tmpToken
|
||||||
|
xhr.open('POST', url, true)
|
||||||
|
// 设置响应数据的类型 blod是将响应数据转换成二进制数据的Blob对象
|
||||||
|
xhr.responseType = 'blob'
|
||||||
|
xhr.onload = function () {
|
||||||
|
if (this.status === 200) {
|
||||||
|
const blob = this.response
|
||||||
|
// 将响应数据转换成url对象 赋值给src变量 传递给img
|
||||||
|
const blob_url = windowUrl.createObjectURL(blob);
|
||||||
|
urlRef.current = blob_url;
|
||||||
|
changeForm.setFieldsValue({ token: tmpToken });
|
||||||
|
setImgUrlEdit(blob_url);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
|
||||||
//登录刷新Token方法
|
//登录刷新Token方法
|
||||||
const refreshToken = async (data: any) => {
|
const refreshToken = async (data: any) => {
|
||||||
@ -314,21 +343,14 @@ const Index: React.FC<{}> = () => {
|
|||||||
message.warn('两次密码输入不一致,请重新输入')
|
message.warn('两次密码输入不一致,请重新输入')
|
||||||
} else {
|
} else {
|
||||||
setSping(true);
|
setSping(true);
|
||||||
const date = {
|
const date = changeForm.getFieldsValue();
|
||||||
identityCard: changeForm.getFieldValue("identityCard"),
|
|
||||||
oldPassword: changeForm.getFieldValue("oldPassword"),
|
|
||||||
newPassword: changeForm.getFieldValue("newPassword"),
|
|
||||||
};
|
|
||||||
changePass({ ...date }).then(res => {
|
changePass({ ...date }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setSping(false);
|
setIsModalVisible(false);
|
||||||
setIsModalVisible(false)
|
|
||||||
message.success('修改密码成功');
|
message.success('修改密码成功');
|
||||||
changeForm.resetFields()
|
|
||||||
} else {
|
|
||||||
setSping(false);
|
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
changeCaptchaEdit();
|
||||||
setSping(false);
|
setSping(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -485,13 +507,20 @@ const Index: React.FC<{}> = () => {
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isModalVisible) {
|
||||||
|
changeForm.resetFields()
|
||||||
|
changeCaptchaEdit();
|
||||||
|
}
|
||||||
|
}, [isModalVisible]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Spin spinning={spinning}>
|
<Spin spinning={spinning}>
|
||||||
<div className="login-box">
|
<div className="login-box">
|
||||||
<div className="top">
|
<div className="top">
|
||||||
<img src={logo} />
|
<img src={logo} />
|
||||||
<h3>中国联通智慧供应链平台 | 招标采购中心</h3>
|
<h3>中国联通智慧供应链平台 | 招标采购中心</h3>
|
||||||
<Button className="change" danger style={{ borderColor: '#b30000', color: '#b30000' }} onClick={() => (setIsModalVisible(true), changeForm.resetFields())}>修改密码</Button>
|
<Button className="change" danger style={{ borderColor: '#b30000', color: '#b30000' }} onClick={() => (setIsModalVisible(true))}>修改密码</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="main">
|
<div className="main">
|
||||||
<div className="text">
|
<div className="text">
|
||||||
@ -614,7 +643,7 @@ const Index: React.FC<{}> = () => {
|
|||||||
visible={isModalVisible}
|
visible={isModalVisible}
|
||||||
onCancel={() => setIsModalVisible(false)}
|
onCancel={() => setIsModalVisible(false)}
|
||||||
footer={[
|
footer={[
|
||||||
<Button onClick={() => handleOk()} loading={spinning}>确 定</Button>,
|
<Button type='primary' onClick={() => handleOk()} loading={spinning}>确 定</Button>,
|
||||||
<Button onClick={() => setIsModalVisible(false)}>取 消</Button>
|
<Button onClick={() => setIsModalVisible(false)}>取 消</Button>
|
||||||
]}
|
]}
|
||||||
width={600}
|
width={600}
|
||||||
@ -726,6 +755,27 @@ const Index: React.FC<{}> = () => {
|
|||||||
>
|
>
|
||||||
<Input.Password />
|
<Input.Password />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="token"
|
||||||
|
hidden
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="验证码" required>
|
||||||
|
<Form.Item
|
||||||
|
noStyle
|
||||||
|
name="code"
|
||||||
|
rules={[{ required: true, message: '请输入验证码!' }]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
style={{ width: "calc(60% - 8px)", marginRight: 8 }}
|
||||||
|
placeholder="请输入验证码"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item noStyle>
|
||||||
|
<img className="verification" onClick={() => changeCaptchaEdit()} src={imgUrlEdit} style={{ width: "40%" }} />
|
||||||
|
</Form.Item>
|
||||||
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Spin>
|
</Spin>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -4,13 +4,13 @@ export async function getSupplierList(params: any) {
|
|||||||
/*
|
/*
|
||||||
* http://gysxxk.cn1.utools.club/serviceEshopProviderMdm/findPageProvider
|
* http://gysxxk.cn1.utools.club/serviceEshopProviderMdm/findPageProvider
|
||||||
{
|
{
|
||||||
"pageNum": 1,
|
"pageNum": 1,
|
||||||
"pageSize": 10
|
"pageSize": 10
|
||||||
}
|
}
|
||||||
* */
|
* */
|
||||||
return request('/api/api/core-service-supplierbase/outer/v1.0/serviceEshopProviderMdm/findPageProvider',{
|
return request('/api/api/core-service-supplierbase/outer/v1.0/serviceEshopProviderMdm/findPageProvider', {
|
||||||
method:'post',
|
method: 'post',
|
||||||
data:{
|
data: {
|
||||||
...params
|
...params
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -22,9 +22,9 @@ export async function getSupplierUser(params: any) {
|
|||||||
/*
|
/*
|
||||||
*暂无url
|
*暂无url
|
||||||
* */
|
* */
|
||||||
return request('/api/api/core-service-supplierbase/outer/v1.0/serviceEshopProviderEmpMdm/findUserCountListBySupplierCodePage',{
|
return request('/api/core-service-ebtp-userinfo/v1/userinfo/findUserCountListBySupplierCodePage', {
|
||||||
method:'post',
|
method: 'post',
|
||||||
data:{
|
data: {
|
||||||
...params
|
...params
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user