mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 02:22:48 +08:00
调整统一provider目录;增加content事件的快速登录案例;
This commit is contained in:
@@ -33,6 +33,7 @@ class Login extends AdminController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$captcha = Env::get('adminsystem.captcha', 1);
|
||||
if ($this->request->isPost()) {
|
||||
$post = $this->request->post();
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
|
||||
use app\Request;
|
||||
use CsrfVerify\drive\ThinkphpCache;
|
||||
use CsrfVerify\entity\CsrfVerifyEntity;
|
||||
use CsrfVerify\interfaces\CsrfVerifyInterface;
|
||||
use think\facade\Session;
|
||||
use think\Request;
|
||||
|
||||
class CsrfMiddleware
|
||||
{
|
||||
@@ -18,7 +12,6 @@ class CsrfMiddleware
|
||||
{
|
||||
if (env('adminsystem.IS_CSRF', true)) {
|
||||
if (!in_array($request->method(), ['GET', 'HEAD', 'OPTIONS'])) {
|
||||
|
||||
// 跨域校验
|
||||
$refererUrl = $request->header('REFERER', null);
|
||||
$refererInfo = parse_url($refererUrl);
|
||||
@@ -36,9 +29,9 @@ class CsrfMiddleware
|
||||
if (!$check) {
|
||||
$this->error('请求验证失败,请重新刷新页面!');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
use app\Request;
|
||||
use think\facade\Log;
|
||||
use think\facade\Request as FacadeRequest;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 系统操作日志中间件
|
||||
|
||||
7
app/admin/view/login/ext/demo.html
Normal file
7
app/admin/view/login/ext/demo.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="layui-btn layui-btn-xs" id="demo-login-btn">演示账号快速登录</div>
|
||||
<script>
|
||||
$('#demo-login-btn').click(function() {
|
||||
$('[name="username"]').val('admin')
|
||||
$('[name="password"]').val('123456')
|
||||
})
|
||||
</script>
|
||||
@@ -12,19 +12,19 @@
|
||||
|
||||
<div class="item">
|
||||
<span class="icon icon-2"></span>
|
||||
<input type="text" name="username" lay-verify="required" placeholder="请输入登录账号" maxlength="24"/>
|
||||
<input type="text" name="username" lay-verify="required" placeholder="请输入登录账号" maxlength="24" />
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="icon icon-3"></span>
|
||||
<input type="password" name="password" lay-verify="required" placeholder="请输入密码" maxlength="20">
|
||||
<input type="password" name="password" lay-verify="required" placeholder="请输入密码" maxlength="20">
|
||||
<span class="bind-password icon icon-4"></span>
|
||||
</div>
|
||||
|
||||
{if $captcha == 1}
|
||||
<div id="validatePanel" class="item" style="width: 137px;">
|
||||
<input type="text" name="captcha" placeholder="请输入验证码" maxlength="4">
|
||||
<img id="refreshCaptcha" class="validateImg" src="{:url('login/captcha')}" onclick="this.src='{:url(\'login/captcha\')}?seed='+Math.random()">
|
||||
<img id="refreshCaptcha" class="validateImg" src="{:url('login/captcha')}" onclick="this.src='{:url(\'login/captcha\')}?seed='+Math.random()">
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
<div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
|
||||
<button class="login-btn" lay-submit>立即登录</button>
|
||||
</div>
|
||||
<div class="layui-form-item" style="padding: 10px;">
|
||||
<div class="layui-btn-container">
|
||||
{:event_view_content("AdminLoginType")}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user