专家人脸登录后台接口联调完成
This commit is contained in:
@ -255,19 +255,16 @@ const Index: React.FC<{}> = () => {
|
||||
const rawLength = raw.length;
|
||||
const uInt8Array = new Uint8Array(rawLength);
|
||||
for (let i = 0; i < rawLength; i += 1) {
|
||||
uInt8Array[i] = raw.charCodeAt(i);
|
||||
uInt8Array[i] = raw.charCodeAt(i);
|
||||
}
|
||||
return new Blob([uInt8Array], { type: contentType });
|
||||
};
|
||||
|
||||
//RgbToBase64
|
||||
const RgbToBase64 = async (image:any) =>{
|
||||
const _body = JSON.stringify({//post请求参数
|
||||
type: 'pixel',
|
||||
rgb: image
|
||||
});
|
||||
await rgbToBase64({_body}).then(res => res.json()).then(res => {
|
||||
hanleFaceSubmit(base64ToBlob( 'data:image/jpg;base64,' + res.data), null);
|
||||
await rgbToBase64({image}).then(res => {
|
||||
const _blob = base64ToBlob( 'data:image/jpg;base64,' + res.data);
|
||||
hanleFaceSubmit(_blob, null);
|
||||
});
|
||||
}
|
||||
|
||||
@ -378,7 +375,7 @@ const Index: React.FC<{}> = () => {
|
||||
</Form.Item>
|
||||
{/* 加载摄像头 */}
|
||||
<Form.Item>
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>):(<FrameFaceLogin faceCompareEvent = {hanleFaceSubmit}/>)}
|
||||
{!whetherIE.current ? (<video ref={video} width="382" height="200"></video>):(<FrameFaceLogin faceCompareEvent = {RgbToBase64}/>)}
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
{/* onClick={() => {hanleFaceSubmit(null, null);}} */}
|
||||
|
Reference in New Issue
Block a user