Compare commits
36 Commits
gaoyating_
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
5429b8a276 | 4 months ago |
|
|
8c7fcb48d7 | 4 months ago |
|
|
9466d76e7b | 4 months ago |
|
|
e7fb44ce43 | 4 months ago |
|
|
6ca1d78fcc | 4 months ago |
|
|
3c69e45ab0 | 4 months ago |
|
|
854c5a0c1a | 4 months ago |
|
|
5d3425e0fb | 4 months ago |
|
|
412763bd16 | 4 months ago |
|
|
7b8d5b3f53 | 4 months ago |
|
|
152b077acc | 4 months ago |
|
|
ba5c2e9d9d | 4 months ago |
|
|
119783c84b | 4 months ago |
|
|
a454211f48 | 4 months ago |
|
|
17d4dc0297 | 4 months ago |
|
|
6661006a76 | 4 months ago |
|
|
102b9f04fa | 4 months ago |
|
|
4e8bf620d0 | 4 months ago |
|
|
9927d5fb6d | 4 months ago |
|
|
da72c6601b | 4 months ago |
|
|
43724ea79e | 4 months ago |
|
|
5626df6da9 | 4 months ago |
|
|
42c944d01a | 4 months ago |
|
|
b69f3ee11e | 4 months ago |
|
|
0c81b1d8e6 | 4 months ago |
|
|
f151ad5677 | 4 months ago |
|
|
abe9e8542d | 4 months ago |
|
|
cfba176670 | 4 months ago |
|
|
f0b960b318 | 4 months ago |
|
|
01e1b99bea | 4 months ago |
|
|
05077c728a | 4 months ago |
|
|
5fd2f68367 | 4 months ago |
|
|
d4b5f6714c | 4 months ago |
|
|
bbce2dfd51 | 4 months ago |
|
|
28d93ca53c | 4 months ago |
|
|
de6fb1df4f | 4 months ago |
@ -1,51 +1,51 @@
|
||||
// 页面DOM加载完成后执行初始化操作
|
||||
$(document).ready(function(){
|
||||
getCode();
|
||||
var h=$(window).height();
|
||||
$("#main").css("height",h);
|
||||
$("#loginBtn").click(function(){
|
||||
login();
|
||||
})
|
||||
$("#code").click(function(){
|
||||
getCode();
|
||||
})
|
||||
getCode();
|
||||
var h=$(window).height();
|
||||
$("#main").css("height",h);
|
||||
$("#loginBtn").click(function(){
|
||||
login();
|
||||
})
|
||||
$("#code").click(function(){
|
||||
getCode();
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
//获取验证码
|
||||
function getCode(){
|
||||
$("#code").attr("src","./user/createImage?code="+Math.random());
|
||||
$("#code").attr("src","./user/createImage?code="+Math.random());
|
||||
}
|
||||
|
||||
//登录
|
||||
function login(){
|
||||
var user=$("#inputName").val();
|
||||
var pwd=$("#inputPassword").val();
|
||||
var code=$("#inputCode").val();
|
||||
// 发起AJAX登录请求
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"./user/login.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":user,
|
||||
"password":pwd,
|
||||
"icode":code
|
||||
},
|
||||
// 请求成功的回调函数(后端返回数据后执行)
|
||||
success:function(data){
|
||||
console.log(data)
|
||||
if(data.code=="0"){
|
||||
var urlString="pages/myCenter.html?power="+data.power+"&userid="+data.userid;
|
||||
window.location.href=urlString;
|
||||
}
|
||||
else if(data.code=="-1"){
|
||||
alert("验证码或密码错误")
|
||||
}
|
||||
},
|
||||
// 请求失败的回调函数(网络错误或接口异常时执行)
|
||||
error:function(){
|
||||
alert("登录 发生错误");
|
||||
}
|
||||
});
|
||||
var user=$("#inputName").val();
|
||||
var pwd=$("#inputPassword").val();
|
||||
var code=$("#inputCode").val();
|
||||
// 发起AJAX登录请求
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"./user/login.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":user,
|
||||
"password":pwd,
|
||||
"icode":code
|
||||
},
|
||||
// 请求成功的回调函数(后端返回数据后执行)
|
||||
success:function(data){
|
||||
console.log(data)
|
||||
if(data.code=="0"){
|
||||
var urlString="pages/myCenter.html?power="+data.power+"&userid="+data.userid;
|
||||
window.location.href=urlString;
|
||||
}
|
||||
else if(data.code=="-1"){
|
||||
alert("验证码或密码错误")
|
||||
}
|
||||
},
|
||||
// 请求失败的回调函数(网络错误或接口异常时执行)
|
||||
error:function(){
|
||||
alert("登录 发生错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
Loading…
Reference in new issue