Skip to content

Commit 973b153

Browse files
committed
新增:后台安全升级,已知问题修复
1 parent 6d5ed88 commit 973b153

File tree

209 files changed

+1686
-666
lines changed

Some content is hidden

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

209 files changed

+1686
-666
lines changed

app/Constant/AppConstant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class AppConstant
66
{
77
const APP = 'blog';
88
const APP_NAME = 'ModStartBlog';
9-
const VERSION = '9.3.0';
9+
const VERSION = '9.4.0';
1010
}
1111

artisan

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ require __DIR__.'/bootstrap/autoload.php';
1717

1818
$app = require_once __DIR__.'/bootstrap/app.php';
1919

20+
if (\ModStart\Core\Util\PlatformUtil::isLinux()) {
21+
if (function_exists('posix_getuid')) {
22+
$uid = posix_getuid();
23+
if ($uid == 0) {
24+
echo "You can't run this command as root ( uid = ${uid} ).\n";
25+
exit(-1);
26+
}
27+
}
28+
}
29+
2030
/*
2131
|--------------------------------------------------------------------------
2232
| Run The Artisan Application

module/Nav/Docs/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 1.8.0
1+
## 1.8.0 导航增加变量自动替换支持
22

33
- 新增:导航增加变量自动替换支持
44

module/Vendor/Admin/Controller/WidgetLinkController.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Routing\Controller;
88
use ModStart\Core\Dao\ModelManageUtil;
99
use ModStart\Core\Dao\ModelUtil;
10+
use ModStart\Core\Input\InputPackage;
1011
use ModStart\Core\Util\TreeUtil;
1112
use ModStart\Module\ModuleManager;
1213
use Module\Vendor\Admin\Widget\AdminWidgetLink;
@@ -20,9 +21,23 @@ class WidgetLinkController extends Controller
2021

2122
public function select()
2223
{
24+
$input = InputPackage::buildFromInput();
25+
$filterTypes = $input->getStringSeparatedArray('types');
26+
if (empty($filterTypes)) {
27+
$filterTypes = [
28+
AdminWidgetLinkType::MOBILE,
29+
AdminWidgetLinkType::WEB,
30+
];
31+
}
2332
$links = AdminWidgetLink::get();
33+
$links = array_values(array_filter($links, function ($link) use ($filterTypes) {
34+
return in_array($link['type'], $filterTypes);
35+
}));
2436
$types = [];
2537
foreach (AdminWidgetLinkType::getList() as $name => $title) {
38+
if (!in_array($name, $filterTypes)) {
39+
continue;
40+
}
2641
$count = count(array_filter($links, function ($link) use ($name) {
2742
return $link['type'] == $name;
2843
}));

module/Vendor/Provider/Schedule/AbstractScheduleBiz.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ protected function cronEveryMinute()
2828

2929
protected function cronEvery10Minute()
3030
{
31-
return '*/10 * * * * *';
31+
return '*/10 * * * *';
3232
}
3333

3434
protected function cronEvery30Minute()
3535
{
36-
return '0,30 * * * * *';
36+
return '0,30 * * * *';
3737
}
3838

3939
/**
@@ -42,7 +42,7 @@ protected function cronEvery30Minute()
4242
*/
4343
protected function cronEveryDayHour24($hour)
4444
{
45-
return "0 $hour * * * *";
45+
return "0 $hour * * *";
4646
}
4747

4848
/**
@@ -52,16 +52,16 @@ protected function cronEveryDayHour24($hour)
5252
*/
5353
protected function cronEveryDayHour24Minute($hour, $minute)
5454
{
55-
return "$minute $hour * * * *";
55+
return "$minute $hour * * *";
5656
}
5757

5858
protected function cronEveryHour()
5959
{
60-
return '0 * * * * *';
60+
return '0 * * * *';
6161
}
6262

6363
protected function cronEveryDay()
6464
{
65-
return '0 0 * * * *';
65+
return '0 0 * * *';
6666
}
6767
}

module/Vendor/Shell/ClosureCommand.php

Lines changed: 0 additions & 71 deletions
This file was deleted.

module/Vendor/Shell/ShellApplication.php

Lines changed: 0 additions & 61 deletions
This file was deleted.

module/Vendor/View/mail/frame.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
@show
3333
</div>
3434
<div id="foot">
35-
{{modstart_config('siteName')}} &copy; {{modstart_config('siteDomain')}}
35+
{{modstart_config('siteName')}}
36+
{!! modstart_config('siteDomain','')?'&copy;'.modstart_config('siteDomain',''):'' !!}
3637
</div>
3738
@show
3839
</div>

module/VisitStatistic/Docs/release.md

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

33
- 新增:运营报表-网站访问页面,合并设置和详细页面
4+
- 优化:网站统计报表实时查询数据库插入冲突问题
45

56
---
67

module/VisitStatistic/Util/VisitStatisticUtil.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Module\VisitStatistic\Util;
44

55
use ModStart\Core\Dao\ModelUtil;
6+
use ModStart\Core\Util\LockUtil;
67
use ModStart\Core\Util\TimeUtil;
78
use Module\VisitStatistic\Model\VisitStatisticDailyReport;
89
use Module\VisitStatistic\Model\VisitStatisticItem;
@@ -36,7 +37,14 @@ public static function report($startDay = null, $endDay = null)
3637
if ($t <= $today) {
3738
$recordMap[$day] = self::calcReport($day);
3839
if ($t < $today) {
39-
ModelUtil::insert('visit_statistic_daily_report', $recordMap[$day]);
40+
$where = ['day' => $day];
41+
$lockKey = 'VisitStatistic:DailyReport:' . $day;
42+
if (LockUtil::acquire($lockKey)) {
43+
if (!ModelUtil::exists(VisitStatisticDailyReport::class, $where)) {
44+
ModelUtil::insert(VisitStatisticDailyReport::class, $recordMap[$day]);
45+
}
46+
LockUtil::release($lockKey);
47+
}
4048
}
4149
} else {
4250
$recordMap[$day] = [

0 commit comments

Comments
 (0)