mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-24 14:04:07 +08:00
Remove recaptcha_mirror
option
This commit is contained in:
parent
1fa155c213
commit
2397ebc565
@ -236,7 +236,6 @@ class AdminController extends Controller
|
||||
$recaptcha = Option::form('recaptcha', 'reCAPTCHA', function ($form) {
|
||||
$form->text('recaptcha_sitekey', 'sitekey');
|
||||
$form->text('recaptcha_secretkey', 'secretkey');
|
||||
$form->checkbox('recaptcha_mirror')->label();
|
||||
})->handle();
|
||||
|
||||
return view('admin.options')
|
||||
|
@ -15,10 +15,7 @@ class Captcha implements Rule
|
||||
$secretkey = option('recaptcha_secretkey');
|
||||
if ($secretkey) {
|
||||
$client = new \GuzzleHttp\Client();
|
||||
$url = option('recaptcha_mirror')
|
||||
? 'https://www.recaptcha.net/recaptcha/api/siteverify'
|
||||
: 'https://www.google.com/recaptcha/api/siteverify';
|
||||
$response = $client->post($url, [
|
||||
$response = $client->post('https://www.recaptcha.net/recaptcha/api/siteverify', [
|
||||
'form_params' => [
|
||||
'secret' => $secretkey,
|
||||
'response' => $value,
|
||||
|
@ -52,5 +52,4 @@ return [
|
||||
'cdn_address' => '',
|
||||
'recaptcha_sitekey' => '',
|
||||
'recaptcha_secretkey' => '',
|
||||
'recaptcha_mirror' => 'false',
|
||||
];
|
||||
|
@ -146,11 +146,6 @@ meta:
|
||||
meta_extras:
|
||||
title: Other Custom <meta> Tags
|
||||
|
||||
recaptcha:
|
||||
recaptcha_mirror:
|
||||
title: 3rd-party Mirror
|
||||
label: Chinese users only.
|
||||
|
||||
res-warning: This page is ONLY for advanced users. If you aren't familiar with these, please don't modify them!
|
||||
|
||||
resources:
|
||||
|
@ -146,11 +146,6 @@ meta:
|
||||
meta_extras:
|
||||
title: 其它自定义 <meta> 标签
|
||||
|
||||
recaptcha:
|
||||
recaptcha_mirror:
|
||||
title: 第三方镜像
|
||||
label: 国内用户请勾选此项
|
||||
|
||||
res-warning: 本页面仅供高级用户使用。如果您不清楚这些设置的含义,请不要随意修改它们!
|
||||
|
||||
resources:
|
||||
|
@ -1,11 +1,4 @@
|
||||
@if (option('recaptcha_sitekey'))
|
||||
<script
|
||||
src="https://www.{{ option('recaptcha_mirror')
|
||||
? 'recaptcha.net'
|
||||
: 'google.com'
|
||||
}}/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit"
|
||||
async
|
||||
defer
|
||||
>
|
||||
<script src="https://www.recaptcha.net/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer>
|
||||
</script>
|
||||
@endif
|
||||
|
@ -163,11 +163,9 @@ class AdminControllerTest extends BrowserKitTestCase
|
||||
$this->visit('/admin/options')
|
||||
->type('key', 'recaptcha_sitekey')
|
||||
->type('secret', 'recaptcha_secretkey')
|
||||
->check('recaptcha_mirror')
|
||||
->press('submit_recaptcha');
|
||||
$this->assertEquals('key', option('recaptcha_sitekey'));
|
||||
$this->assertEquals('secret', option('recaptcha_secretkey'));
|
||||
$this->assertTrue(option('recaptcha_mirror'));
|
||||
}
|
||||
|
||||
public function testResource()
|
||||
|
Loading…
Reference in New Issue
Block a user