diff --git a/app/admin/controller/Module.php b/app/admin/controller/Module.php index 5c422db3e..5c9d81f8e 100644 --- a/app/admin/controller/Module.php +++ b/app/admin/controller/Module.php @@ -56,13 +56,13 @@ class Module extends Controller { $data = $this->_vali(['name.require' => '模块名称不能为空!']); $modules = ModuleService::instance()->online(); + $locals = ModuleService::instance()->getModules(); if (isset($modules[$data['name']])) { $this->module = $modules[$data['name']]; - foreach ($this->module['change'] as $key => &$change) { - $change = [ - 'version' => preg_replace("|^(\d{4})\.(\d{2})\.(\d{2})\.(\d+)$|", '$1年$2月$3日 第$4次更新', $key), - 'content' => $change, - ]; + $this->current = $locals[$data['name']] ?? []; + $pattern = "|^(\d{4})\.(\d{2})\.(\d{2})\.(\d+)$|"; + foreach ($this->module['change'] as $version => &$change) { + $change = ['content' => $change, 'version' => preg_replace($pattern, '于 $1年$2月$3日 第$4次更新', $version)]; } $this->fetch(); } else { diff --git a/app/admin/module/change/2020.08.03.01.md b/app/admin/module/change/2020.08.03.01.md index ad09f61a5..4d75b48bf 100644 --- a/app/admin/module/change/2020.08.03.01.md +++ b/app/admin/module/change/2020.08.03.01.md @@ -1 +1 @@ -* 少于更新,修复部分BUG \ No newline at end of file +* 少量更新,修复部分BUG \ No newline at end of file diff --git a/app/admin/view/module/change.html b/app/admin/view/module/change.html index d03d97282..457f4a2d7 100644 --- a/app/admin/view/module/change.html +++ b/app/admin/view/module/change.html @@ -1,29 +1,31 @@
- - - - - - - - - - - - - -
模块名称{$module.name}
最新版本{$module.version}
模块描述{$module.content}
+
+
+
模块名称:{$module.name}
+
开发作者:{$module.author}
+
+
+
最新版本:{$module.version}
+
{if isset($current.version)}已安装版本:{$current.version}{/if}
+
+
模块描述:{$module.content}
+
\ No newline at end of file diff --git a/composer.lock b/composer.lock index 3f9d0b6e7..5197ce859 100644 --- a/composer.lock +++ b/composer.lock @@ -937,12 +937,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "822d461c4f23e5ab3cd3489cd740a7171706e367" + "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/822d461c4f23e5ab3cd3489cd740a7171706e367", - "reference": "822d461c4f23e5ab3cd3489cd740a7171706e367", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/747278ffb2b1a450bc8e6724ffbff105bb9f5f47", + "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47", "shasum": "", "mirrors": [ { @@ -987,7 +987,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://thinkadmin.top", - "time": "2020-08-17T07:02:36+00:00" + "time": "2020-08-17T07:32:11+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index a846263da..3227d712e 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -283,6 +283,7 @@ return array( 'think\\admin\\extend\\HttpExtend' => $vendorDir . '/zoujingli/think-library/src/extend/HttpExtend.php', 'think\\admin\\extend\\JsonRpcClient' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcClient.php', 'think\\admin\\extend\\JsonRpcServer' => $vendorDir . '/zoujingli/think-library/src/extend/JsonRpcServer.php', + 'think\\admin\\extend\\Parsedown' => $vendorDir . '/zoujingli/think-library/src/extend/Parsedown.php', 'think\\admin\\helper\\DeleteHelper' => $vendorDir . '/zoujingli/think-library/src/helper/DeleteHelper.php', 'think\\admin\\helper\\FormHelper' => $vendorDir . '/zoujingli/think-library/src/helper/FormHelper.php', 'think\\admin\\helper\\PageHelper' => $vendorDir . '/zoujingli/think-library/src/helper/PageHelper.php', @@ -298,7 +299,6 @@ return array( 'think\\admin\\service\\CaptchaService' => $vendorDir . '/zoujingli/think-library/src/service/CaptchaService.php', 'think\\admin\\service\\ExpressService' => $vendorDir . '/zoujingli/think-library/src/service/ExpressService.php', 'think\\admin\\service\\InstallService' => $vendorDir . '/zoujingli/think-library/src/service/InstallService.php', - 'think\\admin\\service\\MarkdownService' => $vendorDir . '/zoujingli/think-library/src/service/MarkdownService.php', 'think\\admin\\service\\MenuService' => $vendorDir . '/zoujingli/think-library/src/service/MenuService.php', 'think\\admin\\service\\MessageService' => $vendorDir . '/zoujingli/think-library/src/service/MessageService.php', 'think\\admin\\service\\ModuleService' => $vendorDir . '/zoujingli/think-library/src/service/ModuleService.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 482b5dee5..68421e7a2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -416,6 +416,7 @@ class ComposerStaticInitb911c14a0826c73d9f097343fd33a252 'think\\admin\\extend\\HttpExtend' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/HttpExtend.php', 'think\\admin\\extend\\JsonRpcClient' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcClient.php', 'think\\admin\\extend\\JsonRpcServer' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/JsonRpcServer.php', + 'think\\admin\\extend\\Parsedown' => __DIR__ . '/..' . '/zoujingli/think-library/src/extend/Parsedown.php', 'think\\admin\\helper\\DeleteHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/DeleteHelper.php', 'think\\admin\\helper\\FormHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/FormHelper.php', 'think\\admin\\helper\\PageHelper' => __DIR__ . '/..' . '/zoujingli/think-library/src/helper/PageHelper.php', @@ -431,7 +432,6 @@ class ComposerStaticInitb911c14a0826c73d9f097343fd33a252 'think\\admin\\service\\CaptchaService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/CaptchaService.php', 'think\\admin\\service\\ExpressService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ExpressService.php', 'think\\admin\\service\\InstallService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/InstallService.php', - 'think\\admin\\service\\MarkdownService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MarkdownService.php', 'think\\admin\\service\\MenuService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MenuService.php', 'think\\admin\\service\\MessageService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/MessageService.php', 'think\\admin\\service\\ModuleService' => __DIR__ . '/..' . '/zoujingli/think-library/src/service/ModuleService.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f45475293..463f8358d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -963,12 +963,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "822d461c4f23e5ab3cd3489cd740a7171706e367" + "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/822d461c4f23e5ab3cd3489cd740a7171706e367", - "reference": "822d461c4f23e5ab3cd3489cd740a7171706e367", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/747278ffb2b1a450bc8e6724ffbff105bb9f5f47", + "reference": "747278ffb2b1a450bc8e6724ffbff105bb9f5f47", "shasum": "", "mirrors": [ { @@ -985,7 +985,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2020-08-17T07:02:36+00:00", + "time": "2020-08-17T07:32:11+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index c13f3c074..e16b6b47f 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library',