7.13 人脸识别打开并增加控制接口 修改上传人脸照片提示文字
This commit is contained in:
@ -269,7 +269,7 @@ const OutsourcingManage: React.FC<OutsourcingManageProps> = (props) => {
|
||||
name="faceId"
|
||||
style={{ display: 'inline-block', width: '80%' }}
|
||||
rules={[{ required: true, message: "请上传照片" }]}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸(413*579px)头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
>
|
||||
<ExpertPhotoUpload maxSize={200} uploadProps={{ accept: ".jpg,.jpeg" }} />
|
||||
</Form.Item>
|
||||
|
@ -1624,7 +1624,7 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
name="faceId"
|
||||
style={{ display: 'inline-block', width: '80%' }}
|
||||
rules={[{ required: reserveStatus, message: "请上传照片" }]}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸(413*579px)头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
>
|
||||
<ExpertPhotoUpload maxSize={200} uploadProps={{ accept: ".jpg,.jpeg" }} />
|
||||
</Form.Item>
|
||||
|
@ -1493,7 +1493,7 @@ const JudgingPanel: React.FC<{}> = (props: any) => {
|
||||
name="faceId"
|
||||
style={{ display: 'inline-block', width: '80%' }}
|
||||
rules={[{ required: reserveStatus, message: "请上传照片" }]}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸(413*579px)头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
extra={<span style={{ color: '#b30000' }}>要求本人清晰、免冠、正面彩色2寸头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小200k以下</span>}
|
||||
>
|
||||
<ExpertPhotoUpload maxSize={200} uploadProps={{ accept: ".jpg,.jpeg" }} />
|
||||
</Form.Item>
|
||||
|
@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
||||
import { Form, Button, Input, Row, Col, Modal, Spin, message, Tabs } from 'antd';
|
||||
import { UserOutlined, LockOutlined, SafetyCertificateOutlined } from '@ant-design/icons';
|
||||
import './style.less';
|
||||
import { changePass } from './service';
|
||||
import { changePass, showFaceTab } from './service';
|
||||
import logo from '@/images/login/logoPic.png';
|
||||
import { refreshTokenApi, ZjfakeAccountLogin, ZjfakeFaceLogin } from '@/services/login';
|
||||
import { history } from 'umi';
|
||||
@ -40,6 +40,7 @@ const Index: React.FC<{}> = () => {
|
||||
const { TabPane } = Tabs;
|
||||
const [submitLoading, setSubmitLoading] = useState<boolean>(false);
|
||||
const [faceLoginDisable, setFaceLoginDisable] = useState<boolean>(false);
|
||||
const [faceLoginShow, setFaceLoginShow] = useState<boolean>(false);
|
||||
const lv = useRef<LivingNotIE>();
|
||||
const [timerShow, setTimeShow] = useState<boolean>(false);
|
||||
const [itemShow, setItemShow] = useState<boolean>(false);
|
||||
@ -496,6 +497,11 @@ const Index: React.FC<{}> = () => {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//是否显示人脸登录
|
||||
const showFaceLogin = async () => {
|
||||
const res = await showFaceTab();
|
||||
setFaceLoginShow(res?.data === 1);
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@ -505,6 +511,7 @@ const Index: React.FC<{}> = () => {
|
||||
if (!allowedToFaceLogin()) {
|
||||
setFaceLoginDisable(true);
|
||||
}
|
||||
showFaceLogin();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@ -592,49 +599,51 @@ const Index: React.FC<{}> = () => {
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</TabPane>
|
||||
{/* <TabPane tab="人脸识别登录" key="2" disabled={faceLoginDisable}>
|
||||
<Form
|
||||
name="basic2"
|
||||
className="form-box"
|
||||
initialValues={{ remember: true }}
|
||||
form={form2}
|
||||
// onFinish={hanleFaceSubmit.bind(this, null)}
|
||||
onFinish={!whetherIE.current?liveDetectStart:hanleFaceSubmit.bind(this, null)}
|
||||
// onFinishFailed={onFinishFailed}
|
||||
>
|
||||
<Form.Item
|
||||
label=""
|
||||
name="userName"
|
||||
rules={[{ required: true, message: '请输入用户名!' }]}
|
||||
{faceLoginShow && <>
|
||||
<TabPane tab="人脸识别登录" key="2" disabled={faceLoginDisable}>
|
||||
<Form
|
||||
name="basic2"
|
||||
className="form-box"
|
||||
initialValues={{ remember: true }}
|
||||
form={form2}
|
||||
// onFinish={hanleFaceSubmit.bind(this, null)}
|
||||
onFinish={!whetherIE.current ? liveDetectStart : hanleFaceSubmit.bind(this, null)}
|
||||
// onFinishFailed={onFinishFailed}
|
||||
>
|
||||
<Input
|
||||
prefix={
|
||||
<UserOutlined style={{ fontSize: '18px' }} className="site-form-item-icon" />
|
||||
}
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>) : (<FrameFaceLogin faceCompareEvent2={IELiveDetectFinish2} faceCompareEvent={IELiveDetectFinish} faceDetectStatusEvent = {UpdateDetectStatus}/>)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
||||
<Button type="primary" className="w100" loading={submitLoading} htmlType="submit">
|
||||
{submitLoading ? actionText(action, Math.round(timer/1000)) : '登 录'}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</TabPane> */}
|
||||
{/* 加载摄像头 */}
|
||||
{/* <Form.Item hidden={!itemShow}>
|
||||
<div>
|
||||
<span style={{color:classColor(action)}}>{actionText(action)}</span>
|
||||
<span hidden={!timerShow}>{Math.round(timer/1000)}</span>
|
||||
</div>
|
||||
</Form.Item> */}
|
||||
{/* <video ref={video} width="382" height="200"></video> */}
|
||||
{/* onClick={() => {hanleFaceSubmit(null, null);}} */}
|
||||
<Form.Item
|
||||
label=""
|
||||
name="userName"
|
||||
rules={[{ required: true, message: '请输入用户名!' }]}
|
||||
>
|
||||
<Input
|
||||
prefix={
|
||||
<UserOutlined style={{ fontSize: '18px' }} className="site-form-item-icon" />
|
||||
}
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>) : (<FrameFaceLogin faceCompareEvent2={IELiveDetectFinish2} faceCompareEvent={IELiveDetectFinish} faceDetectStatusEvent={UpdateDetectStatus} />)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
|
||||
<Button type="primary" className="w100" loading={submitLoading} htmlType="submit">
|
||||
{submitLoading ? actionText(action, Math.round(timer / 1000)) : '登 录'}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</TabPane>
|
||||
{/* 加载摄像头 */}
|
||||
<Form.Item hidden={!itemShow}>
|
||||
<div>
|
||||
<span style={{ color: classColor(action) }}>{actionText(action)}</span>
|
||||
<span hidden={!timerShow}>{Math.round(timer / 1000)}</span>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<video ref={video} width="382" height="200"></video>
|
||||
{/* onClick={() => {hanleFaceSubmit(null, null);}} */}
|
||||
</>}
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -17,11 +17,19 @@ export async function changePass(params: any) {
|
||||
*/
|
||||
export async function rgbToBase64(params: any) {
|
||||
const _body = JSON.stringify({//post请求参数
|
||||
type: 'pixel',
|
||||
type: 'pixel',
|
||||
rgb: params.image
|
||||
});
|
||||
return request('/api/core-service-ebtp-userinfo/outer/v1/ebtp/face/rgbArray2Base64', {
|
||||
method: 'post',
|
||||
body:_body,
|
||||
body: _body,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否显示人脸识别tab
|
||||
* @param params
|
||||
*/
|
||||
export async function showFaceTab() {
|
||||
return request('/api/biz-service-ebtp-extend//v1/BizFuncSwitchConfig/bizfuncswitchconfig/getFaceRecognitionFlag');
|
||||
}
|
Reference in New Issue
Block a user