diff --git a/public/locales/en-US/dashboard.json b/public/locales/en-US/dashboard.json index 5f3b9ee..e5103be 100644 --- a/public/locales/en-US/dashboard.json +++ b/public/locales/en-US/dashboard.json @@ -433,10 +433,10 @@ "cap": "Cap", "capInstanceURL": "Instance URL", "capInstanceURLDes": "The URL of your self-hosted Cap server. For more details, see the <0>standalone mode documentation.", - "capKeyID": "Key ID", - "capKeyIDDes": "The key ID from your Cap server dashboard.", - "capKeySecret": "Key Secret", - "capKeySecretDes": "The key secret from your Cap server dashboard.", + "capSiteKey": "Site Key", + "capSiteKeyDes": "The site key from your Cap server dashboard.", + "capSecretKey": "Secret Key", + "capSecretKeyDes": "The secret key from your Cap server dashboard.", "captchaProvider": "Captcha provider", "captchaWidth": "Width", "captchaHeight": "Height", diff --git a/public/locales/ja-JP/dashboard.json b/public/locales/ja-JP/dashboard.json index 3ffa102..6664f46 100644 --- a/public/locales/ja-JP/dashboard.json +++ b/public/locales/ja-JP/dashboard.json @@ -431,10 +431,10 @@ "cap": "Cap", "capInstanceURL": "インスタンス URL", "capInstanceURLDes": "自身でホストしている Cap サーバーの URL。詳細については、<0>スタンドアロンモードドキュメント を参照してください。", - "capKeyID": "キー ID", - "capKeyIDDes": "Cap サーバーダッシュボードから取得したキー ID。", - "capKeySecret": "キーシークレット", - "capKeySecretDes": "Cap サーバーダッシュボードから取得したキーシークレット。", + "capSiteKey": "サイトキー", + "capSiteKeyDes": "Cap サーバーダッシュボードから取得したサイトキー。", + "capSecretKey": "シークレットキー", + "capSecretKeyDes": "Cap サーバーダッシュボードから取得したシークレットキー。", "captchaProvider": "認証コードタイプ", "captchaWidth": "幅", "captchaHeight": "高さ", diff --git a/public/locales/zh-CN/dashboard.json b/public/locales/zh-CN/dashboard.json index cba5119..05440e7 100644 --- a/public/locales/zh-CN/dashboard.json +++ b/public/locales/zh-CN/dashboard.json @@ -431,10 +431,10 @@ "cap": "Cap", "capInstanceURL": "实例 URL", "capInstanceURLDes": "自部署 Cap 服务器的 URL 地址。详细信息请参考 <0>独立模式文档。", - "capKeyID": "密钥 ID", - "capKeyIDDes": "从 Cap 服务器控制面板获取的密钥 ID。", - "capKeySecret": "密钥密码", - "capKeySecretDes": "从 Cap 服务器控制面板获取的密钥密码。", + "capSiteKey": "站点密钥", + "capSiteKeyDes": "从 Cap 服务器控制面板获取的站点密钥。", + "capSecretKey": "私密密钥", + "capSecretKeyDes": "从 Cap 服务器控制面板获取的私密密钥。", "captchaProvider": "验证码类型", "captchaWidth": "宽度", "captchaHeight": "高度", diff --git a/public/locales/zh-TW/dashboard.json b/public/locales/zh-TW/dashboard.json index e25dc8f..c2265b6 100644 --- a/public/locales/zh-TW/dashboard.json +++ b/public/locales/zh-TW/dashboard.json @@ -428,10 +428,10 @@ "cap": "Cap", "capInstanceURL": "實例 URL", "capInstanceURLDes": "自部署 Cap 伺服器的 URL 地址。詳細資訊請參考 <0>獨立模式文檔。", - "capKeyID": "金鑰 ID", - "capKeyIDDes": "從 Cap 伺服器控制面板獲取的金鑰 ID。", - "capKeySecret": "金鑰密碼", - "capKeySecretDes": "從 Cap 伺服器控制面板獲取的金鑰密碼。", + "capSiteKey": "站點金鑰", + "capSiteKeyDes": "從 Cap 伺服器控制面板獲取的站點金鑰。", + "capSecretKey": "私密金鑰", + "capSecretKeyDes": "從 Cap 伺服器控制面板獲取的私密金鑰。", "captchaProvider": "驗證碼型別", "captchaWidth": "寬度", "captchaHeight": "高度", diff --git a/src/api/site.ts b/src/api/site.ts index aecb4fd..dbd8ba4 100644 --- a/src/api/site.ts +++ b/src/api/site.ts @@ -24,8 +24,8 @@ export interface SiteConfig { captcha_type?: CaptchaType; turnstile_site_id?: string; captcha_cap_instance_url?: string; - captcha_cap_key_id?: string; - captcha_cap_key_secret?: string; + captcha_cap_site_key?: string; + captcha_cap_secret_key?: string; register_enabled?: boolean; logo?: string; logo_light?: string; diff --git a/src/component/Admin/Settings/Captcha/CapCaptcha.tsx b/src/component/Admin/Settings/Captcha/CapCaptcha.tsx index d6c27dd..c7589f2 100644 --- a/src/component/Admin/Settings/Captcha/CapCaptcha.tsx +++ b/src/component/Admin/Settings/Captcha/CapCaptcha.tsx @@ -37,33 +37,33 @@ const CapCaptcha = ({ values, setSettings }: CapCaptchaProps) => { - + setSettings({ - captcha_cap_key_id: e.target.value, + captcha_cap_site_key: e.target.value, }) } required /> ]} /> - + setSettings({ - captcha_cap_key_secret: e.target.value, + captcha_cap_secret_key: e.target.value, }) } type="password" @@ -71,7 +71,7 @@ const CapCaptcha = ({ values, setSettings }: CapCaptchaProps) => { /> ]} /> diff --git a/src/component/Common/Captcha/CapCaptcha.tsx b/src/component/Common/Captcha/CapCaptcha.tsx index b945605..6787d8e 100644 --- a/src/component/Common/Captcha/CapCaptcha.tsx +++ b/src/component/Common/Captcha/CapCaptcha.tsx @@ -21,7 +21,7 @@ const CapCaptcha = ({ onStateChange, generation, fullWidth, ...rest }: CapProps const { t } = useTranslation("common"); const capInstanceURL = useAppSelector((state) => state.siteConfig.basic.config.captcha_cap_instance_url); - const capKeyID = useAppSelector((state) => state.siteConfig.basic.config.captcha_cap_key_id); + const capSiteKey = useAppSelector((state) => state.siteConfig.basic.config.captcha_cap_site_key); // Keep callback reference up to date useEffect(() => { @@ -72,7 +72,7 @@ const CapCaptcha = ({ onStateChange, generation, fullWidth, ...rest }: CapProps }; const createWidget = () => { - if (!captchaRef.current || !capInstanceURL || !capKeyID) { + if (!captchaRef.current || !capInstanceURL || !capSiteKey) { return; } @@ -89,7 +89,7 @@ const CapCaptcha = ({ onStateChange, generation, fullWidth, ...rest }: CapProps const widget = document.createElement("cap-widget"); // Cap 2.0 API format: {instanceURL}/{siteKey}/ - const apiEndpoint = `${capInstanceURL.replace(/\/$/, "")}/${capKeyID}/`; + const apiEndpoint = `${capInstanceURL.replace(/\/$/, "")}/${capSiteKey}/`; widget.setAttribute("data-cap-api-endpoint", apiEndpoint); widget.id = "cap-widget"; @@ -123,7 +123,7 @@ const CapCaptcha = ({ onStateChange, generation, fullWidth, ...rest }: CapProps }, [generation, t]); useEffect(() => { - if (!capInstanceURL || !capKeyID) { + if (!capInstanceURL || !capSiteKey) { return; } @@ -166,9 +166,9 @@ const CapCaptcha = ({ onStateChange, generation, fullWidth, ...rest }: CapProps captchaRef.current.innerHTML = ""; } }; - }, [capInstanceURL, capKeyID, t]); + }, [capInstanceURL, capSiteKey, t]); - if (!capInstanceURL || !capKeyID) { + if (!capInstanceURL || !capSiteKey) { return null; }