Browse Source

ComposerUpdate

邹景立 5 years ago
parent
commit
1ef99e4d80

+ 9 - 1
app/wechat/controller/Fans.php

@@ -17,6 +17,7 @@ namespace app\wechat\controller;
 
 use app\wechat\service\WechatService;
 use think\admin\Controller;
+use think\admin\Exception;
 use think\exception\HttpResponseException;
 
 /**
@@ -75,6 +76,13 @@ class Fans extends Controller
             $this->success('创建任务成功,请等待完成!', $code);
         } catch (HttpResponseException $exception) {
             throw $exception;
+        } catch (Exception $exception) {
+            $queue = $exception->getData();
+            if (isset($queue['code'])) {
+                $this->success('任务已经存在,无需再次创建!', $queue['code']);
+            } else {
+                $this->error($exception->getMessage());
+            }
         } catch (\Exception $exception) {
             $this->error("创建任务失败,{$exception->getMessage()}");
         }
@@ -96,7 +104,7 @@ class Fans extends Controller
         } catch (HttpResponseException $exception) {
             throw  $exception;
         } catch (\Exception $e) {
-            $this->error("拉入黑名单失败,请稍候再试!{$e->getMessage()}");
+            $this->error("拉入黑名单失败,请稍候再试!<br>{$e->getMessage()}");
         }
     }
 

+ 4 - 4
composer.lock

@@ -909,12 +909,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/zoujingli/ThinkLibrary.git",
-                "reference": "3283e44ab0cce56c4054623497ff4f4fec195374"
+                "reference": "54d332d3a8bd5771dc8f84d052338b1191f260b7"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3283e44ab0cce56c4054623497ff4f4fec195374",
-                "reference": "3283e44ab0cce56c4054623497ff4f4fec195374",
+                "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54d332d3a8bd5771dc8f84d052338b1191f260b7",
+                "reference": "54d332d3a8bd5771dc8f84d052338b1191f260b7",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -958,7 +958,7 @@
             ],
             "description": "ThinkPHP v6.0 Development Library",
             "homepage": "http://framework.thinkadmin.top",
-            "time": "2020-03-22T13:13:51+00:00"
+            "time": "2020-03-22T14:10:23+00:00"
         },
         {
             "name": "zoujingli/wechat-developer",

+ 5 - 6
public/static/admin.js

@@ -741,7 +741,6 @@ $(function () {
         if (this.action.length < 1) return $.msg.tips('任务地址不能为空!');
         $.form.load(this.action, {}, 'post', function (ret) {
             if (typeof ret.data === 'string' && ret.data.indexOf('Q') === 0) {
-                $.msg.tips(ret.msg);
                 return $.loadQueue(ret.data), false;
             }
         });
@@ -756,7 +755,7 @@ $(function () {
                 '   <div class="margin-top-15 layui-progress layui-progress-big" lay-showPercent="yes">' +
                 '       <div class="layui-progress-bar" lay-percent="0.00%"></div>' +
                 '   </div>' +
-                '   <textarea class="margin-top-15 layui-textarea transition color-text" disabled style="resize:none"></textarea>' +
+                '   <textarea class="margin-top-15 layui-textarea transition color-text" disabled style="resize:none;min-height:190px"></textarea>' +
                 '</div>'
         });
         (function loadprocess(code, $box) {
@@ -770,7 +769,7 @@ $(function () {
                             this.lines.push('[ ' + lines[this.i].progress + '% ] ' + lines[this.i].message);
                         }
                         this.$textarea = $box.find('textarea').val(this.lines.join("\n"));
-                        this.$textarea.animate({scrollTop: this.$textarea[0].scrollHeight + 'px'}, 800)
+                        this.$textarea.animate({scrollTop: this.$textarea[0].scrollHeight + 'px'}, 100)
                     })(ret.data.history);
                     $box.find('.layui-progress div').attr('lay-percent', ret.data.progress + '%');
                     $box.find('[data-message-title]').html(ret.data.message);
@@ -787,10 +786,10 @@ $(function () {
                         $box.find('[data-message-state]').html('处理状态:<b class="color-red">任务处理失败</b>');
                         return false;
                     }
+                    return setTimeout(function () {
+                        loadprocess(code);
+                    }, 200), false;
                 }
-                return setTimeout(function () {
-                    loadprocess(code);
-                }, 1000), false;
             }, false);
         })(code)
     };

+ 4 - 4
vendor/composer/installed.json

@@ -935,12 +935,12 @@
         "source": {
             "type": "git",
             "url": "https://github.com/zoujingli/ThinkLibrary.git",
-            "reference": "3283e44ab0cce56c4054623497ff4f4fec195374"
+            "reference": "54d332d3a8bd5771dc8f84d052338b1191f260b7"
         },
         "dist": {
             "type": "zip",
-            "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3283e44ab0cce56c4054623497ff4f4fec195374",
-            "reference": "3283e44ab0cce56c4054623497ff4f4fec195374",
+            "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54d332d3a8bd5771dc8f84d052338b1191f260b7",
+            "reference": "54d332d3a8bd5771dc8f84d052338b1191f260b7",
             "shasum": "",
             "mirrors": [
                 {
@@ -956,7 +956,7 @@
             "ext-json": "*",
             "topthink/framework": "^6.0"
         },
-        "time": "2020-03-22T13:13:51+00:00",
+        "time": "2020-03-22T14:10:23+00:00",
         "type": "library",
         "extra": {
             "think": {

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2020-03-22 21:37:43
+// This file is automatically generated at:2020-03-22 22:15:13
 declare (strict_types = 1);
 return array (
   0 => 'think\\app\\Service',

+ 20 - 2
vendor/zoujingli/think-library/src/Exception.php

@@ -24,7 +24,7 @@ class Exception extends \Exception
 {
     /**
      * 异常数据对象
-     * @var array
+     * @var mixed
      */
     protected $data = [];
 
@@ -32,7 +32,7 @@ class Exception extends \Exception
      * Exception constructor.
      * @param string $message
      * @param integer $code
-     * @param array $data
+     * @param array|mixed $data
      */
     public function __construct($message = "", $code = 0, $data = [])
     {
@@ -42,4 +42,22 @@ class Exception extends \Exception
         parent::__construct($message, $code);
     }
 
+    /**
+     * 设置异常停止数据
+     * @param mixed $data
+     */
+    public function setData($data)
+    {
+        $this->data = $data;
+    }
+
+    /**
+     * 获取异常停止数据
+     * @return mixed
+     */
+    public function getData()
+    {
+        return $this->data;
+    }
+
 }