fix(HCaptcha): 修复未定义config.other时访问hcaptcha_key的错误

This commit is contained in:
宇阳
2025-08-29 18:49:39 +08:00
parent f55bb86f2d
commit 0578ac84c1
2 changed files with 2 additions and 5 deletions

5
.env
View File

@@ -3,7 +3,4 @@
NEXT_PUBLIC_CACHING_TIME=1
# 项目后端API
NEXT_PUBLIC_PROJECT_API=http://localhost:9003/api
# hCaptcha 站点密钥
NEXT_PUBLIC_HCAPTCHA_SITEKEY=
NEXT_PUBLIC_PROJECT_API=http://localhost:9003/api

View File

@@ -4,7 +4,7 @@ import { useConfigStore } from '@/stores';
export default forwardRef(({ setToken }: { setToken: (token: string) => void }, ref: Ref<HCaptcha>) => {
const config = useConfigStore();
const sitekey = config.other.hcaptcha_key;
const sitekey = config?.other?.hcaptcha_key;
return (
<div>