diff --git a/app/admin/controller/Addons.php b/app/admin/controller/Addons.php index e6a1e35..f188fea 100644 --- a/app/admin/controller/Addons.php +++ b/app/admin/controller/Addons.php @@ -3,6 +3,7 @@ namespace app\admin\controller; use app\common\controller\AdminController; use app\common\lib\SqlFile; +use think\Exception; use think\facade\View; use think\facade\Request; use think\facade\Config; @@ -302,28 +303,25 @@ class Addons extends AdminController return json(['code' => 0, 'msg' => '插件卸载成功']); } - - //启用插件 - public function start() - { - $name = input('name'); - $arr = ['status' => 1]; - //$res = get_addons_info($name); - //$res = get_addons_instance($name); - $res = set_addons_info($name,$arr); - return json(['code'=>0,'msg'=>$name.'插件已启用']); - - } - - //暂停插件 - public function shutDown() - { - $name = input('name'); - $arr = ['status' => 0]; - $res = set_addons_info($name,$arr); - return json(['code'=>-1,'msg'=>$name.'插件已禁用']); - - } + + // 启用禁用插件 + public function status(){ + $name = input('name'); + $info = get_addons_info($name); + try{ + $arr = ['status' => $info['status'] ? 0 :1]; + set_addons_info($name,$arr); + if($arr['status']) { + $res = ['code'=>0,'msg'=>'启用成功']; + } else { + $res = ['code'=>0,'msg'=>'已被禁用']; + } + } catch (\Exception $e) { + throw new Exception($e->getMessage()); + } + + return json($res); + } //配置插件 public function config($name) diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php index b3ed64d..5d19337 100644 --- a/app/admin/controller/Menu.php +++ b/app/admin/controller/Menu.php @@ -2,10 +2,59 @@ namespace app\admin\controller; use app\common\controller\AdminController; +use think\facade\Db; class Menu extends AdminController { public function index(){ return view(); } + + + /** + * 动态菜单并排序 + * @return \think\response\Json + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getMenuNavbar() + { + $pid = empty(input('id')) ? 0 : input('id'); + $data = Db::name('auth_rule')->field('id,title,icon,name,sort')->where(['delete_time'=> 0,'status'=> 1,'ismenu'=>1,'pid'=>$pid])->select(); + $tree = []; + foreach ($data as $k => $v) { + $hasChild = $this->hasChildren($v['id']); + if($hasChild) { + $v['hasChildren'] = 1; + } else { + $v['hasChildren'] = 0; + } + $tree[] = ['id'=>$v['id'],'text'=>$v['title'],'icon'=>$v['icon'],'hasChildren'=>$v['hasChildren'],'href'=>(string) url($v['name']),'sort'=>$v['sort']]; + } + // 排序 + $cmf_arr = array_column($tree, 'sort'); + array_multisort($cmf_arr, SORT_ASC, $tree); + + return json($tree); + } + + /** + * 是否有子菜单 + * @param $pid + * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function hasChildren($pid) + { + $data = Db::name('auth_rule')->field('pid')->where(['delete_time'=> 0,'status'=> 1,'ismenu'=>1,'pid'=>$pid])->select()->toArray(); + if(count($data)) { + return true; + } else { + return false; + } + + } } \ No newline at end of file diff --git a/app/admin/controller/Upgrade.php b/app/admin/controller/Upgrade.php index 0a508a1..a65dd4d 100644 --- a/app/admin/controller/Upgrade.php +++ b/app/admin/controller/Upgrade.php @@ -160,10 +160,7 @@ class Upgrade extends AdminController } //把远程文件放入本地 - - //拼接路径 - //$upload_dir = substr($this->upload_dir,-1) == '/' ? $this->upload_dir : $this->upload_dir.'/'; - $upload_dir = Files::getDirPath($this->upload_dir); + $upload_dir = Files::getDirPath($this->upload_dir); //拼接路径 Files::mkdirs($upload_dir); $package_file = $upload_dir.'taoler_'.$version_num.'.zip'; //升级的压缩包文件 @@ -211,15 +208,12 @@ class Upgrade extends AdminController //清理缓存 $this->clearSysCache(); - - //更新版本 - //Db::name('system')->update(['sys_version_num'=>$version_num,'id'=>1]); $value = [ 'version' => $version_num ]; $res = SetArr::name('taoler')->edit($value); - if($res == false){ + if(!$res){ return json(['code'=>-1,'msg'=>'代码更新成功,但版本写入失败']); } @@ -227,9 +221,11 @@ class Upgrade extends AdminController } - /**升级执行 + /** + * 升级执行 * @param string $package_file * @return \think\response\Json + * @throws \Exception */ private function execute_update(string $package_file) { @@ -246,7 +242,16 @@ class Upgrade extends AdminController //$package_name = str_replace('.zip','',$package_file); Log::channel('update')->info('update:{type} {progress} {msg}',['type'=>'success','progress'=>'50%','msg'=>'升级文件解压成功!']); - + + //升级sql操作 + $upSql = $zipPath.'runtime/update.sql'; + if(file_exists($upSql)) { + SqlFile::dbExecute($upSql); + //删除sql语句 + unlink($upSql); + } + + //升级PHP if(is_dir($zipPath)) { //升级前的写入文件权限检查 @@ -288,13 +293,7 @@ class Upgrade extends AdminController } - //升级sql操作 - $upSql = $zipPath.'runtime/update.sql'; - if(file_exists($upSql)) { - SqlFile::dbExecute($upSql); - //删除sql语句 - unlink($upSql); - } + Log::channel('update')->info('update:{type} {progress} {msg}',['type'=>'success','progress'=>'100%','msg'=>'升级成功!']); //更新系统的版本号了 diff --git a/app/admin/view/addons/index.html b/app/admin/view/addons/index.html index 5edaafd..a59796c 100644 --- a/app/admin/view/addons/index.html +++ b/app/admin/view/addons/index.html @@ -15,12 +15,13 @@ +
- - + @@ -56,25 +55,21 @@ {/block} {block name="js"} + {/block} diff --git a/app/admin/view/public/base.html b/app/admin/view/public/base.html index d02e4ce..33eba6f 100644 --- a/app/admin/view/public/base.html +++ b/app/admin/view/public/base.html @@ -25,8 +25,8 @@ {block name="js"}js文件{/block} diff --git a/app/admin/view/public/side_menu.html b/app/admin/view/public/side_menu.html index 610c196..8d9bfd9 100644 --- a/app/admin/view/public/side_menu.html +++ b/app/admin/view/public/side_menu.html @@ -1,92 +1,83 @@ -
-
- - - +
+
- - - \ No newline at end of file diff --git a/app/common.php b/app/common.php index b9ca2bc..43a59a6 100644 --- a/app/common.php +++ b/app/common.php @@ -308,7 +308,6 @@ function find_spider(){ } if (!function_exists('__')) { - /** * 获取语言变量值 * @param string $name 语言变量名 diff --git a/app/common/controller/AdminController.php b/app/common/controller/AdminController.php index 7f3ecc1..2b7d479 100644 --- a/app/common/controller/AdminController.php +++ b/app/common/controller/AdminController.php @@ -30,8 +30,6 @@ class AdminController extends \app\BaseController { //权限auth检查 $this->aid = Session::get('admin_id'); - //$this->checkAuth(); - $this->getMenu(); //系统配置 $this->getIndexUrl(); } @@ -63,8 +61,7 @@ class AdminController extends \app\BaseController } } - $menu = !empty($menu) ? getTree($menu) : []; - View::assign('menu', $menu); + return !empty($menu) ? getTree($menu) : []; } /** @@ -80,10 +77,7 @@ class AdminController extends \app\BaseController foreach ($auth_rule_list as $value) { $menu[] = $value; } - $menus = !empty($menu) ? getTree($menu) : []; - //$menu2 = getTree($menu); - return $menus; - //return View::assign('menus', $menus); + return !empty($menu) ? getTree($menu) : []; } //清除缓存Cache diff --git a/composer.lock b/composer.lock index a1e0266..34273bd 100644 --- a/composer.lock +++ b/composer.lock @@ -1413,16 +1413,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.4", + "version": "v6.6.5", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", "shasum": "" }, "require": { @@ -1446,8 +1446,8 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { @@ -1479,7 +1479,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" }, "funding": [ { @@ -1487,7 +1487,7 @@ "type": "github" } ], - "time": "2022-08-22T09:22:00+00:00" + "time": "2022-10-07T12:23:10+00:00" }, { "name": "psr/cache", @@ -3073,16 +3073,16 @@ }, { "name": "workerman/workerman", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/walkor/workerman.git", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9" + "reference": "83e007acf936e2233ac92d7368b87716f2bae338" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/01028d8008c5691ec38c5f675fc13d76496a6db9", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9", + "url": "https://api.github.com/repos/walkor/workerman/zipball/83e007acf936e2233ac92d7368b87716f2bae338", + "reference": "83e007acf936e2233ac92d7368b87716f2bae338", "shasum": "" }, "require": { @@ -3132,7 +3132,7 @@ "type": "patreon" } ], - "time": "2022-09-23T14:05:12+00:00" + "time": "2022-10-09T11:33:14+00:00" }, { "name": "yansongda/pay", diff --git a/config/taoler.php b/config/taoler.php index 2a1ffd6..2804127 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -16,7 +16,7 @@ return [ // 应用名,此项不可更改 'appname' => 'TaoLer', // 版本配置 - 'version' => '2.0.0', + 'version' => '2.0.2', // 加盐 'salt' => 'taoler', // 数据库备份目录 diff --git a/public/static/admin/modules/addons.js b/public/static/admin/modules/addons.js index 21363fc..be4fd74 100644 --- a/public/static/admin/modules/addons.js +++ b/public/static/admin/modules/addons.js @@ -1,10 +1,11 @@ //网站app版本发布 -layui.define(["table", "form", "upload"], function (exports) { +layui.define(["table", "form", "upload","notify","hxNav"], function (exports) { var $ = layui.jquery, table = layui.table, form = layui.form, upload = layui.upload; + var notify = layui.notify; function addList(type) { $.ajax({ @@ -44,58 +45,143 @@ layui.define(["table", "form", "upload"], function (exports) { } }); - - //监听工具条 table.on("tool(addons-list)", function (obj) { var data = obj.data; + var event = obj.event; + var url = $(this).data('url') - if (obj.event === "del") { - layer.prompt( - { - formType: 1, - title: "敏感操作,请验证口令", - }, - function (value, index) { - layer.close(index); - layer.confirm("真的删除行么", function (index) { - $.post(addonsDelete, { name: data.name }, function (res) { - if (res.code == 0) { - layer.msg(res.msg, { icon: 6, time: 2000 }); - } else { - layer.open({ - tiele: "修改失败", - content: res.msg, - icon: 5, - anim: 6, - }); - } - }); - - table.reload("addons-list"); - layer.close(index); - }); + //安装插件 + if (event === "install") { + var index = layer.load(1); + $.post(url, { name: data.name, version: data.version }, function (res) { + if (res.code == 0) { + notify.success(res.msg, "topRight"); + } else { + notify.error(res.msg, "topRight"); } - ); - } else if (obj.event === "edit") { - var tr = $(obj.tr); + layer.close(index); + }); + } + + // 启用禁用 + if(event == 'status') { + notify.confirm("确认框", "vcenter", function(){ + $.post(url,{ name: data.name },function(res){ + if (res.code == 0) { + notify.success(res.msg, "topRight"); + } else { + notify.error(res.msg, "topRight"); + } + table.reloadData("addons-list",{},'deep'); + // addList("installed"); + }); + + }); + + + } + + // 卸载插件 + if (event === "uninstall") { + notify.confirm("确认框", "vcenter",function() { + var index = layer.load(1); + $.post(url, { name: data.name }, function (res) { + if (res.code == 0) { + notify.success(res.msg, "topRight"); + } else { + notify.error(res.msg, "topRight"); + } + }); + table.reload("addons-list"); + layer.close(index); + }); + } + + // 配置插件 + if (event === "config") { layer.open({ type: 2, - title: "编辑插件", - content: addonsEdit + "?id=" + data.id, + title: '配置插件', + content: url + "?name=" + data.name, maxmin: true, - area: ["400px", "620px"], + area: ["780px", "90%"], btn: ["确定", "取消"], yes: function (index, layero) { var iframeWindow = window["layui-layer-iframe" + index], - submitID = "LAY-addons-submit", - submit = layero - .find("iframe") - .contents() - .find("#" + submitID); - + submitID = "LAY-addons-config-submit", + submit = layero.find("iframe").contents().find("#" + submitID); //监听提交 iframeWindow.layui.form.on( + "submit(" + submitID + ")", + function (data) { + var field = data.field; //获取提交的字段 + $.ajax({ + type: "post", + url: addonsConfig, + data: field, + daType: "json", + success: function (res) { + if (res.code == 0) { + notify.success(res.msg, "topRight"); + } else { + notify.error(res.msg, "topRight"); + } + }, + }); + layer.close(index); //关闭弹层 + } + ); + submit.trigger("click"); + }, + success: function (layero, index) { + var forms = layero.find("iframe").contents().find(".layui-form"); + var button = forms.find("button"); + //事件委托 + forms.on("click", "button", function (data) { + var even = this.getAttribute("lay-event"); + var names = this.dataset.name; + if (even == "addInput") { + var html = '
\n' + + '\n' + + '
\n' + + ' \n' + + '
\n' + + '
\n' + + ' \n' + + '
\n' + + '\n' + + '
'; + $(this).parent().parent().append(html); + } else { + $(this).parent().remove(); + } + }); + }, + }); + } + + if (event === "edit") { + var tr = $(obj.tr); + layer.open({ + type: 2, + title: "编辑插件", + content: addonsEdit + "?id=" + data.id, + maxmin: true, + area: ["400px", "620px"], + btn: ["确定", "取消"], + yes: function (index, layero) { + var iframeWindow = window["layui-layer-iframe" + index], + submitID = "LAY-addons-submit", + submit = layero + .find("iframe") + .contents() + .find("#" + submitID); + + //监听提交 + iframeWindow.layui.form.on( "submit(" + submitID + ")", function (data) { var field = data.field; //获取提交的字段 @@ -123,146 +209,14 @@ layui.define(["table", "form", "upload"], function (exports) { table.reload("addons-list"); //数据刷新 layer.close(index); //关闭弹层 } - ); + ); - submit.trigger("click"); - }, - success: function (layero, index) {}, - }); - } else if (obj.event === "start") { - //提交 Ajax 成功后,静态更新表格中的数据 - $.ajax({ - type: "post", - url: addonsStart, - data: { name: data.name }, - daType: "json", - success: function (res) { - if (res.code == 0) { - layer.msg(res.msg, { icon: 6, time: 2000 }); - } else { - layer.open({ - tiele: "修改失败", - content: res.msg, - icon: 5, - anim: 6, - }); - } - }, - }); - } else if (obj.event === "shutdown") { - //提交 Ajax 成功后,静态更新表格中的数据 - $.ajax({ - type: "post", - url: addonsShut, - data: { name: data.name }, - daType: "json", - success: function (res) { - if (res.code == 0) { - layer.msg(res.msg, { icon: 6, time: 2000 }); - } else { - layer.open({ - tiele: "修改失败", - content: res.msg, - icon: 5, - anim: 6, - }); - } - }, - }); - } else if (obj.event === "install") { + submit.trigger("click"); + }, + success: function (layero, index) {}, + }); + } - var index = layer.load(1); - //安装插件 - $.post( - addonsInstall, - { name: data.name, version: data.version }, - function (res) { - if (res.code == 0) { - layer.msg(res.msg, { icon: 6, time: 2000 }); - } else { - layer.open({ - tiele: "修改失败", - content: res.msg, - icon: 5, - anim: 6, - }); - } - layer.close(index); - } - ); - } else if (obj.event === "config") { - layer.open({ - type: 2, - title: "配置插件", - content: addonsConfig + "?name=" + data.name, - maxmin: true, - area: ["780px", "90%"], - btn: ["确定", "取消"], - yes: function (index, layero) { - var iframeWindow = window["layui-layer-iframe" + index], - submitID = "LAY-addons-config-submit", - submit = layero - .find("iframe") - .contents() - .find("#" + submitID); - //监听提交 - iframeWindow.layui.form.on( - "submit(" + submitID + ")", - function (data) { - var field = data.field; //获取提交的字段 - $.ajax({ - type: "post", - url: addonsConfig, - data: field, - daType: "json", - success: function (res) { - if (res.code == 0) { - layer.msg(res.msg, { icon: 6, time: 2000 }); - } else { - layer.open({ - tiele: "修改失败", - content: res.msg, - icon: 5, - anim: 6, - }); - } - }, - }); - layer.close(index); //关闭弹层 - } - ); - submit.trigger("click"); - }, - success: function (layero, index) { - var forms = layero.find("iframe").contents().find(".layui-form"); - var button = forms.find("button"); - //事件委托 - forms.on("click", "button", function (data) { - var even = this.getAttribute("lay-event"); - var names = this.dataset.name; - if (even == "addInput") { - var html = '
\n' + - '\n' + - '
\n' + - ' \n' + - '
\n' + - '
\n' + - ' \n' + - '
\n' + - '\n' + - '
'; - - $(this).parent().parent().append(html); - } else { - $(this).parent().remove(); - } - }); - }, - }); - } - table.reload("addons-list"); //数据刷新 }); exports("addons", {}); diff --git a/public/static/admin/modules/hxNav.js b/public/static/admin/modules/hxNav.js new file mode 100644 index 0000000..41c14e8 --- /dev/null +++ b/public/static/admin/modules/hxNav.js @@ -0,0 +1,117 @@ +/** + * Async Navbar With Ajax + * CopyRight 2020.1 by Hexu + * Interface Like: [{ "id": "ident", "text": "title text", "icon": "icon", "href": "targetUrl.php", "hasChildren": 0 }] + */ +;layui.define(['element','jquery'],function(exports){ + 'use strict'; + var $ = layui.jquery, element = layui.element, navroot = null, nodes=[], methods = { + select: function(id) { + if( nodes[id] ) { + navroot.find('li,dd').removeClass('layui-this'); + nodes[id].addClass('layui-this').parents('li,dd').addClass('layui-nav-itemed'); + opts.onSelect(nodes[id].data('nodeItem')); + } + } + }, internal = { + init: function() { + navroot = $(opts.element).addClass('layui-side layui-side-menu').append('
'); + //.css({'background-color':opts.background, width: opts.width }); + scroll = $(".layui-side-scroll"); + // 默认主页li + var indexLi = '
  • '+ + ''+ + ''+ + '主页'+ + ''+ + '
    '+ + '
    '+ + '控制台'+ + '
    '+ + '
    '+ + '
  • '; + var node = $('').attr('lay-shrink', opts.shrink?'all':'').appendTo( scroll ); + //node.css('width','100%'); + internal.getData(null,node,0); + }, + getData: function(id,node,level){ + id = id || null; + $.ajax({ + url: opts.url, + type: opts.type, + cache: false, + data: { id: id }, + dataType: 'json', + success: function(res) { + $.each(res, function (index, val) { + /** + * @var val.hasChildren + */ + val.hasChildren = ( val.hasChildren && val.hasChildren > 0 ); + var sub = (id === null) ? $('
  • ').appendTo(node) : $('
    ').appendTo(node); + sub.data('nodeItem', val); + nodes[val.id] = sub; + if (val.hasChildren ) { + var aHtml = ''; + } else { + var aHtml = ''; + } + var a = $(aHtml).appendTo(sub); + //a.css('margin-left', level * 12 ); + if (val.icon) { + $('').addClass(val.icon).appendTo(a); + } + $('').text(val.text).appendTo(a); + if (val.hasChildren ) { + $('').appendTo(a); + var dl = $('
    ').appendTo(sub); + if( opts.autoExpand ) { + internal.getData(val.id, dl, level + 1); + val.isExpended = true; + } + } + /** + * @var val.isExpended + */ + a.on('click',function() { + if( val.hasChildren && ( ! val.isExpended )){ + internal.getData(val.id, dl, level + 1 ); + val.isExpended = true; + } + //点击折叠事件 + // methods.select(val.id); + if(val.hasChildren) { + $('.layui-nav-tree').children('li').siblings().removeClass('layui-nav-itemed'); + } else { + $(this).parents('li').siblings().removeClass('layui-nav-itemed'); + } + //console.log(val); + opts.onSelect(val); + }); + }); + element.render('nav','layadmin-system-side-menu'); + } + }); + } + }, opts = {}; + + exports('hxNav',function(opt, params ) { + if( typeof opt === 'string' ) { + if( methods[ opt ] ) + methods[ opt ].call( this, params ); + } + else { + opts = $.extend({ + element: '', + width: 220, + url: '', + type: 'post', + shrink: false, + autoExpand: false, + background: '#393D49', + onSelect: function(node){} + }, opt || {}); + internal.init.call( this ); + } + }); +}); \ No newline at end of file diff --git a/public/static/admin/modules/notify.js b/public/static/admin/modules/notify.js new file mode 100644 index 0000000..b736a1a --- /dev/null +++ b/public/static/admin/modules/notify.js @@ -0,0 +1,461 @@ +/** + *auth: liuyu 4654081@qq.com + *Date: 2022/9/22 + *Desc: layui消息提示插件 + * */ + +layui.define(function (exports) { + "use strict"; + + function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + + !function (global, factory) { + (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, global.notify = factory()); + }(void 0, function () { + "use strict"; + + + function c(args, children) { + var el = document.createElement("div"); + + for (var key in args) { + var element = args[key]; + + if (key == "className") { + key = "class"; + el.setAttribute(key, element); + } else if (key[0] == "_") { + el.addEventListener(key.slice(1), element); + } + } + if (typeof children == "string") { + el.innerHTML = children; + } else if (_typeof(children) == "object" && children.tagName) { + el.appendChild(children); + } else if (children) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; + el.appendChild(child); + } + } + + return el; + } + + function addAnimationEnd(el, fn) { + ["a", "webkitA"].forEach(function (prefix) { + var name = prefix + "nimationEnd"; + el.addEventListener(name, function () { + fn(); + }); + }); + } + + function css(el, css) { + for (var key in css) { + el.style[key] = css[key]; + } + + if (el.getAttribute("style") === "") { + el.removeAttribute("style"); + } + } + + function addClass(el, s) { + var c = el.className || ""; + + if (!hasClass(c, s)) { + var arr = c.split(/\s+/); + arr.push(s); + el.className = arr.join(" "); + } + } + + function hasClass(c, s) { + return c.indexOf(s) > -1 ? !0 : !1; + } + + function removeClass(el, s) { + var c = el.className || ""; + + if (hasClass(c, s)) { + var arr = c.split(/\s+/); + var i = arr.indexOf(s); + arr.splice(i, 1); + el.className = arr.join(" "); + } + + if (el.className === "") { + el.removeAttribute("class"); + } + } + + var initArgs = { + elem:"body", //默认显示在body,可以指定class或id + msg: "", //文字内容 + position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, vcenter + duration: 3000, //默认3秒关闭 + showClose: true, //显示关闭按钮 + shadow:false + }; + var positionB=['bottomLeft','bottomCenter','bottomRight']; + var notify = { + info: function info() { + initConfig(arguments, "info"); + }, + success: function success() { + initConfig(arguments, "success"); + }, + warning: function warning() { + initConfig(arguments, "warning"); + }, + error: function error() { + initConfig(arguments, "error"); + }, + loading: function loading() { + return initConfig(arguments, "loading"); + }, + alert: function loading() { + return initConfig(arguments, "alert"); + }, + confirm: function loading() { + return initConfig(arguments, "confirm"); + }, + destroyAll: function destroyAll() { + _destroyAll(); + }, + config: function config(obj) { + for (var key in obj) { + if (Object.hasOwnProperty.call(obj, key)) { + if (obj[key] !== undefined) { + initArgs[key] = obj[key]; + } + } + } + } + }; + + function initConfig(obj, type) { + var args = {}; + for (var key in initArgs) { + args[key] = initArgs[key]; + } + var posArr = ["bottomRight", "bottomLeft", "topRight", "topLeft", "topCenter", "bottomCenter", "vcenter"]; + for (var i = 0; i < obj.length; i++) { + var it = obj[i]; + + if (it !== undefined) { + if (typeof it == "string" || _typeof(it) === "object") { + if (posArr.indexOf(it) > -1) { + args.position = it; + } else if(it.substring(0,1)=="."||it.substring(0,1)=="#"){ + args.elem=it; + }else if(it=="shadow"){ + args.shadow=true; + }else { + args.msg = it; + } + + } else if (typeof it == "boolean") { + args.showClose = it; + } else if (typeof it == "function") { + args.onClose = it; + } else if (typeof it == "number") { + args.duration = it; + } else if (typeof it == "number") { + args.duration = it; + } + } + } + + args.type = type; + return createMsgEl(args); + } + + var msgWrappers = new Array(); + + function createMsgEl(args) { + var _msgWrapper; + var type = args.type, + elem = args.elem, + duration = args.duration, + msg = args.msg, + position = args.position, + closable = args.showClose, + shadow = args.shadow, + onClose = args.onClose; + var iconObj = getIconObj(); + + if (document.getElementsByClassName(position)[0]) { + _msgWrapper = document.getElementsByClassName(position)[0]; + } else { + _msgWrapper = c({ + className: "notify-msg-stage " + position + }); + msgWrappers.push(_msgWrapper); + } + + if (type === "loading") { + msg = msg === "" ? "正在加载,请稍后" : msg; + closable = false; //loading不显示关闭按钮 + } + + var el,an; + + if(positionB.indexOf(position)!=-1){ + if(type=="alert" || type =="confirm"){ + an="bounceIn"; + }else{ + an="notify-bottom notify-msg-fade-in-b"; + } + el = c({ + className: "notify-msg-wrapper" + }, [c({ + className: "notify-msg " + an + " notify-msg-" + type + }, [c({ + className: "notify-msg-icon" + }, iconObj[type]), c({ + className: "notify-msg-content" + }, msg), c({ + className: "notify-msg-wait " + (closable ? "notify-msg-pointer" : ""), + _click: function _click() { + if (closable) { + closeFlag = true; //点击关闭按钮标志 + flag = false; //正常关闭标志 + closeMsg(el, onClose, _msgWrapper,shadow); + } + } + }, getMsgRight(closable,type))])]); + }else{ + if(type=="alert" || type =="confirm"){ + an="bounceIn"; + }else{ + an="notify-msg-fade-in"; + } + el = c({ + className: "notify-msg-wrapper" + }, [c({ + className: "notify-msg " + an + " notify-msg-" + type + }, [c({ + className: "notify-msg-icon" + }, iconObj[type]), c({ + className: "notify-msg-content" + }, msg), c({ + className: "notify-msg-wait " + (closable ? "notify-msg-pointer" : ""), + _click: function _click() { + if (closable) { + closeFlag = true; //点击关闭按钮标志 + flag = false; //正常关闭标志 + closeMsg(el, onClose, _msgWrapper,shadow); + } + } + }, getMsgRight(closable,type))])]); + } + + var anm = el.querySelector(".notify-msg__circle"); + + if (anm) { + css(anm, { + animation: "notify-msg_" + type + " " + duration + "ms linear" + }); + + if ("onanimationend" in window) { + addAnimationEnd(anm, function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }); + } else { + setTimeout(function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }, duration); + } + } + + if (type != "loading" && type != "alert" && type != "confirm") { + setTimeout(function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }, duration); + } + //遮罩 + if(shadow &&!document.querySelector(".notify-modal")){ + var shadenode=document.createElement("div"); + if(shadow){ + shadenode.className="notify-modal"; + }else{ + shadenode.className="notify-modal notify-none"; + } + + document.querySelector("body").appendChild(shadenode); + } + if (!_msgWrapper.children.length) { + if(elem!=="body"){ + var _pos=getComputedStyle(document.querySelector(elem)).position; + if(_pos=="static"||_pos==""){ + document.querySelector(elem).style.position="relative"; + } + + _msgWrapper.style.position = "absolute"; + }else{ + _msgWrapper.style.position = "fixed"; + } + document.querySelector(elem).appendChild(_msgWrapper); + } + _msgWrapper.appendChild(el); + if(type=="confirm"){ + var btnCancel=document.createElement("button");//''; + var textNode=document.createTextNode("取 消"); + btnCancel.appendChild(textNode); + btnCancel.className="btnCancel"; + btnCancel.onclick=function(){ + closeMsg(el,'', _msgWrapper,shadow); + + } + document.querySelector(".notify-msg-confirm").appendChild(btnCancel); + + } + css(el, { + height: el.offsetHeight + "px" + }); + setTimeout(function () { + if(positionB.indexOf(position)!=-1){ + removeClass(el.children[0], "notify-msg-fade-in-b"); + }else{ + removeClass(el.children[0], "notify-msg-fade-in"); + } + + }, 300); + + if (type == "loading") { + return function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }; + } + + } + + function getMsgRight(showClose,type) { + if (showClose) { + if(type=="alert" || type=="confirm"){ + return "" + }else{ + return "\n \n "; + } + } + } + + var flag = true; //正常关闭标志 + var closeFlag = false;//点击关闭按钮标志 + + function closeMsg(el, cb, _msgWrapper,shadow) { + if (!el) return; + if(hasClass(el.children[0].className,"notify-bottom")){ + addClass(el.children[0], "notify-msg-fade-out-b"); + }else if(hasClass(el.children[0].className,"bounceIn")){ + addClass(el.children[0], "bounceOut"); + }else{ + addClass(el.children[0], "notify-msg-fade-out"); + } + + if(shadow && document.querySelector(".notify-modal")){ + document.querySelector("body").removeChild(document.querySelector(".notify-modal")); + } + + + if (closeFlag) { //点击关闭按钮 + closeFlag = false; + cb && cb(); //回调方法 + } else { + if (flag) {//正常关闭,全局变量 + cb && cb(); + } else { + flag = true + // return; + } + } + + setTimeout(function () { + + if (!el) return; + var has = false; + if (_msgWrapper) { + for (var i = 0; i < _msgWrapper.children.length; i++) { + if (_msgWrapper.children[i] && _msgWrapper.children[i] === el) { + has = true; + } + } + has && removeChild(el); + el = null; + + if (!_msgWrapper.children.length) { + has && removeChild(_msgWrapper); + } + + } + + }, 300); + } + + function getIconObj() { + return { + info: "\n \n ", + success: "\n \n ", + warning: "\n \n ", + error: "\n \n ", + loading: "\n
    \n \n \n \n
    \n " + }; + } + + function removeChild(el) { + el && el.parentNode.removeChild(el); + } + + function _destroyAll() { + for (var j = 0; j < msgWrappers.length; j++) { + for (var i = 0; i < msgWrappers[j].children.length; i++) { + var element = msgWrappers[j].children[i]; + closeMsg(element, '', msgWrappers[j]); + } + } + } + + window.addEventListener('DOMContentLoaded', function () { + insertCssInHead(); + }); + + function insertCssInHead() { + var doc = document; + + if (doc && doc.head) { + var head = doc.head; + + var _css = doc.createElement('style'); + + var cssStr = "\n\n[class|=notify],[class|=notify]::after,[class|=notify]::before{box-sizing:border-box;outline:0}.notify-msg-progress{width:13px;height:13px}.notify-msg__circle{stroke-width:2;stroke-linecap:square;fill:none;transform:rotate(-90deg);transform-origin:center}.notify-msg-stage:hover .notify-msg__circle{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.notify-msg__background{stroke-width:2;fill:none}.notify-msg-stage{position:fixed;width:auto;z-index:99891015}.topLeft{top:20px;left:20px}.topCenter{top:20px;left:50%;transform:translate(-50%,0)}.topRight{top:20px;right:20px}.bottomLeft{bottom:20px;left:20px}.bottomCenter{bottom:20px;left:50%;transform:translate(-50%,0)}.bottomRight{bottom:20px;right:20px}.vcenter{top:50%;left:50%;transform:translate(-50%,-50%)}.notify-msg-wrapper{position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);transition:height .3s ease,padding .3s ease;padding:6px 0;will-change:transform,opacity}.notify-msg{padding:15px 21px;border-radius:3px;position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);display:flex;align-items:center}.notify-msg-content,.notify-msg-icon,.notify-msg-wait{display:inline-block}.notify-msg-icon{position:relative;width:13px;height:13px;border-radius:100%;display:flex;justify-content:center;align-items:center}.notify-msg-icon svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:11px;height:11px}.notify-msg-wait{width:20px;height:20px;position:relative;fill:#4eb127}.notify-msg-wait svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.notify-msg-close{width:14px;height:14px}.notify-msg-content{margin:0 10px;min-width:240px;text-align:left;font-size:14px;font-weight:500;font-family:-apple-system,Microsoft Yahei,sans-serif;text-shadow:0 0 1px rgba(0,0,0,.01)}.notify-msg.notify-msg-info{color:#0c5460;background-color:#d1ecf1;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #bee5eb}.notify-msg.notify-msg-info .notify-msg-icon{background-color:#1d96aa}.notify-msg.notify-msg-success{color:#155724;background-color:#d4edda;box-shadow:0 0 2px 0 rgba(0,1,0,.01),0 0 0 1px #c3e6cb}.notify-msg.notify-msg-success .notify-msg-icon{background-color:#4ebb23}.notify-msg.notify-msg-warning{color:#856404;background-color:#fff3cd;box-shadow:0 0 2px 0 rgba(1,1,0,.01),0 0 0 1px #ffeeba}.notify-msg.notify-msg-warning .notify-msg-icon{background-color:#f1b306}.notify-msg.notify-msg-error{color:#721c24;background-color:#f8d7da;box-shadow:0 0 2px 0 rgba(1,0,0,.01),0 0 0 1px #f5c6cb}.notify-msg.notify-msg-error .notify-msg-icon{background-color:#f34b51}.notify-msg.notify-msg-loading{color:#0fafad;background-color:#e7fdfc;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #c2faf9}.notify-msg_loading{flex-shrink:0;width:20px;height:20px;position:relative}.notify-msg-circular{-webkit-animation:notify-msg-rotate 2s linear infinite both;animation:notify-msg-rotate 2s linear infinite both;transform-origin:center center;height:18px!important;width:18px!important}.notify-msg-path{stroke-dasharray:1,200;stroke-dashoffset:0;stroke:#0fafad;-webkit-animation:notify-msg-dash 1.5s ease-in-out infinite;animation:notify-msg-dash 1.5s ease-in-out infinite;stroke-linecap:round}@-webkit-keyframes notify-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes notify-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@-webkit-keyframes notify-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes notify-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.notify-msg.notify-msg-info .notify-msg-wait{fill:#0fafad}.notify-msg.notify-msg-success .notify-msg-wait{fill:#4ebb23}.notify-msg.notify-msg-warning .notify-msg-wait{fill:#f1b306}.notify-msg.notify-msg-error .notify-msg-wait{fill:#f34b51}.notify-msg.notify-msg-loading .notify-msg-wait{fill:#0fafad}.notify-msg.notify-msg-alert .notify-msg-wait{fill:#999}.notify-msg.notify-msg-alert .notify-msg-content,.notify-msg.notify-msg-confirm .notify-msg-content{font-size:18px}.notify-msg.notify-msg-alert .notify-msg-wait{display:block;width:100px;height:auto;margin:auto;margin-top:30px}.notify-msg.notify-msg-confirm .notify-msg-wait{display:inline-block;width:100px;height:auto;margin:auto}.notify-msg.notify-msg-confirm .notify-msg-content{display:block;margin-bottom:30px}.notify-msg.notify-msg-alert .notify-msg-wait .btnOk,.notify-msg.notify-msg-confirm .notify-msg-wait .btnOk{line-height:30px;border-radius:4px;background-color:#0069d9;border:1px solid #0062cc;color:#fff;width:100px;cursor:pointer}.notify-msg.notify-msg-confirm .btnCancel{line-height:30px;border-radius:4px;background-color:#fff;border:1px solid #ddd;color:#666;width:100px;cursor:pointer;margin-left:6px}.notify-msg-pointer{cursor:pointer}@-webkit-keyframes notify-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@keyframes notify-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@keyframes notify-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@keyframes notify-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}@keyframes notify-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}.notify-msg-fade-in{-webkit-animation:notify-msg-fade .2s ease-out both;animation:notify-msg-fade .2s ease-out both}.notify-msg-fade-out{animation:notify-msg-fade .3s linear reverse both}@-webkit-keyframes notify-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes notify-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}.notify-msg-fade-in-b{-webkit-animation:notify-msg-fade-b .2s ease-out both;animation:notify-msg-fade-b .2s ease-out both}.notify-msg-fade-out-b{animation:notify-msg-fade-b .3s linear reverse both}@-webkit-keyframes notify-msg-fade-b{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes notify-msg-fade-b{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0%,0)}}.notify-msg.notify-msg-alert,.notify-msg.notify-msg-confirm{display:block;box-shadow:0 0 6px 2px rgba(0,0,0,.1);background-color:#fff;border:1px solid #ccc}.bounceIn,.bounceOut{-webkit-animation-duration:.45s;-moz-animation-duration:.45s;-o-animation-duration:.45s;animation-duration:.45s}@keyframes bounceIn{0%{opacity:0;filter:alpha(opacity=0)}100%{opacity:1;filter:alpha(opacity=100)}}.bounceIn{-webkit-animation-name:bounceIn;-moz-animation-name:bounceIn;-o-animation-name:bounceIn;animation-name:bounceIn}@keyframes bounceOut{0%{opacity:1;filter:alpha(opacity=100)}100%{opacity:0;filter:alpha(opacity=0)}}.bounceOut{-webkit-animation-name:bounceOut;-moz-animation-name:bounceOut;-o-animation-name:bounceOut;animation-name:bounceOut}.notify-none{display:none}.notify-modal{left:0;top:0;width:100%;height:100%;background:#000;opacity:0.6;filter:alpha(opacity=60);position:fixed;transition:height .3s ease,padding .3s ease}\n "; + _css.innerHTML = cssStr; + + if (head.children.length) { + head.insertBefore(_css, head.children[0]); + } else { + head.appendChild(_css); + } + } + } + + return notify; + }); + + + //输出接口 + exports('notify', notify); +}); \ No newline at end of file diff --git a/public/static/notify.js b/public/static/notify.js new file mode 100644 index 0000000..b736a1a --- /dev/null +++ b/public/static/notify.js @@ -0,0 +1,461 @@ +/** + *auth: liuyu 4654081@qq.com + *Date: 2022/9/22 + *Desc: layui消息提示插件 + * */ + +layui.define(function (exports) { + "use strict"; + + function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); + } + + !function (global, factory) { + (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = global || self, global.notify = factory()); + }(void 0, function () { + "use strict"; + + + function c(args, children) { + var el = document.createElement("div"); + + for (var key in args) { + var element = args[key]; + + if (key == "className") { + key = "class"; + el.setAttribute(key, element); + } else if (key[0] == "_") { + el.addEventListener(key.slice(1), element); + } + } + if (typeof children == "string") { + el.innerHTML = children; + } else if (_typeof(children) == "object" && children.tagName) { + el.appendChild(children); + } else if (children) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; + el.appendChild(child); + } + } + + return el; + } + + function addAnimationEnd(el, fn) { + ["a", "webkitA"].forEach(function (prefix) { + var name = prefix + "nimationEnd"; + el.addEventListener(name, function () { + fn(); + }); + }); + } + + function css(el, css) { + for (var key in css) { + el.style[key] = css[key]; + } + + if (el.getAttribute("style") === "") { + el.removeAttribute("style"); + } + } + + function addClass(el, s) { + var c = el.className || ""; + + if (!hasClass(c, s)) { + var arr = c.split(/\s+/); + arr.push(s); + el.className = arr.join(" "); + } + } + + function hasClass(c, s) { + return c.indexOf(s) > -1 ? !0 : !1; + } + + function removeClass(el, s) { + var c = el.className || ""; + + if (hasClass(c, s)) { + var arr = c.split(/\s+/); + var i = arr.indexOf(s); + arr.splice(i, 1); + el.className = arr.join(" "); + } + + if (el.className === "") { + el.removeAttribute("class"); + } + } + + var initArgs = { + elem:"body", //默认显示在body,可以指定class或id + msg: "", //文字内容 + position: 'topCenter', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, vcenter + duration: 3000, //默认3秒关闭 + showClose: true, //显示关闭按钮 + shadow:false + }; + var positionB=['bottomLeft','bottomCenter','bottomRight']; + var notify = { + info: function info() { + initConfig(arguments, "info"); + }, + success: function success() { + initConfig(arguments, "success"); + }, + warning: function warning() { + initConfig(arguments, "warning"); + }, + error: function error() { + initConfig(arguments, "error"); + }, + loading: function loading() { + return initConfig(arguments, "loading"); + }, + alert: function loading() { + return initConfig(arguments, "alert"); + }, + confirm: function loading() { + return initConfig(arguments, "confirm"); + }, + destroyAll: function destroyAll() { + _destroyAll(); + }, + config: function config(obj) { + for (var key in obj) { + if (Object.hasOwnProperty.call(obj, key)) { + if (obj[key] !== undefined) { + initArgs[key] = obj[key]; + } + } + } + } + }; + + function initConfig(obj, type) { + var args = {}; + for (var key in initArgs) { + args[key] = initArgs[key]; + } + var posArr = ["bottomRight", "bottomLeft", "topRight", "topLeft", "topCenter", "bottomCenter", "vcenter"]; + for (var i = 0; i < obj.length; i++) { + var it = obj[i]; + + if (it !== undefined) { + if (typeof it == "string" || _typeof(it) === "object") { + if (posArr.indexOf(it) > -1) { + args.position = it; + } else if(it.substring(0,1)=="."||it.substring(0,1)=="#"){ + args.elem=it; + }else if(it=="shadow"){ + args.shadow=true; + }else { + args.msg = it; + } + + } else if (typeof it == "boolean") { + args.showClose = it; + } else if (typeof it == "function") { + args.onClose = it; + } else if (typeof it == "number") { + args.duration = it; + } else if (typeof it == "number") { + args.duration = it; + } + } + } + + args.type = type; + return createMsgEl(args); + } + + var msgWrappers = new Array(); + + function createMsgEl(args) { + var _msgWrapper; + var type = args.type, + elem = args.elem, + duration = args.duration, + msg = args.msg, + position = args.position, + closable = args.showClose, + shadow = args.shadow, + onClose = args.onClose; + var iconObj = getIconObj(); + + if (document.getElementsByClassName(position)[0]) { + _msgWrapper = document.getElementsByClassName(position)[0]; + } else { + _msgWrapper = c({ + className: "notify-msg-stage " + position + }); + msgWrappers.push(_msgWrapper); + } + + if (type === "loading") { + msg = msg === "" ? "正在加载,请稍后" : msg; + closable = false; //loading不显示关闭按钮 + } + + var el,an; + + if(positionB.indexOf(position)!=-1){ + if(type=="alert" || type =="confirm"){ + an="bounceIn"; + }else{ + an="notify-bottom notify-msg-fade-in-b"; + } + el = c({ + className: "notify-msg-wrapper" + }, [c({ + className: "notify-msg " + an + " notify-msg-" + type + }, [c({ + className: "notify-msg-icon" + }, iconObj[type]), c({ + className: "notify-msg-content" + }, msg), c({ + className: "notify-msg-wait " + (closable ? "notify-msg-pointer" : ""), + _click: function _click() { + if (closable) { + closeFlag = true; //点击关闭按钮标志 + flag = false; //正常关闭标志 + closeMsg(el, onClose, _msgWrapper,shadow); + } + } + }, getMsgRight(closable,type))])]); + }else{ + if(type=="alert" || type =="confirm"){ + an="bounceIn"; + }else{ + an="notify-msg-fade-in"; + } + el = c({ + className: "notify-msg-wrapper" + }, [c({ + className: "notify-msg " + an + " notify-msg-" + type + }, [c({ + className: "notify-msg-icon" + }, iconObj[type]), c({ + className: "notify-msg-content" + }, msg), c({ + className: "notify-msg-wait " + (closable ? "notify-msg-pointer" : ""), + _click: function _click() { + if (closable) { + closeFlag = true; //点击关闭按钮标志 + flag = false; //正常关闭标志 + closeMsg(el, onClose, _msgWrapper,shadow); + } + } + }, getMsgRight(closable,type))])]); + } + + var anm = el.querySelector(".notify-msg__circle"); + + if (anm) { + css(anm, { + animation: "notify-msg_" + type + " " + duration + "ms linear" + }); + + if ("onanimationend" in window) { + addAnimationEnd(anm, function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }); + } else { + setTimeout(function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }, duration); + } + } + + if (type != "loading" && type != "alert" && type != "confirm") { + setTimeout(function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }, duration); + } + //遮罩 + if(shadow &&!document.querySelector(".notify-modal")){ + var shadenode=document.createElement("div"); + if(shadow){ + shadenode.className="notify-modal"; + }else{ + shadenode.className="notify-modal notify-none"; + } + + document.querySelector("body").appendChild(shadenode); + } + if (!_msgWrapper.children.length) { + if(elem!=="body"){ + var _pos=getComputedStyle(document.querySelector(elem)).position; + if(_pos=="static"||_pos==""){ + document.querySelector(elem).style.position="relative"; + } + + _msgWrapper.style.position = "absolute"; + }else{ + _msgWrapper.style.position = "fixed"; + } + document.querySelector(elem).appendChild(_msgWrapper); + } + _msgWrapper.appendChild(el); + if(type=="confirm"){ + var btnCancel=document.createElement("button");//''; + var textNode=document.createTextNode("取 消"); + btnCancel.appendChild(textNode); + btnCancel.className="btnCancel"; + btnCancel.onclick=function(){ + closeMsg(el,'', _msgWrapper,shadow); + + } + document.querySelector(".notify-msg-confirm").appendChild(btnCancel); + + } + css(el, { + height: el.offsetHeight + "px" + }); + setTimeout(function () { + if(positionB.indexOf(position)!=-1){ + removeClass(el.children[0], "notify-msg-fade-in-b"); + }else{ + removeClass(el.children[0], "notify-msg-fade-in"); + } + + }, 300); + + if (type == "loading") { + return function () { + closeMsg(el, onClose, _msgWrapper,shadow); + }; + } + + } + + function getMsgRight(showClose,type) { + if (showClose) { + if(type=="alert" || type=="confirm"){ + return "" + }else{ + return "\n \n "; + } + } + } + + var flag = true; //正常关闭标志 + var closeFlag = false;//点击关闭按钮标志 + + function closeMsg(el, cb, _msgWrapper,shadow) { + if (!el) return; + if(hasClass(el.children[0].className,"notify-bottom")){ + addClass(el.children[0], "notify-msg-fade-out-b"); + }else if(hasClass(el.children[0].className,"bounceIn")){ + addClass(el.children[0], "bounceOut"); + }else{ + addClass(el.children[0], "notify-msg-fade-out"); + } + + if(shadow && document.querySelector(".notify-modal")){ + document.querySelector("body").removeChild(document.querySelector(".notify-modal")); + } + + + if (closeFlag) { //点击关闭按钮 + closeFlag = false; + cb && cb(); //回调方法 + } else { + if (flag) {//正常关闭,全局变量 + cb && cb(); + } else { + flag = true + // return; + } + } + + setTimeout(function () { + + if (!el) return; + var has = false; + if (_msgWrapper) { + for (var i = 0; i < _msgWrapper.children.length; i++) { + if (_msgWrapper.children[i] && _msgWrapper.children[i] === el) { + has = true; + } + } + has && removeChild(el); + el = null; + + if (!_msgWrapper.children.length) { + has && removeChild(_msgWrapper); + } + + } + + }, 300); + } + + function getIconObj() { + return { + info: "\n \n ", + success: "\n \n ", + warning: "\n \n ", + error: "\n \n ", + loading: "\n
    \n \n \n \n
    \n " + }; + } + + function removeChild(el) { + el && el.parentNode.removeChild(el); + } + + function _destroyAll() { + for (var j = 0; j < msgWrappers.length; j++) { + for (var i = 0; i < msgWrappers[j].children.length; i++) { + var element = msgWrappers[j].children[i]; + closeMsg(element, '', msgWrappers[j]); + } + } + } + + window.addEventListener('DOMContentLoaded', function () { + insertCssInHead(); + }); + + function insertCssInHead() { + var doc = document; + + if (doc && doc.head) { + var head = doc.head; + + var _css = doc.createElement('style'); + + var cssStr = "\n\n[class|=notify],[class|=notify]::after,[class|=notify]::before{box-sizing:border-box;outline:0}.notify-msg-progress{width:13px;height:13px}.notify-msg__circle{stroke-width:2;stroke-linecap:square;fill:none;transform:rotate(-90deg);transform-origin:center}.notify-msg-stage:hover .notify-msg__circle{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.notify-msg__background{stroke-width:2;fill:none}.notify-msg-stage{position:fixed;width:auto;z-index:99891015}.topLeft{top:20px;left:20px}.topCenter{top:20px;left:50%;transform:translate(-50%,0)}.topRight{top:20px;right:20px}.bottomLeft{bottom:20px;left:20px}.bottomCenter{bottom:20px;left:50%;transform:translate(-50%,0)}.bottomRight{bottom:20px;right:20px}.vcenter{top:50%;left:50%;transform:translate(-50%,-50%)}.notify-msg-wrapper{position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);transition:height .3s ease,padding .3s ease;padding:6px 0;will-change:transform,opacity}.notify-msg{padding:15px 21px;border-radius:3px;position:relative;left:50%;transform:translate(-50%,0);transform:translate3d(-50%,0,0);display:flex;align-items:center}.notify-msg-content,.notify-msg-icon,.notify-msg-wait{display:inline-block}.notify-msg-icon{position:relative;width:13px;height:13px;border-radius:100%;display:flex;justify-content:center;align-items:center}.notify-msg-icon svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:11px;height:11px}.notify-msg-wait{width:20px;height:20px;position:relative;fill:#4eb127}.notify-msg-wait svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.notify-msg-close{width:14px;height:14px}.notify-msg-content{margin:0 10px;min-width:240px;text-align:left;font-size:14px;font-weight:500;font-family:-apple-system,Microsoft Yahei,sans-serif;text-shadow:0 0 1px rgba(0,0,0,.01)}.notify-msg.notify-msg-info{color:#0c5460;background-color:#d1ecf1;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #bee5eb}.notify-msg.notify-msg-info .notify-msg-icon{background-color:#1d96aa}.notify-msg.notify-msg-success{color:#155724;background-color:#d4edda;box-shadow:0 0 2px 0 rgba(0,1,0,.01),0 0 0 1px #c3e6cb}.notify-msg.notify-msg-success .notify-msg-icon{background-color:#4ebb23}.notify-msg.notify-msg-warning{color:#856404;background-color:#fff3cd;box-shadow:0 0 2px 0 rgba(1,1,0,.01),0 0 0 1px #ffeeba}.notify-msg.notify-msg-warning .notify-msg-icon{background-color:#f1b306}.notify-msg.notify-msg-error{color:#721c24;background-color:#f8d7da;box-shadow:0 0 2px 0 rgba(1,0,0,.01),0 0 0 1px #f5c6cb}.notify-msg.notify-msg-error .notify-msg-icon{background-color:#f34b51}.notify-msg.notify-msg-loading{color:#0fafad;background-color:#e7fdfc;box-shadow:0 0 2px 0 rgba(0,1,1,.01),0 0 0 1px #c2faf9}.notify-msg_loading{flex-shrink:0;width:20px;height:20px;position:relative}.notify-msg-circular{-webkit-animation:notify-msg-rotate 2s linear infinite both;animation:notify-msg-rotate 2s linear infinite both;transform-origin:center center;height:18px!important;width:18px!important}.notify-msg-path{stroke-dasharray:1,200;stroke-dashoffset:0;stroke:#0fafad;-webkit-animation:notify-msg-dash 1.5s ease-in-out infinite;animation:notify-msg-dash 1.5s ease-in-out infinite;stroke-linecap:round}@-webkit-keyframes notify-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes notify-msg-rotate{100%{transform:translate(-50%,-50%) rotate(360deg)}}@-webkit-keyframes notify-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes notify-msg-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.notify-msg.notify-msg-info .notify-msg-wait{fill:#0fafad}.notify-msg.notify-msg-success .notify-msg-wait{fill:#4ebb23}.notify-msg.notify-msg-warning .notify-msg-wait{fill:#f1b306}.notify-msg.notify-msg-error .notify-msg-wait{fill:#f34b51}.notify-msg.notify-msg-loading .notify-msg-wait{fill:#0fafad}.notify-msg.notify-msg-alert .notify-msg-wait{fill:#999}.notify-msg.notify-msg-alert .notify-msg-content,.notify-msg.notify-msg-confirm .notify-msg-content{font-size:18px}.notify-msg.notify-msg-alert .notify-msg-wait{display:block;width:100px;height:auto;margin:auto;margin-top:30px}.notify-msg.notify-msg-confirm .notify-msg-wait{display:inline-block;width:100px;height:auto;margin:auto}.notify-msg.notify-msg-confirm .notify-msg-content{display:block;margin-bottom:30px}.notify-msg.notify-msg-alert .notify-msg-wait .btnOk,.notify-msg.notify-msg-confirm .notify-msg-wait .btnOk{line-height:30px;border-radius:4px;background-color:#0069d9;border:1px solid #0062cc;color:#fff;width:100px;cursor:pointer}.notify-msg.notify-msg-confirm .btnCancel{line-height:30px;border-radius:4px;background-color:#fff;border:1px solid #ddd;color:#666;width:100px;cursor:pointer;margin-left:6px}.notify-msg-pointer{cursor:pointer}@-webkit-keyframes notify-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@keyframes notify-msg_info{0%{stroke:#0fafad}to{stroke:#0fafad;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@keyframes notify-msg_success{0%{stroke:#4eb127}to{stroke:#4eb127;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@keyframes notify-msg_warning{0%{stroke:#fcbc0b}to{stroke:#fcbc0b;stroke-dasharray:0 100}}@-webkit-keyframes notify-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}@keyframes notify-msg_error{0%{stroke:#eb262d}to{stroke:#eb262d;stroke-dasharray:0 100}}.notify-msg-fade-in{-webkit-animation:notify-msg-fade .2s ease-out both;animation:notify-msg-fade .2s ease-out both}.notify-msg-fade-out{animation:notify-msg-fade .3s linear reverse both}@-webkit-keyframes notify-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes notify-msg-fade{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,-80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}.notify-msg-fade-in-b{-webkit-animation:notify-msg-fade-b .2s ease-out both;animation:notify-msg-fade-b .2s ease-out both}.notify-msg-fade-out-b{animation:notify-msg-fade-b .3s linear reverse both}@-webkit-keyframes notify-msg-fade-b{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0,0)}}@keyframes notify-msg-fade-b{0%{opacity:0;transform:translate(-50%,0);transform:translate3d(-50%,80%,0)}to{opacity:1;transform:translate(-50%,0);transform:translate3d(-50%,0%,0)}}.notify-msg.notify-msg-alert,.notify-msg.notify-msg-confirm{display:block;box-shadow:0 0 6px 2px rgba(0,0,0,.1);background-color:#fff;border:1px solid #ccc}.bounceIn,.bounceOut{-webkit-animation-duration:.45s;-moz-animation-duration:.45s;-o-animation-duration:.45s;animation-duration:.45s}@keyframes bounceIn{0%{opacity:0;filter:alpha(opacity=0)}100%{opacity:1;filter:alpha(opacity=100)}}.bounceIn{-webkit-animation-name:bounceIn;-moz-animation-name:bounceIn;-o-animation-name:bounceIn;animation-name:bounceIn}@keyframes bounceOut{0%{opacity:1;filter:alpha(opacity=100)}100%{opacity:0;filter:alpha(opacity=0)}}.bounceOut{-webkit-animation-name:bounceOut;-moz-animation-name:bounceOut;-o-animation-name:bounceOut;animation-name:bounceOut}.notify-none{display:none}.notify-modal{left:0;top:0;width:100%;height:100%;background:#000;opacity:0.6;filter:alpha(opacity=60);position:fixed;transition:height .3s ease,padding .3s ease}\n "; + _css.innerHTML = cssStr; + + if (head.children.length) { + head.insertBefore(_css, head.children[0]); + } else { + head.appendChild(_css); + } + } + } + + return notify; + }); + + + //输出接口 + exports('notify', notify); +}); \ No newline at end of file diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index fcfa688..a9d64a9 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1487,17 +1487,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.4", - "version_normalized": "6.6.4.0", + "version": "v6.6.5", + "version_normalized": "6.6.5.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", "shasum": "" }, "require": { @@ -1521,10 +1521,10 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2022-08-22T09:22:00+00:00", + "time": "2022-10-07T12:23:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1556,7 +1556,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" }, "funding": [ { @@ -3353,17 +3353,17 @@ }, { "name": "workerman/workerman", - "version": "v4.1.3", - "version_normalized": "4.1.3.0", + "version": "v4.1.4", + "version_normalized": "4.1.4.0", "source": { "type": "git", "url": "https://github.com/walkor/workerman.git", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9" + "reference": "83e007acf936e2233ac92d7368b87716f2bae338" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/walkor/workerman/zipball/01028d8008c5691ec38c5f675fc13d76496a6db9", - "reference": "01028d8008c5691ec38c5f675fc13d76496a6db9", + "url": "https://api.github.com/repos/walkor/workerman/zipball/83e007acf936e2233ac92d7368b87716f2bae338", + "reference": "83e007acf936e2233ac92d7368b87716f2bae338", "shasum": "" }, "require": { @@ -3372,7 +3372,7 @@ "suggest": { "ext-event": "For better performance. " }, - "time": "2022-09-23T14:05:12+00:00", + "time": "2022-10-09T11:33:14+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 96651aa..ec47b66 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'taoser/taoler', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9f89482c951e9a44bf0e2e4bf91c7e7ccb0fc8dd', + 'reference' => 'ceb164391c3d212f1460cfbcbb7f4d7ad66f8ce9', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -209,9 +209,9 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.6.4', - 'version' => '6.6.4.0', - 'reference' => 'a94fdebaea6bd17f51be0c2373ab80d3d681269b', + 'pretty_version' => 'v6.6.5', + 'version' => '6.6.5.0', + 'reference' => '8b6386d7417526d1ea4da9edb70b8352f7543627', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), @@ -367,7 +367,7 @@ 'taoser/taoler' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9f89482c951e9a44bf0e2e4bf91c7e7ccb0fc8dd', + 'reference' => 'ceb164391c3d212f1460cfbcbb7f4d7ad66f8ce9', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -527,9 +527,9 @@ 'dev_requirement' => false, ), 'workerman/workerman' => array( - 'pretty_version' => 'v4.1.3', - 'version' => '4.1.3.0', - 'reference' => '01028d8008c5691ec38c5f675fc13d76496a6db9', + 'pretty_version' => 'v4.1.4', + 'version' => '4.1.4.0', + 'reference' => '83e007acf936e2233ac92d7368b87716f2bae338', 'type' => 'library', 'install_path' => __DIR__ . '/../workerman/workerman', 'aliases' => array(), diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index a08b5f1..653877f 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.6.4 \ No newline at end of file +6.6.5 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index 1db6f03..9275fab 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -51,7 +51,7 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "autoload": { diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php index 1edba1d..8b7b38a 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php @@ -14,16 +14,22 @@ $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret. $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php index 23caa71..b0469fd 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -9,19 +9,18 @@ $PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzi $PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.'; $PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.'; $PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.'; -$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: '; +$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: '; $PHPMAILER_LANG['execute'] = 'Nie można uruchomić: '; $PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: '; $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; -$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: '; +$PHPMAILER_LANG['from_failed'] = 'Następujący adres nadawcy jest nieprawidłowy lub nie istnieje: '; $PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.'; -$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . - 'następujący adres Odbiorcy jest nieprawidłowy: '; -$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.'; +$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . 'następujący adres odbiorcy jest nieprawidłowy lub nie istnieje: '; +$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email odbiorcy.'; $PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.'; -$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: '; +$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi lub nie istnieją: '; $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Wywołanie funkcji SMTP Connect() zostało zakończone niepowodzeniem.'; $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: '; $PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: '; diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index 6242454..7e6c88f 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * Error severity: message only, continue processing. @@ -1671,7 +1671,7 @@ class PHPMailer return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (Exception $exc) { - if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { $this->smtp->reset(); } $this->setError($exc->getMessage()); @@ -1863,7 +1863,7 @@ class PHPMailer if (!static::isPermittedPath($path)) { return false; } - $readable = file_exists($path); + $readable = is_file($path); //If not a UNC path (expected to start with \\), check read permission, see #2069 if (strpos($path, '\\\\') !== 0) { $readable = $readable && is_readable($path); @@ -2101,6 +2101,9 @@ class PHPMailer $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); + if ($this->Host === null) { + $this->Host = 'localhost'; + } $hosts = explode(';', $this->Host); $lastexception = null; diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index 78e91e4..a3c9f45 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index cc1711d..312f753 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * SMTP line break constant. @@ -682,7 +682,6 @@ class SMTP */ public function close() { - $this->setError(''); $this->server_caps = null; $this->helo_rply = null; if (is_resource($this->smtp_conn)) { diff --git a/vendor/services.php b/vendor/services.php index 14f61ff..6db1745 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/workerman/workerman/Connection/ConnectionInterface.php b/vendor/workerman/workerman/Connection/ConnectionInterface.php index 4d3f5e1..5d815d8 100644 --- a/vendor/workerman/workerman/Connection/ConnectionInterface.php +++ b/vendor/workerman/workerman/Connection/ConnectionInterface.php @@ -16,6 +16,7 @@ namespace Workerman\Connection; /** * ConnectionInterface. */ +#[\AllowDynamicProperties] abstract class ConnectionInterface { /** diff --git a/vendor/workerman/workerman/Worker.php b/vendor/workerman/workerman/Worker.php index 738b171..f26eaab 100644 --- a/vendor/workerman/workerman/Worker.php +++ b/vendor/workerman/workerman/Worker.php @@ -26,6 +26,7 @@ use \Exception; * Worker class * A container for listening ports */ +#[\AllowDynamicProperties] class Worker { /** @@ -33,7 +34,7 @@ class Worker * * @var string */ - const VERSION = '4.1.3'; + const VERSION = '4.1.4'; /** * Status starting. @@ -637,9 +638,18 @@ class Worker if (\DIRECTORY_SEPARATOR !== '/') { return; } - $fd = $fd ?: \fopen(static::$pidFile . '.lock', 'a+'); + $lock_file = static::$pidFile . '.lock'; + $fd = $fd ?: \fopen($lock_file, 'a+'); if ($fd) { flock($fd, $flag); + if ($flag === \LOCK_UN) { + fclose($fd); + $fd = null; + clearstatcache(); + if (\is_file($lock_file)) { + unlink($lock_file); + } + } } } diff --git a/view/taoler/index/user/home.html b/view/taoler/index/user/home.html index 01813df..9fac01e 100644 --- a/view/taoler/index/user/home.html +++ b/view/taoler/index/user/home.html @@ -34,7 +34,7 @@

    {$u.point} {:lang('accumulate points')} {$u.create_time|date='Y-m-d'} {:lang('join')} - {if session('user_id')}来自{:hook('ipShow',$u.city)} {else /} lang('log in to view') {/if} + {if session('user_id')}来自{:hook('ipShow',$u.city)} {else /} {:lang('log in to view')} {/if}

    ({$u.sign ? $u.sign|raw : lang('it is not signed yet')})