diff --git a/app/Enums/GroupConfigKey.php b/app/Enums/GroupConfigKey.php index 7e46be36..51eb9243 100644 --- a/app/Enums/GroupConfigKey.php +++ b/app/Enums/GroupConfigKey.php @@ -13,6 +13,9 @@ final class GroupConfigKey /** @var string 上传是否需要审查 */ const IsEnableScan = 'is_enable_scan'; + /** @var string 审查配置 */ + const ScanConfigs = 'scan_configs'; + /** @var string 是否启用原图保护功能 */ const IsEnableOriginalProtection = 'is_enable_original_protection'; diff --git a/app/Enums/Scan/AliyunOption.php b/app/Enums/Scan/AliyunOption.php index aae101fb..b6d835fd 100644 --- a/app/Enums/Scan/AliyunOption.php +++ b/app/Enums/Scan/AliyunOption.php @@ -4,5 +4,18 @@ namespace App\Enums\Scan; final class AliyunOption { + /** @var string AccessKeyId */ + const AccessKeyId = 'access_key_id'; + /** @var string AccessKeySecret */ + const AccessKeySecret = 'access_key_secret'; + + /** @var string RegionId */ + const RegionId = 'region_id'; + + /** @var string 场景 */ + const Scenes = 'scenes'; + + /** @var string 业务场景 */ + const BizType = 'biz_type'; } diff --git a/composer.lock b/composer.lock index b7599030..80be96d0 100644 --- a/composer.lock +++ b/composer.lock @@ -2780,16 +2780,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "", "mirrors": [ { @@ -2799,17 +2799,17 @@ ] }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2830,22 +2830,22 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "psr/simple-cache", - "version": "3.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "", "mirrors": [ { @@ -2855,12 +2855,12 @@ ] }, "require": { - "php": ">=8.0.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -2875,7 +2875,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -2887,9 +2887,9 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "source": "https://github.com/php-fig/simple-cache/tree/master" }, - "time": "2021-10-29T13:26:27+00:00" + "time": "2017-10-23T01:57:42+00:00" }, { "name": "psy/psysh", @@ -6242,16 +6242,16 @@ }, { "name": "laravel/sail", - "version": "v1.13.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "a14125e71779c99e27979431a66ea2793aa6ae50" + "reference": "b9749028732eca8080c26d01cd88a2f3549c2e3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/a14125e71779c99e27979431a66ea2793aa6ae50", - "reference": "a14125e71779c99e27979431a66ea2793aa6ae50", + "url": "https://api.github.com/repos/laravel/sail/zipball/b9749028732eca8080c26d01cd88a2f3549c2e3e", + "reference": "b9749028732eca8080c26d01cd88a2f3549c2e3e", "shasum": "", "mirrors": [ { @@ -6304,7 +6304,7 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2022-01-18T18:06:55+00:00" + "time": "2022-01-20T15:31:25+00:00" }, { "name": "maximebf/debugbar", @@ -6381,16 +6381,16 @@ }, { "name": "mockery/mockery", - "version": "1.4.4", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" + "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", - "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "url": "https://api.github.com/repos/mockery/mockery/zipball/c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", + "reference": "c10a5f6e06fc2470ab1822fa13fa2a7380f8fbac", "shasum": "", "mirrors": [ { @@ -6453,9 +6453,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.4.4" + "source": "https://github.com/mockery/mockery/tree/1.5.0" }, - "time": "2021-09-13T15:28:59+00:00" + "time": "2022-01-20T13:18:17+00:00" }, { "name": "myclabs/deep-copy", diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index bf1dc65f..3a2e8f9f 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -5,6 +5,7 @@ namespace Database\Seeders; use App\Enums\ConfigKey; use App\Enums\GroupConfigKey; use App\Enums\Mail\SmtpOption; +use App\Enums\Scan\AliyunOption; use App\Enums\Watermark\FontOption; use App\Enums\Watermark\ImageOption; use App\Models\Group; @@ -50,6 +51,18 @@ class DatabaseSeeder extends Seeder GroupConfigKey::IsEnableScan => false, GroupConfigKey::IsEnableWatermark => false, GroupConfigKey::IsEnableOriginalProtection => false, + GroupConfigKey::ScanConfigs => [ + 'driver' => 'aliyun', + 'drivers' => [ + 'aluyun' => [ + AliyunOption::AccessKeyId => '', + AliyunOption::AccessKeySecret => '', + AliyunOption::RegionId => '', + AliyunOption::Scenes => ['porn'], + AliyunOption::BizType => '', + ], + ], + ], GroupConfigKey::WatermarkConfigs => [ 'driver' => 'font', 'drivers' => [ diff --git a/public/css/app.css b/public/css/app.css index 137ec5cd..0c7d6f7f 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -716,6 +716,9 @@ select { .col-span-6 { grid-column: span 6 / span 6; } +.col-span-3 { + grid-column: span 3 / span 3; +} .m-2 { margin: 0.5rem; } diff --git a/public/css/common.css b/public/css/common.css index 06cc1ece..3e3aa0f5 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -284,4 +284,49 @@ progress::-webkit-progress-value { border-color: white; color: #0061ff; } +.switch { + position: relative; + display: inline-block; + width: 55px; + height: 30px; +} +.switch input { + display: none; +} +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: 0.4s; +} +.slider:before { + position: absolute; + content: ""; + height: 24px; + width: 24px; + left: 4px; + bottom: 3px; + background-color: white; + transition: 0.4s; +} +input:checked + .slider { + background-color: #2196F3; +} +input:focus + .slider { + box-shadow: 0 0 1px #2196F3; +} +input:checked + .slider:before { + transform: translateX(23px); +} +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} +.slider.round:before { + border-radius: 50%; +} diff --git a/resources/css/common.less b/resources/css/common.less index dd0e0b3d..c1f75226 100644 --- a/resources/css/common.less +++ b/resources/css/common.less @@ -91,3 +91,56 @@ progress::-webkit-progress-value { } } } + +// 开关样式 +.switch { + position: relative; + display: inline-block; + width: 55px; + height: 30px; +} + +.switch input {display:none;} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 24px; + width: 24px; + left: 4px; + bottom: 3px; + background-color: white; + transition: 0.4s; +} + +input:checked + .slider { + background-color: #2196F3; +} + +input:focus + .slider { + box-shadow: 0 0 1px #2196F3; +} + +input:checked + .slider:before { + transform: translateX(23px); +} + +/* Rounded sliders */ +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} diff --git a/resources/views/admin/group/add.blade.php b/resources/views/admin/group/add.blade.php index 93787d1f..1526ceea 100644 --- a/resources/views/admin/group/add.blade.php +++ b/resources/views/admin/group/add.blade.php @@ -70,102 +70,85 @@
-
-
- 是否默认 -

设置默认后,新用户注册以后将会属于该默认角色组。

-
-
-
- - -
-
- - -
-
-
+ + +
-
- 允许上传的图片类型 -
- @foreach($extensions as $extension) -
- - -
- @endforeach -
-
+ + @foreach($extensions as $extension) + + {{ strtoupper($extension) }} + + @endforeach +