觀看條件 - 驗證碼觀看
更新時間:2025-06-20 14:16:28
一、設定資訊
1.1 驗證碼觀看條件設定資訊
Interface 介面: AuthSettingItemCode
| 屬性名稱 | 說明 | 型別 |
|---|---|---|
authType |
條件類型 | Code |
enabled |
是否啟用 | null | YN |
privacyContent |
隱私聲明內容 | string |
privacyStatus |
是否開啟隱私聲明 | YN |
codeAuthTips |
歡迎標題 | string |
codeEntryText |
入口文字 | null | string |
qcodeImg |
二維碼圖片位址 | string |
qcodeTips |
二維碼提示文案 | string |
二、使用方式
2.1 驗證驗證碼觀看
Api 方法: verifyCodeAuth(params: VerifyCodeAuthParams): Promise<VerifyCodeAuthResult>
參數說明:
- params:呼叫參數,
VerifyCodeAuthParams型別,必傳,詳細型別說明如下
| 參數名稱 | 說明 | 型別 | 必須 | 預設值 |
|---|---|---|---|---|
code |
驗證碼 | string |
是 | - |
imageId |
圖片 id | string |
是 | - |
captcha |
圖片驗證碼 | string |
是 | - |
回傳值說明: 授權結果,Promise<VerifyCodeAuthResult> 型別
範例:
// 执行验证码授权
async function toDoAuthCode(code) {
const result = await watchCore.auth.verifyCodeAuth({
code,
});
if (result.success) {
await handleAuthVerifySuccess(result);
} else {
await handleAuthVerifyFail(result);
}
}
// 传入验证码
toDoAuthCode('1234');
