瀏覽代碼

ComposerUpdate & 代码优化

邹景立 3 年之前
父節點
當前提交
435de923ee

+ 4 - 4
vendor/composer/installed.json

@@ -853,12 +853,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/zoujingli/ThinkLibrary.git",
-                "reference": "611043ad1974ab0926868bb44b1b2491fee13114"
+                "reference": "f65e5f33f582df4575a34d1f1c058ca413fb17d6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/611043ad1974ab0926868bb44b1b2491fee13114",
-                "reference": "611043ad1974ab0926868bb44b1b2491fee13114",
+                "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/f65e5f33f582df4575a34d1f1c058ca413fb17d6",
+                "reference": "f65e5f33f582df4575a34d1f1c058ca413fb17d6",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -875,7 +875,7 @@
                 "ext-mbstring": "*",
                 "topthink/framework": "^6.0"
             },
-            "time": "2021-06-22T07:23:58+00:00",
+            "time": "2021-06-22T08:50:44+00:00",
             "default-branch": true,
             "type": "library",
             "extra": {

+ 3 - 3
vendor/composer/installed.php

@@ -5,7 +5,7 @@
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
-        'reference' => '9b4e299239c063b71f431d974c0754fadb9a6624',
+        'reference' => 'bec782fd37e6ce3da4682b02ccd87e42b7e292d5',
         'name' => 'zoujingli/thinkadmin',
         'dev' => false,
     ),
@@ -144,7 +144,7 @@
             'aliases' => array(
                 0 => '9999999-dev',
             ),
-            'reference' => '611043ad1974ab0926868bb44b1b2491fee13114',
+            'reference' => 'f65e5f33f582df4575a34d1f1c058ca413fb17d6',
             'dev_requirement' => false,
         ),
         'zoujingli/thinkadmin' => array(
@@ -153,7 +153,7 @@
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
-            'reference' => '9b4e299239c063b71f431d974c0754fadb9a6624',
+            'reference' => 'bec782fd37e6ce3da4682b02ccd87e42b7e292d5',
             'dev_requirement' => false,
         ),
         'zoujingli/wechat-developer' => array(

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2021-06-22 15:29:50
+// This file is automatically generated at:2021-06-22 16:51:18
 declare (strict_types = 1);
 return array (
   0 => 'think\\admin\\Library',

+ 2 - 2
vendor/zoujingli/think-library/src/command/Install.php

@@ -107,11 +107,11 @@ class Install extends Command
                 $this->rules = array_merge($this->rules, $bind['rules']);
                 $this->ignore = array_merge($this->ignore, $bind['ignore']);
             }
-            [$this->installFile(), $this->installData()];
+            $this->installFile() && $this->installData();
         } elseif (isset($this->bind[$this->name])) {
             $this->rules = $this->bind[$this->name]['rules'] ?? [];
             $this->ignore = $this->bind[$this->name]['ignore'] ?? [];
-            [$this->installFile(), $this->installData()];
+            $this->installFile() && $this->installData();
         } else {
             $this->output->writeln("The specified module {$this->name} is not configured with install rules");
         }

+ 1 - 0
vendor/zoujingli/think-library/src/common.php

@@ -273,6 +273,7 @@ if (!function_exists('data_save')) {
      * @throws DataNotFoundException
      * @throws DbException
      * @throws ModelNotFoundException
+     * @throws \think\admin\Exception
      */
     function data_save($dbQuery, array $data, string $key = 'id', array $where = [])
     {

+ 3 - 3
vendor/zoujingli/think-library/src/service/CaptchaService.php

@@ -40,7 +40,7 @@ class CaptchaService extends Service
      * @param array $config
      * @return static
      */
-    public function initialize(array $config = [])
+    public function initialize(array $config = []): CaptchaService
     {
         // 动态配置属性
         foreach ($config as $k => $v) if (isset($this->$k)) $this->$k = $v;
@@ -64,7 +64,7 @@ class CaptchaService extends Service
      * @param array $config
      * @return $this
      */
-    public function config(array $config = [])
+    public function config(array $config = []): CaptchaService
     {
         return $this->initialize($config);
     }
@@ -140,7 +140,7 @@ class CaptchaService extends Service
      * 创建验证码图片
      * @return string
      */
-    private function createImage()
+    private function createImage(): string
     {
         // 生成背景
         $img = imagecreatetruecolor($this->width, $this->height);

+ 4 - 3
vendor/zoujingli/think-library/src/service/SystemService.php

@@ -115,12 +115,13 @@ class SystemService extends Service
      * @throws DataNotFoundException
      * @throws DbException
      * @throws ModelNotFoundException
+     * @throws \think\admin\Exception
      */
     public function save($query, array $data, string $key = 'id', array $map = [])
     {
-        if ($query instanceof Model) $query = $query->db();
-        if (is_string($query)) $query = $this->app->db->name($query);
-        [$query, $value] = [$query->master()->strict(false)->where($map), $data[$key] ?? null];
+        $query = is_string($query) ? $this->app->db->name($query) : ($query instanceof Model ? $query->db() : $query);
+        if (!$query instanceof Query) throw new \think\admin\Exception('数据库操作对象异常!');
+        [$value] = [$data[$key] ?? null, $query->master()->strict(false)->where($map)];
         if (empty($map[$key])) if (is_string($value) && strpos($value, ',') !== false) {
             $query->whereIn($key, str2arr($value));
         } else {