-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
193 lines (183 loc) · 9.08 KB
/
Copy pathindex.html
File metadata and controls
193 lines (183 loc) · 9.08 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<script type="text/javascript" src="static/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="static/js/Ajax.js"></script>
<link href="static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
<script src="static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<!--必要样式-->
<link rel="stylesheet" type="text/css" href="css/component.css" />
<!--[if IE]>
<script src="js/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container demo-1" style="width:100%;margin:0;padding:0;">
<div class="content">
<div id="large-header" class="large-header">
<canvas id="demo-canvas"></canvas>
<div class="logo_box">
<h3>寻觅</h3>
<form action="#" name="f" method="post">
<div class="input_outer">
<span class="u_user"></span>
<input name="logname" id="userId" class="text" style="color: #FFFFFF !important" type="text" placeholder="请输入账户">
</div>
<div class="input_outer">
<span class="us_uer"></span>
<input name="logpass" id="userPassword" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;"value="" type="password" placeholder="请输入密码">
</div>
<span style="text-align: center;display:block;">or by</span>
<hr></hr>
<div style="clear:both"></div>
<div>
<div style="margin:0 auto;text-align:center;">
<a target="view_window" href="https://github.com/login/oauth/authorize?client_id=83a32c0d2be1fba49911&redirect_uri=http://127.0.0.1:8080/webChat/user/loginByToken&state=github">
<img id="github" src="img/github.png" style="width:10%;cursor:pointer;"/>
</a>
</div>
</div>
<div class="mb2" style="cursor:pointer"><a class="act-but submit" id="login" style="color: #FFFFFF">登录</a></div>
<div class="mb2" style="cursor:pointer"><a class="act-but submit" id="registerBtn" style="color: #FFFFFF">注册</a></div>
</form>
</div>
</div>
</div>
</div><!-- /container -->
<div class="modal fade" id="register" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">注册</h4>
</div>
<div class="modal-body">
<form id="userInfo">
<div class="form-group" style="margin:auto;text-align:center">
<img src="img/bak.jpg" style="width:100px;height:100px;cursor:pointer;border-radius:50%;" id="userImgBtn">
</div>
<div class="form-group">
<input type="hidden" class="form-control" name="userImg" value="img/bak.jpg" id="userImg" placeholder="用户名">
</div>
<div class="form-group">
<label for="exampleInputEmail1">用户名</label>
<input type="text" class="form-control" name="userName" id="userName" placeholder="用户名">
</div>
<div class="form-group">
<label for="exampleInputPassword1">密码</label>
<input type="password" class="form-control" name="userPassword" id="userPassword1" placeholder="密码">
</div>
<div class="form-group">
<label for="exampleInputPassword1">确认密码</label>
<input type="password" class="form-control" id="userPasswordR" placeholder="确认密码">
<p hidden id="info" style="color:red;"></p>
</div>
<div class="form-group">
<label for="exampleInputPassword1">年龄</label>
<input type="text" class="form-control" name="userAge" id="userAge" placeholder="年龄">
</div>
<div class="form-group">
<label for="exampleInputPassword1">真实姓名</label>
<input type="text" class="form-control" name="userRealName" id="userRealName" placeholder="真实姓名">
</div>
<div class="form-group">
<label for="exampleInputPassword1">邮箱</label>
<input type="text" class="form-control" name="userEmail" id="userEmail" placeholder="邮箱">
</div>
<div class="form-group">
<label for="exampleInputPassword1">QQ</label>
<input type="text" class="form-control" name="userQq" id="userQq" placeholder="QQ">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="commit">注册</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="showInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" style="text-align:center"></h4>
</div>
</div>
</div>
</div>
<form id="fileUp">
<input type="file" accept="image/*" name="file" style="display:none" id="inputFile">
</form>
<script src="js/TweenLite.min.js"></script>
<script src="js/EasePack.min.js"></script>
<script src="js/rAF.js"></script>
<script src="js/demo-1.js"></script>
<script>
$("#userImgBtn").click(function(){
$('#inputFile').trigger('click');
});
$("#inputFile").change(function() {
var formData = new FormData($( "#fileUp" )[0]);
$.ajax({
url: 'http://127.0.0.1:8080/webChat/chat/upload' ,
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
success: function (res) {
$("#userImgBtn").attr("src",res.data);
$("#userImg").val(res.data);
},
error: function (returndata) {
alert(returndata);
}
});
})
$("#registerBtn").click(function(){
$("#register").modal("show");
});
$("#login").click(function(){
var userId = $("#userId").val();
var userPassword = $("#userPassword").val();
Ajax(
"POST","user/login",
{userName:userId,userPassword:userPassword},
function(res){
window.location.href="http://127.0.0.1/webChat/main.html";
},null
);
});
$('#userPasswordR').bind('input propertychange', function() {
var v1 = $("#userPasswordR").val();
var v2 = $("#userPassword1").val();
if(v1 != v2){
$("#info").html("两次密码不一致");
$("#info").show();
}else{
$("#info").hide();
}
});
$("#commit").click(function(){
Ajax(
"POST","user",
$("#userInfo").serializeJson(),
function(res){
$("#showInfo").showMsg(res.msg);
}
);
});
</script>
<div style="text-align:center;">
</div>
</body>
</html>