159 lines
6.2 KiB
HTML
159 lines
6.2 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>后台管理系统</title>
|
|
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
|
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
|
<link rel="stylesheet" href="/static/agent/css/font.css">
|
|
<link rel="stylesheet" href="/static/agent/css/xadmin.css">
|
|
<script type="text/javascript" src="/static/agent/js/jquery.min.js"></script>
|
|
<script src="/static/agent/lib/layui/layui.js" charset="utf-8"></script>
|
|
<script type="text/javascript" src="/static/agent/js/xadmin.js"></script>
|
|
</head>
|
|
<script type="text/javascript">
|
|
var lang = {$jsonlang};
|
|
</script>
|
|
<style>
|
|
.layui-form-radio {
|
|
line-height: 16px;
|
|
margin: 0;
|
|
padding-right: 0;
|
|
}
|
|
.layui-form-radio>i {
|
|
margin-right: 4px;
|
|
font-size: 16px;
|
|
color: #c2c2c2;
|
|
}
|
|
.login{
|
|
padding-top: 25px;
|
|
}
|
|
hr{
|
|
margin: 5px 0px;
|
|
}
|
|
.lang_box{
|
|
padding: 10px;
|
|
float: right;
|
|
}
|
|
.login .form-label {
|
|
width: 20%;
|
|
}
|
|
.login .layui-input {
|
|
width: 78%;
|
|
}
|
|
|
|
</style>
|
|
<body class="login-bg">
|
|
<div class="container">
|
|
<div class="page-home">
|
|
<div class="top_repeat">
|
|
<div class="lang_box">
|
|
<span style="color: #fff;">lang/语言:</span>
|
|
<span>
|
|
<select style="width: 125px;" id="language">
|
|
<option value="cn" <?php if(isset($langType) && $langType == 'zh-cn') echo 'selected="selected"'; ?> >中文</option>
|
|
<option value="en" <?php if(isset($langType) && $langType == 'en-us') echo 'selected="selected"'; ?> >English</option>
|
|
</select>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="login-logo">
|
|
<img src="{$Think.LOGO_PATH}">
|
|
</div>
|
|
<div class="form-wrapper">
|
|
<div class="login layui-anim layui-anim-up">
|
|
<div class="message">{$lang['system_name']}</div>
|
|
<div class="form-wrapper">
|
|
<form class="layui-form" >
|
|
<div class="form-label">{$lang['username']}</div>
|
|
<input name="username" placeholder="{$lang['username']}" id="username" type="text" class="layui-input" >
|
|
<hr class="hr15">
|
|
<div class="form-label">{$lang['password']}</div>
|
|
<input name="password" id="password" placeholder="{$lang['password']}" type="password" class="layui-input">
|
|
<hr class="hr15">
|
|
<div class="form-label">{$lang['verification']}</div>
|
|
<input name="code" id="code" class="layui-input" type="text" lay-verify="required" placeholder="{$lang['verification']}" style="width:130px;">
|
|
<img id="validateCode" src="/login/validateCode" onclick="this.src=this.src+'?'" style="height: 28px;">
|
|
<hr class="hr15">
|
|
<div id="account_type" style=" margin: 5px 0;float: right;padding-right: 12px;">
|
|
<label style="padding-right: 10px;"><input name="account_type" type="radio" value="0" checked="checked"/>{$lang['agent_login']} </label>
|
|
<label><input name="account_type" type="radio" value="1" />{$lang['sub_login']} </label>
|
|
</div>
|
|
<hr class="hr15">
|
|
<button class="layui-button" type="button" id="submit">{$lang['login']}</button>
|
|
<hr class="hr15" >
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
$(function () {
|
|
// 多语言切换
|
|
$('#language').change(function(){
|
|
var language = $('#language').val();
|
|
if(language == "cn" || language == "en"){
|
|
$.get("/login/lang?lang="+language,function(data){
|
|
location.reload();
|
|
})
|
|
}
|
|
});
|
|
// 提交登录
|
|
$('#submit').click(function(){
|
|
// 获取参数
|
|
var username = $('#username').val();
|
|
var password = $('#password').val();
|
|
var code = $('#code').val();
|
|
var account_type = $('#account_type input[name="account_type"]:checked ').val();
|
|
// 验证参数
|
|
if(username.length == 0){
|
|
layer.msg(lang.empty_username);
|
|
return false;
|
|
}
|
|
if(password.length == 0){
|
|
layer.msg(lang.empty_password);
|
|
return false;
|
|
}
|
|
if(code.length == 0){
|
|
layer.msg(lang.empty_validateCode);
|
|
return false;
|
|
}
|
|
if(account_type.length == 0){
|
|
layer.msg(lang.choose_account_type);
|
|
return false;
|
|
}
|
|
|
|
// 发送数据给后台
|
|
var query = new Object();
|
|
query.username = username;
|
|
query.password = password;
|
|
query.code = code;
|
|
query.account_type = account_type;
|
|
$.ajax({
|
|
url:'/login/dologin',
|
|
data:query,
|
|
type:'POST',
|
|
dataType:'JSON',
|
|
success:function(data){
|
|
if(data.code == 0){
|
|
layer.msg(data.msg);
|
|
$('#validateCode').trigger('click');
|
|
}else if(data.code == 1){
|
|
location.href = data.url;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
</script>
|
|
<!-- 底部结束 -->
|
|
</body>
|
|
</html>
|