Skip to content
Snippets Groups Projects
Commit 04411fed authored by Alex Xin's avatar Alex Xin
Browse files
parents a0d46213 4ad4d81f
No related branches found
No related tags found
No related merge requests found
...@@ -69,27 +69,23 @@ function submitEditForm() { ...@@ -69,27 +69,23 @@ function submitEditForm() {
//退出登录 //退出登录
// quitLoginClick(); // quitLoginClick();
$.ajax({
$.confirm({ type: 'post',
title : '', url: 'LoginServlet',
content : 'Succeffully Modify the Password !', data: {
autoClose : 'ok|3000', "type": "logout"
type : 'green',
buttons : {
ok : {
text : 'Yes',
btnClass : 'btn-primary',
keys : [ 'enter', 'a' ],
action : function() {
//点击登录
$('#loginBtn').click();
}
}, },
cancel : { dataType: 'text',
text : 'No', success: function(data){
btnClass : 'btn-primary', if(data == "logout"){
keys : [ 'ESC' ], window.location.href="index.html";
} else{
alert("no user now");
} }
},
error : function(msg) {
alert("logout failed");
console.log(msg)
} }
}); });
}else{ }else{
......
...@@ -184,26 +184,6 @@ function confirmToLogin(){ ...@@ -184,26 +184,6 @@ function confirmToLogin(){
}); });
} }
// function checkLoginState(){
// var strcookie = document.cookie;
// if(strcookie==null || strcookie.length==0){
// //alert("no login");
// $("#loginbtn").show();
// $("#logout").hide();
// //$("#toHomepage").hide();
// document.getElementById("toHomepage").style.display="none";
// } else{
// var userPhotoStr = strcookie.split(";")[1];
// var userPhoto = userPhotoStr.split("=")[1];
// if(userPhoto=="null") userPhoto="https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3439779931,834673929&fm=26&gp=0.jpg";
// $("#loginbtn").hide();
// $("#logout").show();
// //$("#toHomepage").show();
// document.getElementById("myPhoto").src = userPhoto;
// document.getElementById("toHomepage").style.display="inline";
// }
// }
function openHomepage(){ function openHomepage(){
window.location.href="person.html"; window.location.href="person.html";
} }
...@@ -228,29 +208,6 @@ function logout(){ ...@@ -228,29 +208,6 @@ function logout(){
} }
} }
}); });
// if(confirm("Sure to logout?")){
// $.ajax({
// type: 'post',
// url: 'LoginServlet',
// data: {
// "type": "logout"
// },
// dataType: 'text',
// success: function(data){
// if(data == "logout"){
// //window.location.href="register.jsp";
// window.location.href="index.html";
// } else{
// alert("no user now");
// }
// },
// error : function(msg) {
// alert("logout failed");
// console.log(msg)
// }
// });
// }
} }
//Logout without confirm //Logout without confirm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment