Cloudflare Turnstile开启前检测sitekey和Secretkey
This commit is contained in:
+14
-2
@@ -7803,6 +7803,7 @@ const RegistrationConfigComponent = ({
|
|||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
|
disabled={!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setRegistrationSettings((prev) => ({
|
setRegistrationSettings((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
@@ -7810,7 +7811,9 @@ const RegistrationConfigComponent = ({
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${
|
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${
|
||||||
registrationSettings.RegistrationRequireTurnstile
|
!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey
|
||||||
|
? 'opacity-50 cursor-not-allowed bg-gray-300 dark:bg-gray-600'
|
||||||
|
: registrationSettings.RegistrationRequireTurnstile
|
||||||
? buttonStyles.toggleOn
|
? buttonStyles.toggleOn
|
||||||
: buttonStyles.toggleOff
|
: buttonStyles.toggleOff
|
||||||
}`}
|
}`}
|
||||||
@@ -7828,6 +7831,9 @@ const RegistrationConfigComponent = ({
|
|||||||
</div>
|
</div>
|
||||||
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||||
开启后注册时需要通过Cloudflare Turnstile人机验证。
|
开启后注册时需要通过Cloudflare Turnstile人机验证。
|
||||||
|
{(!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey) && (
|
||||||
|
<span className='text-orange-500 dark:text-orange-400'> 需要先配置Site Key和Secret Key才能启用。</span>
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -7839,6 +7845,7 @@ const RegistrationConfigComponent = ({
|
|||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
|
disabled={!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setRegistrationSettings((prev) => ({
|
setRegistrationSettings((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
@@ -7846,7 +7853,9 @@ const RegistrationConfigComponent = ({
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${
|
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 ${
|
||||||
registrationSettings.LoginRequireTurnstile
|
!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey
|
||||||
|
? 'opacity-50 cursor-not-allowed bg-gray-300 dark:bg-gray-600'
|
||||||
|
: registrationSettings.LoginRequireTurnstile
|
||||||
? buttonStyles.toggleOn
|
? buttonStyles.toggleOn
|
||||||
: buttonStyles.toggleOff
|
: buttonStyles.toggleOff
|
||||||
}`}
|
}`}
|
||||||
@@ -7864,6 +7873,9 @@ const RegistrationConfigComponent = ({
|
|||||||
</div>
|
</div>
|
||||||
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
<p className='mt-1 text-xs text-gray-500 dark:text-gray-400'>
|
||||||
开启后登录时需要通过Cloudflare Turnstile人机验证。
|
开启后登录时需要通过Cloudflare Turnstile人机验证。
|
||||||
|
{(!registrationSettings.TurnstileSiteKey || !registrationSettings.TurnstileSecretKey) && (
|
||||||
|
<span className='text-orange-500 dark:text-orange-400'> 需要先配置Site Key和Secret Key才能启用。</span>
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ export async function getOpenListDetail(
|
|||||||
(ep) =>
|
(ep) =>
|
||||||
`/api/openlist/play?folder=${encodeURIComponent(folderName)}&fileName=${encodeURIComponent(ep.fileName)}`
|
`/api/openlist/play?folder=${encodeURIComponent(folderName)}&fileName=${encodeURIComponent(ep.fileName)}`
|
||||||
),
|
),
|
||||||
episodes_titles: episodes.map((ep) => ep.title),
|
episodes_titles: episodes.map((ep) => ep.title!),
|
||||||
proxyMode: false, // openlist 源不使用代理模式
|
proxyMode: false, // openlist 源不使用代理模式
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ export async function getXiaoyaDetail(id: string): Promise<SearchResult> {
|
|||||||
(ep) =>
|
(ep) =>
|
||||||
`/api/xiaoya/play?path=${encodeURIComponent(base58Encode(ep.path))}`
|
`/api/xiaoya/play?path=${encodeURIComponent(base58Encode(ep.path))}`
|
||||||
),
|
),
|
||||||
episodes_titles: episodes.map((ep) => ep.title),
|
episodes_titles: episodes.map((ep) => ep.title!),
|
||||||
subtitles: [],
|
subtitles: [],
|
||||||
proxyMode: false,
|
proxyMode: false,
|
||||||
metadataSource: metadata.source,
|
metadataSource: metadata.source,
|
||||||
|
|||||||
Reference in New Issue
Block a user