修改事件处理函数的逻辑;修改忘记密码提示;忘记密码增加view_replace事件;发布新版本

This commit is contained in:
2023-09-23 10:36:02 +08:00
parent 32a60597ff
commit 139ff5bda7
4 changed files with 38 additions and 8 deletions

View File

@@ -32,7 +32,8 @@
<div class="tip"> <div class="tip">
<span class="icon-nocheck"></span> <span class="icon-nocheck"></span>
<span class="login-tip">保持登录</span> <span class="login-tip">保持登录</span>
<a href="javascript:" class="forget-password">忘记密码?</a> {:event_view_replace('<a href="javascript:" class="forget-password">忘记密码?</a>','AdminLoginForget')}
</div> </div>
<div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;"> <div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
<button class="login-btn" lay-submit>立即登录</button> <button class="login-btn" lay-submit>立即登录</button>

View File

@@ -40,6 +40,6 @@ $(function () {
$('.forget-password').click(function () { $('.forget-password').click(function () {
layer.msg('可以使用重置密码命令设置:<br/>php think admin:resetPassword<br><a target="_blank" href="http://doc.ulthon.com/home/read/ulthon_admin/reset_password/15/16.html"> 参考文档</a>'); layer.msg('可以使用重置密码命令设置:<br/>php think admin:reset:password<br><a target="_blank" href="http://doc.ulthon.com/home/read/ulthon_admin/reset_password/15/16.html"> 参考文档</a>');
}); });
}); });

View File

@@ -230,21 +230,50 @@ function build_upload_url($url, $upload_type = null)
return Filesystem::disk($upload_type)->url($url); return Filesystem::disk($upload_type)->url($url);
} }
function event_view_content($name) function event_handle_result($name, $key, $type = 'all')
{ {
$list_result = Event::trigger($name); $list_result = Event::trigger($name);
$content = ''; $result = [];
foreach ($list_result as $key_event => $value_event) { foreach ($list_result as $key_event => $value_event) {
if (!isset($value_event['view_content'])) { if (!isset($value_event[$key])) {
if (Env::get('adminsystem.strict_event')) { if (Env::get('adminsystem.strict_event')) {
throw new EventException("Event view {$name} trigger a result without a view_content"); throw new EventException("Event view {$name} trigger a result without a {$key}");
} }
continue; continue;
} }
$content .= $value_event['view_content']; if ($type == 'all') {
$result[] = $value_event[$key];
} elseif ($type == 'last') {
$result = $value_event[$key];
} elseif ($type == 'first') {
$result = $value_event[$key];
break;
}
} }
return $result;
}
function event_view_content($name)
{
$list_result = event_handle_result($name, 'view_content');
$content = implode('', $list_result);
return $content; return $content;
} }
function event_view_replace($content, $name)
{
$list_result = event_handle_result($name, 'view_replace');
$content_event = implode('', $list_result);
if (empty($content_event)) {
return $content;
}
return $content_event;
}

View File

@@ -14,7 +14,7 @@ use think\facade\App;
class Version extends Command class Version extends Command
{ {
public const VERSION = 'v2.0.36'; public const VERSION = 'v2.0.37';
public const LAYUI_VERSION = '2.8.16'; public const LAYUI_VERSION = '2.8.16';