更新 login.html
parent
f1abd66657
commit
ba0ad95e8d
|
|
@ -137,12 +137,18 @@
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify({username: email, password: password}),
|
data: JSON.stringify({username: email, password: password}),
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// 处理响应
|
if (response.code === "0" && response.msg === 'ok') {
|
||||||
console.log(response);
|
window.location.href = '/index'; // 确保这是正确的重定向 URL
|
||||||
|
} else {
|
||||||
|
alert("账号或密码错误");
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.href = '/login';
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
// 处理错误
|
window.location.href = '/error';
|
||||||
console.error(error);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -152,6 +158,11 @@
|
||||||
$('#login span').eq(1).click();
|
$('#login span').eq(1).click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.left').click(function() {
|
||||||
|
window.location.href = '/reg'; // 将 '/register' 替换为您的注册页面 URL
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue