专家人脸登录后台接口联调完成
This commit is contained in:
@ -14,9 +14,9 @@ export default class FrameFaceLogin extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// 接收Iframe传递的数据
|
// 接收Iframe传递的数据
|
||||||
window.addEventListener("message", (e) => {
|
window.addEventListener("message", (e) => {
|
||||||
const { image} = e.data || {}; //传递的数据
|
const { image } = e.data || {}; //传递的数据
|
||||||
if (image) {
|
if (image) {
|
||||||
this.props.faceCompareEvent(image, null);
|
this.props.faceCompareEvent(image);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -262,12 +262,9 @@ const Index: React.FC<{}> = () => {
|
|||||||
|
|
||||||
//RgbToBase64
|
//RgbToBase64
|
||||||
const RgbToBase64 = async (image:any) =>{
|
const RgbToBase64 = async (image:any) =>{
|
||||||
const _body = JSON.stringify({//post请求参数
|
await rgbToBase64({image}).then(res => {
|
||||||
type: 'pixel',
|
const _blob = base64ToBlob( 'data:image/jpg;base64,' + res.data);
|
||||||
rgb: image
|
hanleFaceSubmit(_blob, null);
|
||||||
});
|
|
||||||
await rgbToBase64({_body}).then(res => res.json()).then(res => {
|
|
||||||
hanleFaceSubmit(base64ToBlob( 'data:image/jpg;base64,' + res.data), null);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +375,7 @@ const Index: React.FC<{}> = () => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* 加载摄像头 */}
|
{/* 加载摄像头 */}
|
||||||
<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>
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
{/* onClick={() => {hanleFaceSubmit(null, null);}} */}
|
{/* onClick={() => {hanleFaceSubmit(null, null);}} */}
|
||||||
|
@ -10,9 +10,18 @@ export async function changePass(params: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rgb转base64
|
||||||
|
* @param params rgb字符串
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
export async function rgbToBase64(params: any) {
|
export async function rgbToBase64(params: any) {
|
||||||
|
const _body = JSON.stringify({//post请求参数
|
||||||
|
type: 'pixel',
|
||||||
|
rgb: params.image
|
||||||
|
});
|
||||||
return request('/api/core-service-ebtp-userinfo/outer/v1/ebtp/face/rgbArray2Base64', {
|
return request('/api/core-service-ebtp-userinfo/outer/v1/ebtp/face/rgbArray2Base64', {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params
|
body:_body,
|
||||||
});
|
});
|
||||||
}
|
}
|
@ -76,7 +76,9 @@ request.interceptors.request.use(async (url, options) => {
|
|||||||
url.startsWith('/api/auth/reloadPartnerToken') ||
|
url.startsWith('/api/auth/reloadPartnerToken') ||
|
||||||
url.startsWith('/api/api/mall-expe') ||
|
url.startsWith('/api/api/mall-expe') ||
|
||||||
url == '/api/biz-service-ebtp-extend/v1/userpassword/validatePassword' ||
|
url == '/api/biz-service-ebtp-extend/v1/userpassword/validatePassword' ||
|
||||||
url.startsWith('/api/notification')
|
url.startsWith('/api/notification') ||
|
||||||
|
url == '/api/core-service-ebtp-userinfo/outer/v1/ebtp/face/faceCompare' ||
|
||||||
|
url == '/api/core-service-ebtp-userinfo/outer/v1/ebtp/face/rgbArray2Base64'
|
||||||
) {
|
) {
|
||||||
headers = {
|
headers = {
|
||||||
...options.headers,
|
...options.headers,
|
||||||
|
Reference in New Issue
Block a user