From c19e366701fb93672bc8f085202b59a5a0f79204 Mon Sep 17 00:00:00 2001 From: yangzhe Date: Wed, 29 Oct 2025 15:37:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(utils):=20=E7=A7=BB=E9=99=A4=E4=BA=BA?= =?UTF-8?q?=E8=84=B8=E6=A0=B8=E9=AA=8C=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/faceVerify.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 utils/faceVerify.js diff --git a/utils/faceVerify.js b/utils/faceVerify.js deleted file mode 100644 index 338f515..0000000 --- a/utils/faceVerify.js +++ /dev/null @@ -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; - }); -}