Skip to content

Commit 973e79b

Browse files
committed
feat: modstart ugprade
1 parent d8343b6 commit 973e79b

File tree

64 files changed

+884
-474
lines changed

Some content is hidden

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

64 files changed

+884
-474
lines changed

config/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'charset' => 'utf8',
6363
'collation' => 'utf8_unicode_ci',
6464
'prefix' => env('DB_PREFIX'),
65-
'strict' => false,
65+
'strict' => true,
6666
],
6767

6868
'pgsql' => [

module/Blog/Docs/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 2.5.0
1+
## 2.5.0 置顶、热门、推荐博客,适配打赏功能
22

33
- 新增:置顶、热门、推荐博客获取函数
44
- 新增:博客热门、博客推荐功能

module/Blog/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"tags": [
1818
"博客"
1919
],
20-
"version": "2.4.0",
20+
"version": "2.5.0",
2121
"author": "ModStart",
2222
"description": "提供一个基础的博客系统",
2323
"suggest": [

module/Vendor/Developer/UniappUtil.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33

44
namespace Module\Vendor\Developer;
55

6-
use ModStart\Core\Util\ReUtil;
76
use ModStart\Core\Util\PlatformUtil;
7+
use ModStart\Core\Util\ReUtil;
88

99
include_once __DIR__ . '/../Shell/include.php';
1010

1111
class UniappUtil
1212
{
13+
public static function runOrFail($command)
14+
{
15+
shell_echo_info("开始运行 $command");
16+
passthru($command, $resultCode);
17+
if ($resultCode !== 0) {
18+
shell_echo_error('运行命令 ' . $command . ' 失败');
19+
exit(1);
20+
}
21+
}
22+
1323
public static function build($dir)
1424
{
1525
$module = ReUtil::group1('/module[\/\\\\](.*?)[\/\\\\]resources/', $dir);
@@ -22,7 +32,8 @@ public static function build($dir)
2232
shell_echo_success('环境正常');
2333

2434
shell_echo_block("开始编译");
25-
passthru("npm run build:h5");
35+
self::runOrFail("npm install");
36+
self::runOrFail("npm run build:h5");
2637

2738
shell_echo_block("处理HTML文件");
2839
$content = file_get_contents('dist/build/h5/index.html');
@@ -44,8 +55,7 @@ public static function build($dir)
4455
shell_echo_block("处理静态文件");
4556
$replaces = [
4657
'"__cdn_url__/"' => 'window.__msCDN+"vendor/' . $module . '/"',
47-
'(/static/' => '(/vendor/' . $module . '/static/',
48-
'"/static/' => '"/vendor/' . $module . '/static/',
58+
'"/static/' => 'window.__msCDN+"vendor/' . $module . '/static/',
4959
];
5060
$files = glob('dist/build/h5/static/js/*.js');
5161
foreach ($files as $file) {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 如何查看Chrome网站有没有前端JavaScript报错?
2+
3+
---
4+
5+
您可以按照以下步骤在Chrome中查看网站是否存在前端JavaScript报错:
6+
7+
## 步骤1:打开Chrome浏览器并访问网站
8+
9+
首先,打开Chrome浏览器并访问您想要检查JavaScript报错的网站。
10+
11+
## 步骤2:打开开发者工具
12+
13+
在Chrome浏览器中,按下"Ctrl+Shift+I"(在Windows和Linux上)或"Cmd+Option+I"(在macOS上)快捷键,打开开发者工具。
14+
15+
## 步骤3:选择"Console"选项卡
16+
17+
在开发者工具窗口中,点击位于顶部的"Console"选项卡。如果您无法看到该选项卡,请点击位于开发者工具窗口右上角的">>"按钮,找到该选项卡。
18+
19+
## 步骤4:检查控制台信息
20+
21+
现在,在"Console"选项卡中,您可以查看网站的前端JavaScript报错信息。如果有JavaScript报错,您将在控制台看到相应的错误消息和行号。
22+
23+
此外,您还可以使用"Filter"过滤器来查找特定类型的错误,例如警告、错误、信息等。
24+
25+
总结:
26+
27+
使用Chrome浏览器中的开发者工具中的"Console"选项卡,您可以轻松检查网站是否存在前端JavaScript报错,并查看相应的错误信息。这将有助于您更好地了解
28+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 如何查看Chrome开发者模式查看网络请求
2+
3+
---
4+
5+
您可以按照以下步骤在Chrome中查看网络请求:
6+
7+
## 步骤1:打开Chrome浏览器并访问网站
8+
9+
首先,打开Chrome浏览器并访问您想要查看网络请求的网站。
10+
11+
## 步骤2:打开开发者工具
12+
13+
在Chrome浏览器中,按下"Ctrl+Shift+I"(在Windows和Linux上)或"Cmd+Option+I"(在macOS上)快捷键,打开开发者工具。
14+
15+
## 步骤3:选择"Network"选项卡
16+
17+
在开发者工具窗口中,点击位于顶部的"Network"选项卡。如果您无法看到该选项卡,请点击位于开发者工具窗口右上角的">>"按钮,找到该选项卡。
18+
19+
## 步骤4:刷新网页
20+
21+
在"Network"选项卡被选中的情况下,刷新您的网页。这将使Chrome浏览器开始记录网络请求。
22+
23+
## 步骤5:查看网络请求
24+
25+
现在,您可以查看网站的所有网络请求。在"Network"选项卡中,您可以看到每个请求的详细信息,例如请求的URL、请求方法、请求头、响应状态、响应头和响应体等信息。
26+
27+
您可以点击每个请求来查看详细信息,或者使用筛选器、搜索和排序等工具来分析数据。
28+
29+
总结: 使用Chrome浏览器中的开发者工具,您可以轻松查看网站的网络请求。这将帮助您更好地了解网站的性能,并检查可能存在的错误和问题。

module/Vendor/Installer/install.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,19 @@ function doStepEnv(){
145145
<?php text_success('系统:' . PHP_OS); ?>
146146
<?php php_version_ok() ? text_success('PHP版本 ' . PHP_VERSION) : text_error('PHP版本要求('.php_version_requires().') 当前为 ' . PHP_VERSION); ?>
147147
<?php text_success('最大上传:' . FileUtil::formatByte(EnvUtil::env('uploadMaxSize'))); ?>
148-
<?php function_exists('openssl_open') ? text_success('OpenSSL PHP 扩展') : text_error('缺少 OpenSSL PHP 扩展'); ?>
149-
<?php function_exists('exif_read_data') ? text_success('Exif PHP 扩展') : text_error('缺少 Exif PHP 扩展'); ?>
148+
<?php function_exists('curl_init') ? text_success('PHP curl 扩展') : text_error('缺少 PHP curl 扩展'); ?>
149+
<?php class_exists('ZipArchive') ? text_success('PHP zip 扩展') : text_error('缺少 PHP zip 扩展'); ?>
150+
<?php function_exists('openssl_open') ? text_success('PHP openssl 扩展') : text_error('缺少 PHP openssl 扩展'); ?>
151+
<?php function_exists('exif_read_data') ? text_success('PHP exif 扩展') : text_error('缺少 PHP exif 扩展'); ?>
152+
<?php function_exists('bcmul') ? text_success('PHP bcmath 扩展') : text_error('缺少 PHP bcmath 扩展'); ?>
153+
<?php class_exists('pdo') ? text_success('PHP pdo 扩展') : text_error('缺少 PHP pdo 扩展'); ?>
154+
<?php (class_exists('pdo') && in_array('mysql', PDO::getAvailableDrivers())) ? text_success('PHP PDO mysql 驱动') : text_error('缺少 PHP PDO mysql 驱动'); ?>
155+
<?php function_exists('mb_internal_encoding') ? text_success('PHP mbstring 扩展') : text_error('缺少 PHP mbstring 扩展'); ?>
156+
<?php function_exists('token_get_all') ? text_success('PHP tokenizer 扩展') : text_error('缺少 PHP tokenizer 扩展'); ?>
157+
<?php function_exists('finfo_file') ? text_success('PHP fileinfo 扩展') : text_error('缺少 PHP fileinfo 扩展'); ?>
150158
<?php function_exists('proc_open') ? text_success('proc_open 函数') : text_error('缺少 proc_open 函数','https://modstart.com/doc/install/qa.html'); ?>
151159
<?php function_exists('putenv') ? text_success('putenv 函数') : text_error('缺少 putenv 函数','https://modstart.com/doc/install/qa.html'); ?>
152160
<?php function_exists('proc_get_status') ? text_success('proc_get_status 函数') : text_error('缺少 proc_get_status 函数','https://modstart.com/doc/install/qa.html'); ?>
153-
<?php function_exists('bcmul') ? text_success('bcmath 扩展') : text_error('缺少 PHP bcmath 扩展'); ?>
154-
<?php class_exists('pdo') ? text_success('PDO PHP 扩展') : text_error('缺少 PDO PHP 扩展'); ?>
155-
<?php (class_exists('pdo') && in_array('mysql', PDO::getAvailableDrivers())) ? text_success('PDO Mysql 驱动正常') : text_error('缺少 PDO Mysql 驱动'); ?>
156-
<?php function_exists('mb_internal_encoding') ? text_success('缺少 Mbstring PHP 扩展') : text_error('缺少 Mbstring PHP 扩展'); ?>
157-
<?php function_exists('token_get_all') ? text_success('缺少 Tokenizer PHP 扩展') : text_error('缺少 Tokenizer PHP 扩展'); ?>
158-
<?php function_exists('finfo_file') ? text_success('缺少 PHP Fileinfo 扩展') : text_error('缺少 PHP Fileinfo 扩展'); ?>
159161
<?php if(version_compare(PHP_VERSION,'5.6.0','ge') && version_compare(PHP_VERSION,'5.7.0','lt')){ ?>
160162
<?php EnvUtil::iniFileConfig('always_populate_raw_post_data')=='-1' ? text_success('验证 always_populate_raw_post_data=-1') : text_error('请配置 always_populate_raw_post_data=-1','https://modstart.com/doc/install/qa.html'); ?>
161163
<?php } ?>

module/Vendor/Log/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private static function rotateLogClean($filename, $logType, $maxKeeps, $base)
2929
return strcmp($b, $a);
3030
});
3131
foreach (array_slice($logFiles, $maxKeeps) as $file) {
32-
Log::info("Logger Clean - " . $file);
32+
Log::info("Vendor.LoggerClean - " . $file);
3333
@unlink($file);
3434
}
3535
}

module/Vendor/Provider/ContentVerify/ContentVerifyJob.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Module\Vendor\Provider\ContentVerify;
55

66

7+
use Illuminate\Support\Facades\Log;
78
use ModStart\Core\Input\Request;
89
use ModStart\Core\Job\BaseJob;
910

@@ -14,7 +15,7 @@ class ContentVerifyJob extends BaseJob
1415
public $body;
1516
public $param;
1617

17-
public static function createQuick($name, $id, $title, $viewUrl)
18+
public static function createQuick($name, $id, $title, $viewUrl = null)
1819
{
1920
self::create($name, [
2021
'id' => $id,
@@ -44,6 +45,10 @@ public static function create($name, $param, $title, $body = null)
4445
public function handle()
4546
{
4647
$provider = ContentVerifyProvider::get($this->name);
48+
if (empty($provider)) {
49+
Log::info('Vendor.ContentVerifyJob.UnknownProvider - ' . $this->name);
50+
return;
51+
}
4752
$provider->run($this->param, $this->title, $this->body);
4853
}
4954
}

module/Vendor/Provider/Notifier/DefaultNotifierProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class DefaultNotifierProvider extends AbstractNotifierProvider
1010
{
1111
public function notify($biz, $title, $content, $param = [])
1212
{
13-
Log::info(sprintf('DefaultNotifierProvider - %s - %s - %s', $biz, $title, json_encode($content, JSON_UNESCAPED_UNICODE)));
13+
Log::info(sprintf('Vendor.DefaultNotifierProvider - %s - %s - %s', $biz, $title, json_encode($content, JSON_UNESCAPED_UNICODE)));
1414
}
1515
}

0 commit comments

Comments
 (0)