mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
修改事件处理函数的逻辑;修改忘记密码提示;忘记密码增加view_replace事件;发布新版本
This commit is contained in:
@@ -32,7 +32,8 @@
|
||||
<div class="tip">
|
||||
<span class="icon-nocheck"></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 class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
|
||||
<button class="login-btn" lay-submit>立即登录</button>
|
||||
|
||||
@@ -40,6 +40,6 @@ $(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>');
|
||||
});
|
||||
});
|
||||
@@ -230,21 +230,50 @@ function build_upload_url($url, $upload_type = null)
|
||||
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);
|
||||
|
||||
$content = '';
|
||||
$result = [];
|
||||
|
||||
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')) {
|
||||
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;
|
||||
}
|
||||
$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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use think\facade\App;
|
||||
|
||||
class Version extends Command
|
||||
{
|
||||
public const VERSION = 'v2.0.36';
|
||||
public const VERSION = 'v2.0.37';
|
||||
|
||||
public const LAYUI_VERSION = '2.8.16';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user