ComposerUpdate

This commit is contained in:
Anyon 2020-09-26 12:18:36 +08:00
parent 1f8cfd2743
commit 41d8aee2e9
8 changed files with 37 additions and 11 deletions

View File

@ -82,6 +82,9 @@
layer.close(value), delete layers[index];
});
});
$(window).on('hashchange', function () {
$('.layui-body').trigger('click');
});
})([]);
</script>
{/block}

View File

@ -56,7 +56,7 @@ class Fans extends Command
$message .= $this->$method();
}
}
$this->setQueueSuccess($message);
$this->queue->success($message);
}
/**

View File

@ -963,12 +963,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "08ab65c4044435fda2db2484bd3a92ead39ffaa4"
"reference": "29a8fb78d72450b961b5204e33c4efe2b3bbe907"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/08ab65c4044435fda2db2484bd3a92ead39ffaa4",
"reference": "08ab65c4044435fda2db2484bd3a92ead39ffaa4",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/29a8fb78d72450b961b5204e33c4efe2b3bbe907",
"reference": "29a8fb78d72450b961b5204e33c4efe2b3bbe907",
"shasum": "",
"mirrors": [
{
@ -985,7 +985,7 @@
"ext-mbstring": "*",
"topthink/framework": "^6.0"
},
"time": "2020-09-24T08:51:05+00:00",
"time": "2020-09-26T03:41:34+00:00",
"type": "library",
"extra": {
"think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2020-09-25 23:42:07
// This file is automatically generated at:2020-09-26 12:12:31
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',

View File

@ -92,7 +92,7 @@ abstract class Command extends ThinkCommand
protected function setQueueError(string $message): Command
{
if (defined('WorkQueueCode')) {
throw new Exception($message, 4, WorkQueueCode);
$this->queue->error($message);
} elseif (is_string($message)) {
$this->output->writeln($message);
}
@ -108,7 +108,7 @@ abstract class Command extends ThinkCommand
protected function setQueueSuccess(string $message): Command
{
if (defined('WorkQueueCode')) {
throw new Exception($message, 3, WorkQueueCode);
$this->queue->success($message);
} elseif (is_string($message)) {
$this->output->writeln($message);
}

View File

@ -93,7 +93,7 @@ abstract class Queue
*/
protected function setQueueSuccess(string $message): void
{
throw new Exception($message, 3, $this->queue->code);
$this->queue->success($message);
}
/**
@ -103,6 +103,6 @@ abstract class Queue
*/
protected function setQueueError(string $message): void
{
throw new Exception($message, 4, $this->queue->code);
$this->queue->error($message);
}
}

View File

@ -67,6 +67,7 @@ class Database extends Command
$this->queue->message($total, ++$used, "正在修复数据表 {$table}");
$this->app->db->query("REPAIR TABLE `{$table}`");
}
$this->queue->success("已完成对 {$total} 张数据表修复操作");
}
/**
@ -85,6 +86,7 @@ class Database extends Command
$this->queue->message($total, ++$used, "正在优化数据表 {$table}");
$this->app->db->query("OPTIMIZE TABLE `{$table}`");
}
$this->queue->success("已完成对 {$total} 张数据优化复操作");
}
/**

View File

@ -17,6 +17,7 @@ declare (strict_types=1);
namespace think\admin\service;
use think\admin\Exception;
use think\admin\extend\CodeExtend;
use think\admin\Service;
@ -195,7 +196,7 @@ class QueueService extends Service
}
/**
* 生成进度前缀数据
* 更新任务进度
* @param integer $total 记录总和
* @param integer $used 当前记录
* @param string $message 文字描述
@ -212,6 +213,26 @@ class QueueService extends Service
}
}
/**
* 任务执行成功
* @param string $message 消息内容
* @throws Exception
*/
public function success(string $message): void
{
throw new Exception($message, 3, $this->code);
}
/**
* 任务执行失败
* @param string $message 消息内容
* @throws Exception
*/
public function error(string $message): void
{
throw new Exception($message, 4, $this->code);
}
/**
* 执行任务处理
* @param array $data 任务参数