221 lines
8.8 KiB
HTML
221 lines
8.8 KiB
HTML
<!DOCTYPE html>
|
||
<!--[if IE]>
|
||
<script>top.location = "/ver";</script><![endif]-->
|
||
<html>
|
||
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
<meta name="renderer" content="webkit">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||
<title>复习生报名</title>
|
||
<link type="image/x-icon" rel="icon" href="./assets/img/favicon.ico">
|
||
<link type="text/css" rel="stylesheet" href="./static/css/layui.css">
|
||
<link type="text/css" rel="stylesheet" href="./static/css/common.css">
|
||
<link type="text/css" rel="stylesheet" href="./static/css/login.css">
|
||
<link rel="stylesheet" href="./newCSS/index.css">
|
||
<link href="./newCSS/sweetalert2.min.css" rel="stylesheet">
|
||
|
||
|
||
<!-- <script src="https://code.jquery.com/jquery-3.7.1.js"
|
||
integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script> -->
|
||
<script src="./static/js/jquery.js"></script>
|
||
<script src="./static/js/axios.min.js"></script>
|
||
|
||
<script src="./static/js/sweetalert2.min.js"></script>
|
||
|
||
</head>
|
||
|
||
<body class="bg">
|
||
<div class="box">
|
||
<div class="logo">
|
||
<strong>复习生登录</strong>
|
||
</div>
|
||
<form class="layui-form layui-form-pane">
|
||
<div class="layui-form-item">
|
||
<div class="">
|
||
<input type="text" name="account" placeholder="请输入帐号(信息注册填写的手机号)" autocomplete="off"
|
||
class="layui-input pl-20" lay-verify="required" lay-vertype="tips" id="account">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<div class="">
|
||
<input type="password" name="password" id="password" placeholder="请输入密码(信息注册填写的学生身份证号后6位,最后一位X大写)"
|
||
autocomplete="off" class="layui-input pl-20" lay-verify="required" lay-vertype="tips">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
|
||
<div class="captcha-container">
|
||
<div class="yzmBox">
|
||
<input type="text" id="yzm" name="captcha" placeholder="请输入验证码" autocomplete="off"
|
||
class="layui-input pl-20" style="width: 250px" lay-verify="required" lay-vertype="tips">
|
||
<span class="captcha-box" id="captcha"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<div class="layui-btn layui-btn-fluid" id="login">立即登录</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<div class="dialog">
|
||
<div class="box2">
|
||
<h2 class="anno-title">提示内容</h2>
|
||
<hr class="layui-bg-red">
|
||
<hr class="layui-bg-red">
|
||
<ul class="anno">
|
||
<li class="content">1. 学生必须如实填写高考分数,如审核发现成绩造假,立即取消入学资格;</li>
|
||
<li class="content">2. 本校只招收英语类考生,暂不招收其它语种;</li>
|
||
<li class="content">3. 我校不招收物理和历史同时选择或者同时不选择的考生;</li>
|
||
<li class="content">4. 开学后如果转组合(高考组合与首次开学后所学组合不同),按最高标准收费,开学后补齐学费;</li>
|
||
<li class="content">5. 艺术生(有长时间不在校,在外培训)按在校生对待;</li>
|
||
<li class="content">6. 关于注册中“是否在我校报名2025年高考”,省外户籍的学生应当返回户籍所在省份报名,应该选择否;
|
||
省内户籍的学生,如选择是,则必须在我校进行高考报名,报名核查时如未在我校高考报名,则无条件退学,学费不退。如选择否,则暂缓录取,学校将根据学生实际高考报名考点选择性录取</li>
|
||
</ul>
|
||
<div class="center mt-30">
|
||
<button class="layui-btn" id="down">我已阅读并同意以上用户协议</button>
|
||
</div>
|
||
<div class="center mt-10">
|
||
<button class="layui-btn layui-btn-primary" id="exit">不同意</button>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<script>
|
||
document.addEventListener('DOMContentLoaded', function () {
|
||
const captchaEl = document.getElementById('captcha');
|
||
const refreshBtn = document.getElementById('refresh');
|
||
|
||
let currentCaptcha = '';
|
||
|
||
// 生成随机验证码(4位字母数字组合)
|
||
function generateCaptcha() {
|
||
const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||
let captcha = '';
|
||
for (let i = 0; i < 4; i++) {
|
||
captcha += chars.charAt(Math.floor(Math.random() * chars.length));
|
||
}
|
||
currentCaptcha = captcha;
|
||
captchaEl.textContent = captcha;
|
||
}
|
||
|
||
// 初始化验证码
|
||
generateCaptcha();
|
||
|
||
// 刷新验证码
|
||
captchaEl.addEventListener('click', generateCaptcha);
|
||
|
||
|
||
|
||
$('#login').click(function () {
|
||
let account = $('#account').val()
|
||
let password = $('#password').val()
|
||
|
||
if (!account) {
|
||
return Swal.fire({
|
||
title: '提示',
|
||
text: '请输入账号',
|
||
icon: 'error', // 可选:'success', 'error', 'warning', 'info', 'question'
|
||
confirmButtonText: '确定'
|
||
});
|
||
|
||
|
||
}
|
||
if (!password) {
|
||
|
||
return Swal.fire({
|
||
title: '提示',
|
||
text: '请输入密码',
|
||
icon: 'error', // 可选:'success', 'error', 'warning', 'info', 'question'
|
||
confirmButtonText: '确定'
|
||
});
|
||
|
||
|
||
}
|
||
if (!$('#yzm').val()) {
|
||
|
||
return Swal.fire({
|
||
title: '提示',
|
||
text: '请输入验证码',
|
||
icon: 'error', // 可选:'success', 'error', 'warning', 'info', 'question'
|
||
confirmButtonText: '确定'
|
||
});
|
||
|
||
}
|
||
|
||
|
||
if ($('#yzm').val().toUpperCase() === currentCaptcha) {
|
||
axios.post('http://studentadmin.hshuishang.com/student/login', {
|
||
phone: account,
|
||
password: password
|
||
}).then(res => {
|
||
console.log(res.data.data.token);
|
||
|
||
if (res.status == 200) {
|
||
localStorage.setItem('authToken', res.data.data.token);
|
||
window.location.href = './nav.html'
|
||
}else{
|
||
return Swal.fire({
|
||
title: '提示',
|
||
text:res.data.data.msg ,
|
||
icon: 'error', // 可选:'success', 'error', 'warning', 'info', 'question'
|
||
confirmButtonText: '确定'
|
||
});
|
||
}
|
||
|
||
}).catch(error => {
|
||
return Swal.fire({
|
||
title: '提示',
|
||
text:error.response.data.msg,
|
||
icon: 'error', // 可选:'success', 'error', 'warning', 'info', 'question'
|
||
confirmButtonText: '确定'
|
||
});
|
||
})
|
||
|
||
// 这里可以添加成功后的操作,如表单提交
|
||
} else {
|
||
generateCaptcha(); // 错误后刷新验证码
|
||
}
|
||
|
||
|
||
})
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
var countdown = 5;
|
||
|
||
function setTime(val) {
|
||
if (countdown == 0) {
|
||
$('#down').attr("disabled", false);
|
||
$('#down').text("我已阅读并同意以上用户协议");
|
||
return;
|
||
} else {
|
||
$('#down').attr("disabled", true);
|
||
$('#down').text("请阅读 " + countdown + "秒");
|
||
countdown--;
|
||
}
|
||
setTimeout(function () {
|
||
setTime($('#down'))
|
||
}, 1000)
|
||
}
|
||
setTime()
|
||
|
||
$('#down').click(function () {
|
||
$('.dialog').hide()
|
||
})
|
||
|
||
$('#exit').click(function () {
|
||
$('.layui-btn').hide()
|
||
})
|
||
|
||
|
||
|
||
</script>
|
||
</body>
|
||
|
||
</html> |