Skip to content

Commit 7bb0e27

Browse files
committed
新增:CMS表单提交支持验证码配置,拦截恶意信息提交
1 parent e35e113 commit 7bb0e27

64 files changed

Lines changed: 802 additions & 110 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/Constant/AppConstant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ class AppConstant
66
{
77
const APP = 'cms9';
88
const APP_NAME = 'ModStartCMS9';
9-
const VERSION = '8.4.0';
9+
const VERSION = '8.5.0';
1010
}

module/Cms/Admin/Controller/CatController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Module\Cms\Util\CmsCatUtil;
1919
use Module\Cms\Util\CmsModelUtil;
2020
use Module\Cms\Util\CmsTemplateUtil;
21+
use Module\Vendor\Provider\Captcha\CaptchaProvider;
2122

2223
class CatController extends Controller
2324
{
@@ -60,6 +61,7 @@ protected function crud(AdminCRUDBuilder $builder)
6061
});
6162
$modelField->when('in', $modelModeMap[CmsMode::FORM], function ($builder) {
6263
$builder->select('formTemplate', '表单模板')->options(CmsTemplateUtil::allFormTemplateMap())->required()->listable(false);
64+
$builder->select('captchaProvider', '表单提交验证码')->options(CaptchaProvider::nameTitleMapWithNone());
6365
});
6466
$builder->text('subTitle', '子标题')->required()->listable(false);
6567
$builder->switch('enable', '启用')->optionsYesNo()->required()->listable(true)->gridEditable(true);

module/Cms/Docs/release.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.8.0
2+
3+
- 新增:CMS表单提交支持验证码配置,拦截恶意信息提交
4+
5+
---
6+
17
## 3.7.0 列表自定义字段过滤,点赞功能,备份优化等
28

39
- 新增:内容匿名点赞接口和点赞功能
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class ModifyCmsCatFormCaptcha extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::table('cms_cat', function (Blueprint $table) {
16+
$table->string('captchaProvider', 20)->nullable()->comment('验证码');
17+
});
18+
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
29+
}
30+
}

module/Cms/View/pc/cms/form/default.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
<textarea class="form" style="height:3rem;" name="content"></textarea>
6464
</div>
6565
</div>
66+
@if(!empty($cat['captchaProvider']))
67+
<div class="line">
68+
<div class="label">&nbsp;</div>
69+
<div class="field">
70+
<div class="tw-w-96">
71+
{!! \Module\Vendor\Provider\Captcha\CaptchaProvider::get($cat['captchaProvider'])->render() !!}
72+
</div>
73+
</div>
74+
</div>
75+
@endif
6676
<div class="line">
6777
<div class="label">&nbsp;</div>
6878
<div class="field">

module/Cms/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"tags": [
1919
"通用CMS"
2020
],
21-
"version": "3.7.0",
21+
"version": "3.8.0",
2222
"modstartVersion": ">=2.9.0",
2323
"author": "ModStart",
2424
"description": "提供通用的动态模型内容管理系统",

module/Member/Docs/release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 4.4.0
22

3+
- 新增:用户上传数据表模型表
34
- 优化:手机快速注册登录密码设置控件不是password修复
45
- 优化:VIP设置赠送积分但积分设置为0时异常问题
56
- 修复:已登录绑定授权信息,开启自动绑定账户时,绑定账户异常问题
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
namespace Module\Member\Model;
5+
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
9+
class MemberUploadCategory extends Model
10+
{
11+
protected $table = 'member_upload_category';
12+
}

module/Vendor/Provider/Captcha/CaptchaProvider.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ public static function nameTitleMap()
5050
});
5151
}
5252

53+
public static function nameTitleMapWithNone()
54+
{
55+
$value = [];
56+
$value[''] = L('Empty');
57+
foreach (self::nameTitleMap() as $k => $v) {
58+
$value[$k] = $v;
59+
}
60+
return $value;
61+
}
62+
5363
/**
5464
* @param $name
5565
* @return AbstractCaptchaProvider

module/Vendor/Schedule/DataTempCleanScheduleBiz.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function run()
3434
try {
3535
DataManager::deleteDataTempByPath($path);
3636
} catch (\Exception $e) {
37-
print_r($e->getMessage());
38-
exit('asdf');
37+
Log::info('Vendor.DataTempCleanScheduleBiz.DeleteFail - ' . $path . ' - ' . $e->getMessage());
38+
continue;
3939
}
4040
Log::info('Vendor.DataTempCleanScheduleBiz - ' . $path . ' deleted');
4141
}

0 commit comments

Comments
 (0)