first commit
This commit is contained in:
113
web/templates/manage/oauth/login.tmpl
Normal file
113
web/templates/manage/oauth/login.tmpl
Normal file
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>登录 - management</title>
|
||||
<link rel="icon" type="image/x-icon" href="/statics/favicon.ico">
|
||||
<!-- 样 式 文 件 -->
|
||||
<link rel="stylesheet" href="/statics/component/pear/css/pear.css" />
|
||||
<link rel="stylesheet" href="/statics/admin/css/other/login.css" />
|
||||
</head>
|
||||
<!-- 代 码 结 构 -->
|
||||
|
||||
<body background="/statics/admin/images/background.svg" style="background-size: cover;">
|
||||
<form class="layui-form" action="javascript:void(0);">
|
||||
{{ .CsrfTokenField }}
|
||||
<div class="layui-form-item">
|
||||
<img class="logo" src="/statics/admin/images/logo.png" />
|
||||
<div class="title">Pear Admin</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input placeholder="邮 箱 " name="email" type="email" value="1185230223@qq.com" lay-verify="required" hover
|
||||
class="layui-input" />
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input placeholder="密 码 " name="password" type="password" value="secret" lay-verify="required" hover
|
||||
class="layui-input" />
|
||||
</div>
|
||||
<div class="layui-form-item" style="display: flex;">
|
||||
<input placeholder="验证码" name="captcha" type="text" lay-verify="required" hover class="layui-input"
|
||||
style="width: 200px;margin-right: 10px;" />
|
||||
<input type="hidden" id="captcha_id" name="captcha_id" />
|
||||
<img id="captcha" src="/captcha"
|
||||
style="cursor: pointer;background-color: #ffffff;border: 1px solid #eeeeee;width: 120px;height: 42px;" />
|
||||
</div>
|
||||
<!-- <div class="layui-form-item">
|
||||
<input type="checkbox" name="" title="记住密码" lay-skin="primary" checked>
|
||||
</div> -->
|
||||
<div class="layui-form-item">
|
||||
<button class="pear-btn pear-btn-success login" lay-submit lay-filter="login">
|
||||
登 入
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 资 源 引 入 -->
|
||||
<script src="/statics/component/layui/layui.js"></script>
|
||||
<script src="/statics/component/pear/pear.js"></script>
|
||||
<script>
|
||||
layui.use(['jquery', 'form', 'button', 'popup'], function () {
|
||||
var $ = layui.jquery;
|
||||
var form = layui.form;
|
||||
var button = layui.button;
|
||||
var popup = layui.popup;
|
||||
|
||||
$(function () {
|
||||
$('#captcha').click();
|
||||
})
|
||||
|
||||
$('#captcha').click(function () {
|
||||
$.ajax({
|
||||
url: '/captcha',
|
||||
method: 'get',
|
||||
success: function (j) {
|
||||
if (j.success) {
|
||||
$('#captcha').attr('src', j.data.pic_path);
|
||||
$('#captcha_id').val(j.data.captcha_id);
|
||||
} else {
|
||||
console.log(j)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.on('submit(login)', function (data) {
|
||||
|
||||
let loading = button.load({
|
||||
elem: '.login',
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '/login',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: data.field,
|
||||
success: function (obj) {
|
||||
if (obj.success) {
|
||||
loading.stop(function () {
|
||||
popup.success("登录成功", function () {
|
||||
location.href = "/home.html"
|
||||
});
|
||||
});
|
||||
} else {
|
||||
loading.stop(function () {
|
||||
popup.failure(obj.msg);
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (ex) {
|
||||
loading.stop(function () {
|
||||
popup.failure('网络异常,请刷新重试');
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user