@@ -68,22 +76,29 @@
-
{block name='script'}
{/block}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 5f6cf8d0c..0c5cc383c 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -958,17 +958,17 @@
},
{
"name": "zoujingli/think-library",
- "version": "v6.0.2",
- "version_normalized": "6.0.2.0",
+ "version": "v6.0.3",
+ "version_normalized": "6.0.3.0",
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
- "reference": "a498595d637568481601091985ae22d5cd05a057"
+ "reference": "98f56d2c2a589cfa4074733c655021d38d78b4aa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a498595d637568481601091985ae22d5cd05a057",
- "reference": "a498595d637568481601091985ae22d5cd05a057",
+ "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/98f56d2c2a589cfa4074733c655021d38d78b4aa",
+ "reference": "98f56d2c2a589cfa4074733c655021d38d78b4aa",
"shasum": "",
"mirrors": [
{
@@ -985,7 +985,7 @@
"ext-mbstring": "*",
"topthink/framework": "^6.0"
},
- "time": "2020-08-31T11:59:58+00:00",
+ "time": "2020-09-02T03:17:43+00:00",
"type": "library",
"extra": {
"think": {
diff --git a/vendor/services.php b/vendor/services.php
index da4051860..e546d4c68 100644
--- a/vendor/services.php
+++ b/vendor/services.php
@@ -1,5 +1,5 @@
'think\\admin\\Library',
diff --git a/vendor/zoujingli/think-library/.gitignore b/vendor/zoujingli/think-library/.gitignore
index 301c8c264..b7f883d2c 100644
--- a/vendor/zoujingli/think-library/.gitignore
+++ b/vendor/zoujingli/think-library/.gitignore
@@ -1,8 +1,8 @@
+.git
+.svn
.idea
!.gitignore
!composer.json
-composer.lock
-app
-config
-vendor
-public
+/composer.lock
+/vendor
+/test.php
\ No newline at end of file
diff --git a/vendor/zoujingli/think-library/src/Command.php b/vendor/zoujingli/think-library/src/Command.php
index 51f6afbff..7ebc3683b 100644
--- a/vendor/zoujingli/think-library/src/Command.php
+++ b/vendor/zoujingli/think-library/src/Command.php
@@ -44,7 +44,7 @@ abstract class Command extends ThinkCommand
* 初始化指令变量
* @param Input $input
* @param Output $output
- * @return $this
+ * @return static
* @throws Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
@@ -69,7 +69,7 @@ abstract class Command extends ThinkCommand
* 设置进度消息并继续执行
* @param null|string $message 进度消息
* @param null|integer $progress 进度数值
- * @return Command
+ * @return static
*/
protected function setQueueProgress($message = null, $progress = null)
{
@@ -84,7 +84,7 @@ abstract class Command extends ThinkCommand
/**
* 设置失败消息并结束进程
* @param string $message 消息内容
- * @return Command
+ * @return static
* @throws Exception
*/
protected function setQueueError($message)
@@ -100,7 +100,7 @@ abstract class Command extends ThinkCommand
/**
* 设置成功消息并结束进程
* @param string $message 消息内容
- * @return Command
+ * @return static
* @throws Exception
*/
protected function setQueueSuccess($message)
diff --git a/vendor/zoujingli/think-library/src/Library.php b/vendor/zoujingli/think-library/src/Library.php
index f2b09fcfa..c59c73517 100644
--- a/vendor/zoujingli/think-library/src/Library.php
+++ b/vendor/zoujingli/think-library/src/Library.php
@@ -41,7 +41,7 @@ class Library extends Service
/**
* 扩展库版本号
*/
- const VERSION = '6.0.2';
+ const VERSION = '6.0.3';
/**
* 启动服务
diff --git a/vendor/zoujingli/think-library/src/Storage.php b/vendor/zoujingli/think-library/src/Storage.php
index b231c48a1..96b169f65 100644
--- a/vendor/zoujingli/think-library/src/Storage.php
+++ b/vendor/zoujingli/think-library/src/Storage.php
@@ -119,10 +119,9 @@ abstract class Storage
*/
public static function name($url, $ext = '', $pre = '', $fun = 'md5')
{
- if (empty($ext)) $ext = pathinfo($url, 4);
- [$xmd, $ext] = [$fun($url), trim($ext, '.\\/')];
- $attr = [trim($pre, '.\\/'), substr($xmd, 0, 2), substr($xmd, 2, 30)];
- return trim(join('/', $attr), '/') . '.' . strtolower($ext ? $ext : 'tmp');
+ [$hah, $ext] = [$fun($url), trim($ext ?: pathinfo($url, 4), '.\\/')];
+ $attr = [trim($pre, '.\\/'), substr($hah, 0, 2), substr($hah, 2, 30)];
+ return trim(join('/', $attr), '/') . '.' . strtolower($ext ?: 'tmp');
}
/**
diff --git a/vendor/zoujingli/think-library/src/extend/Parsedown.php b/vendor/zoujingli/think-library/src/extend/Parsedown.php
index 07d321232..53b9e42e4 100644
--- a/vendor/zoujingli/think-library/src/extend/Parsedown.php
+++ b/vendor/zoujingli/think-library/src/extend/Parsedown.php
@@ -3,7 +3,7 @@
// +----------------------------------------------------------------------
// | Library for ThinkAdmin
// +----------------------------------------------------------------------
-// | 版权所有 2014~2020 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// | 此文件版权所有归原作者所有,在此特别感觉 !!!!!!!!!!!!!!!
// +----------------------------------------------------------------------
// | 官方网站: https://gitee.com/zoujingli/ThinkLibrary
// +----------------------------------------------------------------------
diff --git a/vendor/zoujingli/think-library/src/multiple/App.php b/vendor/zoujingli/think-library/src/multiple/App.php
index 793096853..b8121ab4f 100644
--- a/vendor/zoujingli/think-library/src/multiple/App.php
+++ b/vendor/zoujingli/think-library/src/multiple/App.php
@@ -20,13 +20,16 @@ use think\Request;
use think\Response;
/**
- * 多应用支持
- * Class MultiApp
+ * 多应用支持组件
+ * Class App
* @package think\admin\multiple
*/
class App
{
- /** @var \think\App */
+ /**
+ * 应用实例
+ * @var \think\App
+ */
protected $app;
/**
@@ -118,8 +121,7 @@ class App
}
if (isset($map[$name])) {
if ($map[$name] instanceof Closure) {
- $result = call_user_func_array($map[$name], [$this->app]);
- $appName = $result ?: $name;
+ $appName = call_user_func_array($map[$name], [$this->app]) ?: $name;
} else {
$appName = $map[$name];
}
@@ -131,8 +133,7 @@ class App
$appName = $name ?: $defaultApp;
$appPath = $this->path ?: $this->app->getBasePath() . $appName . DIRECTORY_SEPARATOR;
if (!is_dir($appPath)) {
- $express = $this->app->config->get('app.app_express', false);
- if ($express) {
+ if ($this->app->config->get('app.app_express', false)) {
$this->setApp($defaultApp);
return true;
} else {
diff --git a/vendor/zoujingli/think-library/src/service/InterfaceService.php b/vendor/zoujingli/think-library/src/service/InterfaceService.php
index ee78c7917..951a9a220 100644
--- a/vendor/zoujingli/think-library/src/service/InterfaceService.php
+++ b/vendor/zoujingli/think-library/src/service/InterfaceService.php
@@ -105,8 +105,8 @@ class InterfaceService extends Service
/**
* 设置授权账号
- * @param string $appid
- * @param string $appkey
+ * @param string $appid 接口账号
+ * @param string $appkey 接口密钥
* @return $this
*/
public function setAuth($appid, $appkey)
diff --git a/vendor/zoujingli/think-library/src/service/MenuService.php b/vendor/zoujingli/think-library/src/service/MenuService.php
index 33b6ac1e8..882047312 100644
--- a/vendor/zoujingli/think-library/src/service/MenuService.php
+++ b/vendor/zoujingli/think-library/src/service/MenuService.php
@@ -31,7 +31,7 @@ class MenuService extends Service
* @return array
* @throws \ReflectionException
*/
- public function getList()
+ public function getList(): array
{
static $nodes = [];
if (count($nodes) > 0) return $nodes;
@@ -49,32 +49,42 @@ class MenuService extends Service
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
- public function getTree()
+ public function getTree(): array
{
- $result = $this->app->db->name('SystemMenu')->where(['status' => '1'])->order('sort desc,id asc')->select();
- return $this->_buildData(DataExtend::arr2tree($result->toArray()), NodeService::instance()->getMethods());
+ $query = $this->app->db->name('SystemMenu');
+ $query->where(['status' => '1'])->order('sort desc,id asc');
+ return $this->_buildData(DataExtend::arr2tree($query->select()->toArray()));
}
/**
* 后台主菜单权限过滤
* @param array $menus 当前菜单列表
- * @param array $nodes 系统权限节点
* @return array
* @throws \ReflectionException
*/
- private function _buildData($menus, $nodes)
+ private function _buildData(array $menus): array
{
+ $service = AdminService::instance();
foreach ($menus as $key => &$menu) {
if (!empty($menu['sub'])) {
- $menu['sub'] = $this->_buildData($menu['sub'], $nodes);
+ $menu['sub'] = $this->_buildData($menu['sub']);
}
- if (!empty($menu['sub'])) $menu['url'] = '#';
- elseif ($menu['url'] === '#') unset($menus[$key]);
- elseif (preg_match('|^https?://|i', $menu['url'])) continue;
- else {
+ if (!empty($menu['sub'])) {
+ $menu['url'] = '#';
+ } elseif ($menu['url'] === '#') {
+ unset($menus[$key]);
+ } elseif (preg_match('|^https?://|i', $menu['url'])) {
+ if (!!$menu['node'] && !$service->check($menu['node'])) {
+ unset($menus[$key]);
+ } elseif ($menu['params']) {
+ $menu['url'] .= (strpos($menu['url'], '?') === false ? '?' : '&') . $menu['params'];
+ }
+ } elseif (!!$menu['node'] && !$service->check($menu['node'])) {
+ unset($menus[$key]);
+ } else {
$node = join('/', array_slice(explode('/', $menu['url']), 0, 3));
- $menu['url'] = url($menu['url']) . (empty($menu['params']) ? '' : "?{$menu['params']}");
- if (!AdminService::instance()->check($node)) unset($menus[$key]);
+ $menu['url'] = url($menu['url']) . ($menu['params'] ? '' : "?{$menu['params']}");
+ if (!$service->check($node)) unset($menus[$key]);
}
}
return $menus;
diff --git a/vendor/zoujingli/think-library/src/service/SystemService.php b/vendor/zoujingli/think-library/src/service/SystemService.php
index c7357dfb7..de484d932 100644
--- a/vendor/zoujingli/think-library/src/service/SystemService.php
+++ b/vendor/zoujingli/think-library/src/service/SystemService.php
@@ -49,15 +49,19 @@ class SystemService extends Service
*/
public function set($name, $value = '')
{
- [$this->data, $count] = [[], 0];
- [$type, $field] = $this->parse($name, 'base');
+ $this->data = [];
+ [$type, $field] = $this->_parse($name, 'base');
if (is_array($value)) {
- foreach ($value as $kk => $vv) $count += $this->set("{$field}.{$kk}", $vv);
+ $count = 0;
+ foreach ($value as $kk => $vv) {
+ $count += $this->set("{$field}.{$kk}", $vv);
+ }
return $count;
} else {
$this->app->cache->delete($this->table);
- $data = ['type' => $type, 'name' => $field, 'value' => $value];
- $query = $this->app->db->name($this->table)->where(['type' => $type, 'name' => $field]);
+ $map = ['type' => $type, 'name' => $field];
+ $data = array_merge($map, ['value' => $value]);
+ $query = $this->app->db->name($this->table)->master(true)->where($map);
return (clone $query)->count() > 0 ? $query->update($data) : $query->insert($data);
}
}
@@ -73,10 +77,12 @@ class SystemService extends Service
*/
public function get($name = '', $default = '')
{
- [$type, $field, $outer] = $this->parse($name, 'base');
- if (empty($this->data)) $this->app->db->name($this->table)->cache($this->table)->select()->map(function ($item) {
- $this->data[$item['type']][$item['name']] = $item['value'];
- });
+ if (empty($this->data)) {
+ $this->app->db->name($this->table)->cache($this->table)->select()->map(function ($item) {
+ $this->data[$item['type']][$item['name']] = $item['value'];
+ });
+ }
+ [$type, $field, $outer] = $this->_parse($name, 'base');
if (empty($name)) {
return $this->data;
} elseif (isset($this->data[$type])) {
@@ -115,7 +121,7 @@ class SystemService extends Service
* @param string $type 配置类型
* @return array
*/
- private function parse($rule, $type = 'base')
+ private function _parse($rule, $type = 'base')
{
if (stripos($rule, '.') !== false) {
[$type, $rule] = explode('.', $rule, 2);
diff --git a/vendor/zoujingli/think-library/src/service/ZtSmsService.php b/vendor/zoujingli/think-library/src/service/ZtSmsService.php
index 0a9090989..aebdaa431 100644
--- a/vendor/zoujingli/think-library/src/service/ZtSmsService.php
+++ b/vendor/zoujingli/think-library/src/service/ZtSmsService.php
@@ -45,8 +45,8 @@ class ZtSmsService extends Service
*/
protected function initialize()
{
- $this->username = sysconf('ztsms.username');
- $this->password = sysconf('ztsms.password');
+ $this->username = sysconf('ztsms.username') ?: '';
+ $this->password = sysconf('ztsms.password') ?: '';
}
/**
@@ -55,7 +55,7 @@ class ZtSmsService extends Service
* @param string $password 账号密码
* @return static
*/
- public function make(string $username, string $password)
+ public function setAuth(string $username, string $password)
{
$this->username = $username;
$this->password = $password;