Files
wordpress-theme-aksrt/assets/admin/src/components/captcha/TencentConfig.vue
T

43 lines
2.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<n-form label-placement="left" label-width="130">
<n-space vertical style="width:100%">
<n-divider title-placement="left">云 API 密钥(用于 TC3 签名)</n-divider>
<n-alert type="warning" style="margin-bottom: 12px;">
请从 <n-a href="https://console.cloud.tencent.com/cam/capi" target="_blank">访问管理控制台 → API 密钥管理</n-a> 获取。建议使用子账号密钥并仅授予 <code>QcloudCaptchaFullAccess</code> 权限。
</n-alert>
<n-form-item label="SecretId">
<n-input v-model:value="model.secret_id" placeholder="腾讯云 API SecretId" autocomplete="off" />
</n-form-item>
<n-form-item label="SecretKey">
<n-input v-model:value="model.secret_key" type="text" placeholder="腾讯云 API SecretKey" autocomplete="off" show-password-on="click" />
</n-form-item>
<n-divider title-placement="left">验证码密钥</n-divider>
<n-form-item label="CaptchaAppId">
<n-input v-model:value="model.app_id" placeholder="从验证码控制台获取 CaptchaAppId" autocomplete="off" />
</n-form-item>
<n-form-item label="AppSecretKey">
<n-input v-model:value="model.app_secret_key" type="text" placeholder="从验证码控制台获取 AppSecretKey" autocomplete="off" show-password-on="click" />
<template #feedback>请从「验证管理 → 基础配置」完整复制,注意区分 I/l/1/O/0</template>
</n-form-item>
<n-alert type="info" style="margin-bottom: 12px;">
腾讯云验证码 2.0 — 验证类型(滑动拼图、文字点选、空间语义等)请在<a href="https://console.cloud.tencent.com/captcha/graphical" target="_blank">验证码控制台</a>配置。
</n-alert>
<n-tag v-if="isConfigured" type="success" size="small">✓ 已完整配置</n-tag>
<n-tag v-else type="warning" size="small">未完成配置</n-tag>
</n-space>
</n-form>
</template>
<script setup>
import { computed } from 'vue'
const model = defineModel({ type: Object, default: () => ({}) })
const isConfigured = computed(() => {
const c = model.value
return !!(c.secret_id && c.secret_key && c.app_id && c.app_secret_key)
})
</script>