Skip to content

Commit 7c925cb

Browse files
committed
release: 9.5.0
1 parent d94cdd9 commit 7c925cb

File tree

89 files changed

+511
-160
lines changed

Some content is hidden

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

89 files changed

+511
-160
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.4.0';
9+
const VERSION = '9.5.0';
1010
}
1111

module/AdminManager/View/widget/serverInfo.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="col-lg-4 col-md-6">
1717
<div class="tw-flex ub-border-bottom tw-p-2">
1818
<div class="tw-w-24 tw-flex-shrink-0 tw-font-bold">MSCore</div>
19-
<div class="tw-flex-grow">V{{\ModStart\ModStart::$version}} ( With <b>{{strtoupper(\ModStart\Module\ModuleManager::getEnv())}}</b> )</div>
19+
<div class="tw-flex-grow">V{{\ModStart\ModStart::$version}} ( With <b>{{strtoupper(ModStart\ModStart::env())}}</b> )</div>
2020
</div>
2121
</div>
2222
<div class="col-lg-4 col-md-6">

module/ModuleStore/Util/ModuleStoreUtil.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,11 @@ public static function checkPackage($token, $module, $version)
170170
if (empty($config['env'])) {
171171
$config['env'] = ['laravel5'];
172172
}
173-
if (method_exists(ModuleManager::class, 'getEnv')) {
174-
$env = ModuleManager::getEnv();
175-
BizException::throwsIf(
176-
L('Module %s:%s compatible with env %s, current is %s', $module, $config['version'], join(',', $config['env']), $env),
177-
!in_array($env, $config['env'])
178-
);
179-
}
173+
$env = ModStart::env();
174+
BizException::throwsIf(
175+
L('Module %s:%s compatible with env %s, current is %s', $module, $config['version'], join(',', $config['env']), $env),
176+
!in_array($env, $config['env'])
177+
);
180178

181179
return Response::generateSuccessData([
182180
'requires' => $requires,

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/Provider/ProviderTrait.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,10 @@ public static function first()
109109
}
110110
return null;
111111
}
112+
113+
public static function titleByName($name)
114+
{
115+
$item = self::getByName($name);
116+
return $item ? $item->title() : $name;
117+
}
112118
}

module/Vendor/Util/AtomicUtil.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use ModStart\Core\Dao\ModelUtil;
66
use ModStart\Core\Util\RandomUtil;
77
use ModStart\Core\Util\RedisUtil;
8+
use Module\Vendor\Model\Atomic;
89

