From 5b2c2564c9986f1fbe1321d790772de1db013117 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Sat, 30 Mar 2024 13:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=20=E4=B8=BA=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/SiteConfig.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/models/SiteConfig.php b/models/SiteConfig.php index 802de3e..0068af8 100644 --- a/models/SiteConfig.php +++ b/models/SiteConfig.php @@ -24,18 +24,35 @@ class SiteConfig extends Model public string $hcaptchaSecret; // hCaptcha Secret public string $turnstileSiteKey; // Turnstile Site Key public string $turnstileSecret; // Turnstile Secret - public string $cookieValidationKey; // Cookie Validation Key public bool $enableIpinfo; // 启用 ipinfo.io 查询 public string $ipinfoToken; // IPinfo Token public function rules(): array { return [ - [['siteTitle', 'siteUrl', 'domain', 'verifyProvider', 'recaptchaSiteKey', 'recaptchaSecret', 'hcaptchaSiteKey', 'hcaptchaSecret', 'turnstileSiteKey', 'turnstileSecret', 'cookieValidationKey', 'ipinfoToken'], 'string'], + [['siteTitle', 'siteUrl', 'domain', 'verifyProvider', 'recaptchaSiteKey', 'recaptchaSecret', 'hcaptchaSiteKey', 'hcaptchaSecret', 'turnstileSiteKey', 'turnstileSecret', 'ipinfoToken'], 'string'], [['registrationEnabled', 'enableIpinfo'], 'boolean'], ]; } + public function attributeLabels(): array + { + return [ + 'siteTitle' => '网站标题', + 'registrationEnabled' => '允许注册', + 'domain' => '站点域名', + 'verifyProvider' => '验证码服务', + 'recaptchaSiteKey' => 'reCAPTCHA Site Key', + 'recaptchaSecret' => 'reCAPTCHA Secret', + 'hcaptchaSiteKey' => 'hCaptcha Site Key', + 'hcaptchaSecret' => 'hCaptcha Secret', + 'turnstileSiteKey' => 'Turnstile Site Key', + 'turnstileSecret' => 'Turnstile Secret', + 'enableIpinfo' => '启用 ipinfo.io 查询', + 'ipinfoToken' => 'IPinfo Token', + ]; + } + /** * 读取配置信息 * @return bool @@ -82,7 +99,6 @@ class SiteConfig extends Model $env['HCAPTCHA_SECRET'] = $this->hcaptchaSecret; $env['TURNSTILE_SITE_KEY'] = $this->turnstileSiteKey; $env['TURNSTILE_SECRET'] = $this->turnstileSecret; - $env['COOKIE_VALIDATION_KEY'] = $this->cookieValidationKey; $env['ENABLE_IPINFO'] = $this->enableIpinfo ? 'true' : 'false'; $env['IPINFO_TOKEN'] = $this->ipinfoToken; $data = array_map(function ($key, $value) {