Merge branch 'main' of http://sl.vrgon.com:3000/JiXinHui/YingXingAI
This commit is contained in:
commit
608c1e4a46
|
|
@ -1,28 +0,0 @@
|
||||||
/**
|
|
||||||
* 前往人脸核验
|
|
||||||
*/
|
|
||||||
export function toBaiduApi(vm) {
|
|
||||||
vm.$u.api.getAPIToken().then((res) => {
|
|
||||||
const token = res.result.verify_token;
|
|
||||||
|
|
||||||
// 获取当前域名
|
|
||||||
const currentDomain = window.location.origin;
|
|
||||||
|
|
||||||
// 编码回调URL - 使用相对路径,让uni-app处理路由
|
|
||||||
// 百度人脸核验会在回调URL后附加verify_result和verify_info参数
|
|
||||||
const successUrl = encodeURIComponent(
|
|
||||||
`${currentDomain}/#/pages/login/recognitionResult/recognitionResult?token=${token}`
|
|
||||||
);
|
|
||||||
const failedUrl = encodeURIComponent(
|
|
||||||
`${currentDomain}/#/pages/login/recognitionResult/recognitionFailed?token=${token}`
|
|
||||||
);
|
|
||||||
|
|
||||||
// 构建跳转URL
|
|
||||||
const verifyUrl = `https://brain.baidu.com/face/print/verify/verify?token=${token}&successUrl=${successUrl}&failedUrl=${failedUrl}`;
|
|
||||||
|
|
||||||
console.log("跳转到百度人脸核验页面:", verifyUrl);
|
|
||||||
|
|
||||||
// 直接跳转到百度人脸核验页面
|
|
||||||
window.location.href = verifyUrl;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue