更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
* 极验 4.0 — 点击登录后弹出 bind 模式验证码,成功后返回校验参数供登录接口使用。
|
||||
*/
|
||||
import { getGeetest4Infos } from '@/api/auth.js'
|
||||
import { GEETEST4_CAPTCHA_ID } from '@/api/config.js'
|
||||
|
||||
@@ -18,13 +15,11 @@ function normalizeValidate(result, fallbackCaptchaId) {
|
||||
}
|
||||
}
|
||||
|
||||
/** 优先读后端配置,失败时使用本地 captcha_id */
|
||||
export async function fetchGeetest4CaptchaId() {
|
||||
try {
|
||||
const data = await getGeetest4Infos()
|
||||
if (data?.captcha_id) return data.captcha_id
|
||||
} catch {
|
||||
// 后端未配置或未开启时走本地兜底
|
||||
}
|
||||
return GEETEST4_CAPTCHA_ID
|
||||
}
|
||||
@@ -55,7 +50,6 @@ function showGeetest4H5(captchaId) {
|
||||
if (typeof instance.hideCaptcha === 'function') instance.hideCaptcha()
|
||||
if (typeof instance.destroy === 'function') instance.destroy()
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
instance.onSuccess(() => {
|
||||
@@ -87,7 +81,6 @@ function showGeetest4H5(captchaId) {
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
function showGeetest4App(captchaId) {
|
||||
// 清理可能残留的原生 Webview
|
||||
if (typeof plus !== 'undefined' && plus.webview) {
|
||||
try {
|
||||
const old = plus.webview.getWebviewById('geetest-captcha-overlay')
|
||||
@@ -114,11 +107,6 @@ function showGeetest4App(captchaId) {
|
||||
}
|
||||
// #endif
|
||||
|
||||
/**
|
||||
* 弹出极验 4.0 验证
|
||||
* @param {string} [captchaIdOverride] 已从统一认证 /auth/verify-config 拿到 captcha_id 时直接传入
|
||||
* @returns {Promise<{ captcha_id, lot_number, pass_token, gen_time, captcha_output }>}
|
||||
*/
|
||||
export async function showGeetest4(captchaIdOverride = '') {
|
||||
const captchaId = captchaIdOverride || (await fetchGeetest4CaptchaId())
|
||||
if (!captchaId) {
|
||||
|
||||
Reference in new issue
Block a user