910
/**
1011
* Class AtomicUtil
@@ -20,7 +21,7 @@ class AtomicUtil
2021
private static function autoCleanDB()
2122
{
2223
if (RandomUtil::percent(20)) {
23-
ModelUtil::model('atomic')->where('expire', '<', time())->delete();
24+
ModelUtil::model(Atomic::class)->where('expire', '<', time())->delete();
2425
}
2526
}
2627

@@ -38,10 +39,10 @@ public static function produce($name, $value, $expire = 3600)
3839
RedisUtil::set($hash, $value);
3940
RedisUtil::expire($hash, $expire);
4041
} else {
41-
if (ModelUtil::exists('atomic', ['name' => $name,])) {
42-
ModelUtil::update('atomic', ['name' => $name,], ['value' => $value, 'expire' => time() + $expire]);
42+
if (ModelUtil::exists(Atomic::class, ['name' => $name])) {
43+
ModelUtil::update(Atomic::class, ['name' => $name], ['value' => $value, 'expire' => time() + $expire]);
4344
} else {
44-
ModelUtil::insert('atomic', ['name' => $name, 'value' => $value, 'expire' => time() + $expire]);
45+
ModelUtil::insertIgnoreUnique(Atomic::class, ['name' => $name, 'value' => $value, 'expire' => time() + $expire]);
4546
}
4647
self::autoCleanDB();
4748
}
@@ -63,17 +64,17 @@ public static function consume($name)
6364
} else {
6465
self::autoCleanDB();
6566
ModelUtil::transactionBegin();
66-
$atomic = ModelUtil::getWithLock('atomic', ['name' => $name]);
67+
$atomic = ModelUtil::getWithLock(Atomic::class, ['name' => $name]);
6768
if (empty($atomic)) {
6869
ModelUtil::transactionCommit();
6970
return false;
7071
}
7172
if ($atomic['expire'] < time() || $atomic['value'] < 0) {
72-
ModelUtil::delete('atomic', ['name' => $name]);
73+
ModelUtil::delete(Atomic::class, ['name' => $name]);
7374
ModelUtil::transactionCommit();
7475
return false;
7576
}
76-
ModelUtil::update('atomic', ['name' => $name], ['value' => $atomic['value'] - 1]);
77+
ModelUtil::update(Atomic::class, ['name' => $name], ['value' => $atomic['value'] - 1]);
7778
ModelUtil::transactionCommit();
7879
return true;
7980
}
@@ -89,7 +90,7 @@ public static function remove($name)
8990
$hash = "Atomic:$name";
9091
RedisUtil::delete($hash);
9192
} else {
92-
ModelUtil::delete('atomic', ['name' => $name]);
93+
ModelUtil::delete(Atomic::class, ['name' => $name]);
9394
}
9495
}
9596

@@ -117,10 +118,10 @@ public static function acquire($name, $expire = 30)
117118
} else {
118119
self::autoCleanDB();
119120
ModelUtil::transactionBegin();
120-
$atomic = ModelUtil::getWithLock('atomic', ['name' => $name]);
121+
$atomic = ModelUtil::getWithLock(Atomic::class, ['name' => $name]);
121122
$ts = time() + $expire;
122123
if (empty($atomic)) {
123-
ModelUtil::insert('atomic', [
124+
ModelUtil::insert(Atomic::class, [
124125
'name' => $name,
125126
'value' => 1,
126127
'expire' => $ts
@@ -129,7 +130,7 @@ public static function acquire($name, $expire = 30)
129130
return true;
130131
}
131132
if ($atomic['expire'] < time()) {
132-
ModelUtil::update('atomic', ['name' => $name], [
133+
ModelUtil::update(Atomic::class, ['name' => $name], [
133134
'value' => 1,
134135
'expire' => $ts
135136
]);
@@ -151,7 +152,7 @@ public static function release($name)
151152
$key = "Atomic:$name";
152153
RedisUtil::delete($key);
153154
} else {
154-
ModelUtil::delete('atomic', ['name' => $name]);
155+
ModelUtil::delete(Atomic::class, ['name' => $name]);
155156
}
156157
}
157158
}

module/Vendor/View/widget/captcha/default.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
data-captcha
55
class="tw-rounded tw-cursor-pointer"
66
onclick="this.src='{{modstart_web_url('captcha/image')}}?'+Math.random();"
7-
style="height:1.8rem;width:100%;" />
7+
style="height:2rem;width:100%;" />
88
</div>
99
<div class="input tw-flex-grow">
1010
<input type="text" style="width:100%;" class="form-lg" name="captcha" placeholder="图片验证" />

module/VisitStatistic/Admin/Widget/VisitStatisticReport.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,18 @@ export default {
5858
"data": this.pv,
5959
"type": "line",
6060
"smooth": true,
61+
"areaStyle": {
62+
opacity: 0.1
63+
},
6164
"itemStyle": {"normal": {"color": "#4F7FF3", "lineStyle": {"color": "#4F7FF3"}}}
6265
}, {
6366
"name": "访客数",
6467
"data": this.uv,
6568
"type": "line",
6669
"smooth": true,
70+
"areaStyle": {
71+
opacity: 0.1
72+
},
6773
"itemStyle": {"normal": {"color": "#6A46BD", "lineStyle": {"color": "#6A46BD"}}}
6874
}]
6975
});

module/VisitStatistic/Docs/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 1.2.0
1+
## 1.2.0 运营报表页面,实时数据优化
22

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

module/VisitStatistic/config.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
],
1616
"suggest": [],
1717
"version": "1.2.0",
18-
"modstartVersion": ">=3.7.0",
18+
"modstartVersion": ">=3.9.0",
1919
"author": "ModStart",
2020
"description": "提供内置的网站访问记录功能",
21-
"providers": [
22-
],
23-
"config": {
24-
}
25-
}
21+
"providers": [],
22+
"config": {}
23+
}

public/asset/common/base.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/asset/common/editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)