This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reg.html
119 lines (115 loc) · 4.58 KB
/
reg.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="css/ripples.min.css" rel="stylesheet">
<link href="css/material-wfont.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<title>WiAuth</title>
<meta charset="utf-8">
</head>
<body>
<div id="header"></div>
<div class="content">
<div id="reg-success" class="alert alert-dismissable alert-success shadow-z-1">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>注册成功</h4>
<p>感谢您的注册,您现在可以登录安卓客户端享受我们的服务了~</p>
<a href="javascript:window.location.href = '/release.html';" class="btn btn-success">转到下载</a>
</div>
<div id="reg-error" class="alert alert-dismissable alert-danger shadow-z-1">
<button type="button" class="close" data-dismiss="alert">×</button>
<h4>注册失败</h4>
<p>这里是可能的错误信息:</p>
<p id="error"></p>
<a href="javascript:window.location.href = '/reg.html';" class="btn btn-danger">重新填写</a>
</div>
<div id="form" class="well">
<form class="form-horizontal">
<fieldset>
<legend>注册</legend>
<div class="form-group">
<label for="account" class="col-lg-2 control-label">用户名</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="account" id="account" placeholder="Account">
</div>
</div>
<div class="form-group">
<label for="password" class="col-lg-2 control-label">密码</label>
<div class="col-lg-10">
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
<input type="password" class="form-control" id="password-check" placeholder="Password Again">
</div>
</div>
<div class="form-group">
<label for="mobile" class="col-lg-2 control-label">手机号</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="mobile" id="mobile" placeholder="Mobile">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">性别</label>
<div class="col-lg-10">
<div class="radio radio-primary">
<label>
<input type="radio" name="sex" id="sexMale" value="1" checked=""> 男
</label>
</div>
<div class="radio radio-primary">
<label>
<input type="radio" name="sex" id="sexFemale" value="2"> 女
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="password" class="col-lg-2 control-label">协议</label>
<div class="col-lg-10">
<div class="checkbox">
<label>
<input type="checkbox" checked>我同意《WiAuth终端用户协议》
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button class="btn btn-default">Cancel</button>
<a class="btn btn-warning" id="submit" href="javascipt:void();">Submit</a>
</div>
</div>
</fieldset>
</form>
</div>
</div>
<div id="footer"></div>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="js/ripples.min.js"></script>
<script src="js/material.min.js"></script>
<script src="js/init.js"></script>
<script>
$('#reg-success').hide();
$('#reg-error').hide();
$('#submit').click(function() {
var url = 'http://wiauth.hackerchai.com/api/user/insert/';
url += 'account=' + $('#account').val();
url += '&password=' + $('#password').val();
url += '&mobile=' + $('#mobile').val();
url += '&sex=' + $('input[type=radio]:checked').val();
console.log(url);
$.get(url, {}, function(data) {
console.log(data);
console.log(data.err_code === 0);
if (data.err_code === "0") {
$('#form').fadeOut();
$('#reg-success').fadeIn();
} else {
$('#form').fadeOut();
$('#error').html('<p>' + data.err_msg + '</p>');
$('#reg-error').fadeIn();
}
}, 'json');
});
</script>
</body>
</html>