mirror of
https://e.coding.net/circlecloud/MinecraftAccount.git
synced 2024-11-17 00:58:55 +00:00
9dfe8fa4a7
Signed-off-by: 502647092 <jtb1@163.com>
131 lines
3.8 KiB
HTML
131 lines
3.8 KiB
HTML
<extend name="Common:Banner" />
|
|
<block name="PageTitle">魔方 - 我的世界</block>
|
|
<block name="Body">
|
|
<div class="container">
|
|
<div class="register-box">
|
|
<div class="reg-slogan">
|
|
<font size="5" face="微软雅黑">用户登录</font>
|
|
</div>
|
|
<form class="form-horizontal" action="{:U('login','','')}" role="form" method="post">
|
|
<div class="form-group">
|
|
<label for="username" class="col-sm-offset-1 col-sm-3 control-label">用户名:</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control" id="username" name="username" placeholder="用户名" required />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="password" class="col-sm-offset-1 col-sm-3 control-label">密 码:</label>
|
|
<div class="col-sm-6">
|
|
<input type="password" class="form-control" id="password" name="password" placeholder="密码" required />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="checkpassword" class="col-sm-offset-1 col-sm-3 control-label">重复密码:</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control" id="checkpassword" name="checkpassword" placeholder="重复密码" required />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="verify" class="col-sm-offset-1 col-sm-3 control-label">邮 箱:</label>
|
|
<div class="col-sm-6">
|
|
<input type="text" class="form-control" id="verify" name="verify" placeholder="邮箱" required />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-sm-offset-3 col-sm-7">
|
|
<button id="submit" type="button" class="btn btn-primary btn-register">注册</button>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<p class="check-tips text-danger col-sm-offset-3 col-sm-7"></p>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$("#register").click(function() {
|
|
var RegexEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)*\w+$/;
|
|
var RegexUserName = /^[a-zA-Z0-9_?]*$/;
|
|
var username = $("#username");
|
|
var password = $("#password");
|
|
var email = $("#email");
|
|
if (username.val() == "") {
|
|
alert("用户名不能为空!");
|
|
return false
|
|
}
|
|
if (username.val().length < 3 || username.val().length > 16) {
|
|
alert("帐号长度不得低于3位或大于16位!");
|
|
return
|
|
}
|
|
if (!RegexUserName.test(username.val())) {
|
|
alert("帐号必须以小写字母+数字+下划线组成!");
|
|
return
|
|
}
|
|
if (pass.val() == "") {
|
|
alert("密码不能为空!");
|
|
return false
|
|
}
|
|
if (pass.val().length < 6) {
|
|
alert("密码强度不能低于6位!");
|
|
return false
|
|
}
|
|
if (email.val() == "") {
|
|
alert("邮箱不能为空!");
|
|
return false
|
|
}
|
|
if (!RegexEmail.test(email.val())) {
|
|
alert("邮箱格式不正确!");
|
|
$('#email').val("");
|
|
return false
|
|
}
|
|
$.ajax({
|
|
url: "{:U('User/Check')}",
|
|
type: "GET",
|
|
data: {
|
|
user: username.val()
|
|
},
|
|
dataType: "json",
|
|
success: function(rdata) {
|
|
switch (rdata.status) {
|
|
case 1:
|
|
$.ajax({
|
|
url: "{:U('Mail/Check')}",
|
|
type: "GET",
|
|
data: {
|
|
mail: email.val()
|
|
},
|
|
dataType: "json",
|
|
success: function(s) {
|
|
switch (s.status) {
|
|
case 1:
|
|
$.ajax({
|
|
type: "POST",
|
|
data: {
|
|
user: username.val(),
|
|
pass: pass.val(),
|
|
mail: email.val()
|
|
},
|
|
dataType: "json",
|
|
url: "<?=Url('user_public','register')?>",
|
|
success: function(C) {
|
|
alert(C.info);
|
|
location.href = "<?=Url('index','index')?>"
|
|
}
|
|
}) break;
|
|
case 0:
|
|
alert(s.info);
|
|
return false
|
|
}
|
|
}
|
|
}) break;
|
|
case 0:
|
|
alert(rdata.info);
|
|
return false
|
|
}
|
|
},
|
|
error: function() {
|
|
alert("注册失败 请检查网络是否通畅!")
|
|
}
|
|
})
|
|
})
|
|
</script></block> |