diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index fb4d0eae6..9032b42c9 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index 20ba70706..1a4a52833 100644 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 3eea6fb67..6e169677a 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index 5e8e97f8e..30331ef0c 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 8e4a26b04..f5127894b 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -144,6 +144,10 @@ class Index extends Controller } if ($user->save(['password' => md5($data['password'])])) { sysoplog('系统用户管理', "修改用户[{$user['id']}]密码成功"); + // 修改密码同步事件处理 + $this->app->event->trigger('PluginAdminChangePassword', [ + 'uuid' => intval($user['id']), 'pass' => $data['password'] + ]); $this->success('密码修改成功,下次请使用新密码登录!', ''); } else { $this->error('密码修改失败,请稍候再试!'); diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index 04ae0c239..2155d233d 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; @@ -45,11 +47,11 @@ class Login extends Controller } else { // 加载登录模板 $this->title = '系统登录'; - // 当前运行模式 - $this->runtimeMode = RuntimeService::check(); // 登录验证令牌 $this->captchaType = 'LoginCaptcha'; $this->captchaToken = CodeExtend::uuid(); + // 当前运行模式 + $this->runtimeMode = RuntimeService::check(); // 后台背景处理 $images = str2arr(sysconf('login_image|raw') ?: '', '|'); if (empty($images)) $images = [ diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index 68a3063bd..90ba46cf0 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; diff --git a/app/admin/controller/Oplog.php b/app/admin/controller/Oplog.php index d398c4d98..60f74d241 100644 --- a/app/admin/controller/Oplog.php +++ b/app/admin/controller/Oplog.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use Ip2Region; diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index d87b7e94d..59dab18ce 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller; use think\admin\Controller; @@ -85,7 +87,7 @@ class Queue extends Controller try { $data = $this->_vali(['code.require' => '任务编号不能为空!']); $queue = QueueService::instance()->initialize($data['code'])->reset(); - $queue->progress(1, '>>> 任务重置成功 <<<', 0.00); + $queue->progress(1, '>>> 任务重置成功 <<<', '0.00'); $this->success('任务重置成功!', $queue->code); } catch (HttpResponseException $exception) { throw $exception; diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 189b2a4bc..527ec06af 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -98,6 +98,10 @@ class User extends Controller ]); $user = SystemUser::mk()->findOrEmpty($data['id']); if ($user->isExists() && $user->save(['password' => md5($data['password'])])) { + // 修改密码同步事件处理 + $this->app->event->trigger('PluginAdminChangePassword', [ + 'uuid' => $data['id'], 'pass' => $data['password'] + ]); sysoplog('系统用户管理', "修改用户[{$data['id']}]密码成功"); $this->success('密码修改成功,请使用新密码登录!', ''); } else { diff --git a/app/admin/controller/api/Plugs.php b/app/admin/controller/api/Plugs.php index 5c70df522..6b6199acb 100644 --- a/app/admin/controller/api/Plugs.php +++ b/app/admin/controller/api/Plugs.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller\api; use think\admin\Controller; diff --git a/app/admin/controller/api/Queue.php b/app/admin/controller/api/Queue.php index 012c0e207..ee757c43d 100644 --- a/app/admin/controller/api/Queue.php +++ b/app/admin/controller/api/Queue.php @@ -14,13 +14,14 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller\api; use Psr\Log\NullLogger; use think\admin\Controller; use think\admin\model\SystemQueue; use think\admin\service\AdminService; -use think\admin\service\QueueService; use think\exception\HttpResponseException; /** diff --git a/app/admin/controller/api/System.php b/app/admin/controller/api/System.php index cbfce49d7..c9b8002f6 100644 --- a/app/admin/controller/api/System.php +++ b/app/admin/controller/api/System.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller\api; use think\admin\Controller; diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index 2b879ae05..26b6234d4 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -14,6 +14,8 @@ // | github 代码仓库:https://github.com/zoujingli/think-plugs-admin // +---------------------------------------------------------------------- +declare(strict_types=1); + namespace app\admin\controller\api; use think\admin\Controller; @@ -145,7 +147,7 @@ class Upload extends Controller $alist = AlistStorage::instance(); $data['url'] = $alist->url($data['key']); $data['server'] = $alist->upload(); - $data['filepath'] = $alist->real($data['key'], true); + $data['filepath'] = $alist->real($data['key']); $data['authorization'] = $alist->token(); } else { $this->error('未知的存储引擎!'); diff --git a/app/admin/view/api/upload.js b/app/admin/view/api/upload.js index 7dddde0d2..edf247b8d 100644 --- a/app/admin/view/api/upload.js +++ b/app/admin/view/api/upload.js @@ -20,9 +20,11 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) { this.option.cutHeight = parseInt(this.option.elem.data('cut-height') || '0'); /*! 查找表单元素, 如果没有找到将不会自动写值 */ - if (!this.option.elem.data('input') && this.option.elem.data('field')) { - this.$input = $('input[name="' + this.option.elem.data('field') + '"]:not([type=file])'); - this.option.elem.data('input', this.$input.size() > 0 ? this.$input.get(0) : null); + if (this.option.elem.data('input')) { + this.option.input = $(this.option.elem.data('input')) + } else if (this.option.elem.data('field')) { + this.option.input = $('input[name="' + this.option.elem.data('field') + '"]:not([type=file])'); + this.option.elem.data('input', this.option.input.size() > 0 ? this.option.input.get(0) : null); } /*! 文件选择筛选,使用 MIME 规则过滤文件列表 */ @@ -188,7 +190,7 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) { }); } else if (parseInt(ret.code) === 200) { (file.xurl = ret.data.url), that.progress('100.00', file); - that.done({code: 1, url: file.xurl, info: file.xstats, data: {code:200,url: file.xurl}}, file.index, file, done, '{:lang("文件秒传成功!")}'); + that.done({code: 1, url: file.xurl, info: file.xstats, data: {code: 200, url: file.xurl}}, file.index, file, done, '{:lang("文件秒传成功!")}'); } else { that.event('upload.error', {file: file}, file, ret.info || ret.error.message || '{:lang("文件上传出错!")}'); } @@ -240,6 +242,7 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) { } if (this.option.elem) { this.option.elem.triggerHandler(name, data); + if (this.option.input) this.option.input.triggerHandler(name, data); } return this; }; diff --git a/app/admin/view/auth/apply.html b/app/admin/view/auth/apply.html deleted file mode 100644 index 16bd2c5c4..000000000 --- a/app/admin/view/auth/apply.html +++ /dev/null @@ -1,123 +0,0 @@ -{extend name='main'} - -{block name="content"} -
类型为“文件哈希”时可以实现文件秒传功能,同一个文件只需上传一次节省存储空间,推荐使用。
类型为“简洁链接”时链接将只返回 hash 地址,而“完整链接”将携带参数保留文件名,图片压缩功能云平台会单独收费。
阿里云OSS存储访问协议,其中 HTTPS 需要配置证书才能使用(AUTO 为相对协议)
填写阿里云OSS存储外部访问域名,如:static.alioss.thinkadmin.top
+填写阿里云OSS存储外部访问域名,不需要填写访问协议,如:static.alioss.thinkadmin.top
文件将上传到 Alist 自建存储,需要自行搭建 Alist 存储服务器。
Alist 是一个支持多种存储的文件列表程序,可将各种云盘及本地磁盘资源进行整合。
-请使用 Alist v3 版本,建议不要开放匿名用户访问,尽量使用账号独立管理访问目录权限。
+建议不要开放匿名用户访问,尽量使用独立账号管理,需要关闭 “签名所有” 让文件可以直接访问。
请选择 Alist 存储访问协议,其中 HTTPS 需要配置证书才能使用( AUTO 为相对协议 )
请填写 Alist 存储访问域名,如:storage.thinkadmin.top
+请填写 Alist 存储访问域名,不需要填写访问协议,如:storage.thinkadmin.top
本地存储访问协议,其中 HTTPS 需要配置证书才能使用( FOLLOW 跟随系统,PATH 文件路径,AUTO 相对协议 )
填写上传后的访问域名(不指定时根据当前访问地址自动计算),如:static.thinkadmin.top
+填写上传后的访问域名(不指定时根据当前访问地址自动计算),不需要填写访问协议,如:static.thinkadmin.top
七牛云存储访问协议,其中 HTTPS 需要配置证书才能使用( AUTO 为相对协议 )
填写七牛云存储访问域名,如:static.qiniu.thinkadmin.top
+填写七牛云存储访问域名,不需要填写访问协议,如:static.qiniu.thinkadmin.top
填写腾讯云COS存储外部访问域名,如:static.txcos.thinkadmin.top
+填写腾讯云COS存储外部访问域名,不需要填写访问协议,如:static.txcos.thinkadmin.top
又拍云存储访问协议,其中 HTTPS 需要配置证书才能使用(AUTO 为相对协议)
填写又拍云存储外部访问域名,如:static.uss.thinkadmin.top
+填写又拍云存储外部访问域名,不需要填写访问协议,如:static.uss.thinkadmin.top