$("#butn").click(function(){
$.ajax({
url: 'http://101.132.40.198:8181/login',
type: 'post',
data: {
username: document.getElementById('inp1').value,
password:document.getElementById('inp2').value,
},
success: function (data) {
console.log(JSON.parse(data));
window.open("http://127.0.0.1:5500/template/vip/vip.html")
},
error: function (error, Msgerror) {
console.log(Msgerror);
alert("密码账号错误")
}
})
})
// 登录
$("#butn1").click(function(){
$.ajax({
url: 'http://101.132.40.198:8181/register',
type: 'post',
data: {
username: document.getElementById('inp1').value,
password:document.getElementById('inp2').value,
},
success: function (data) {
console.log(JSON.parse(data));
console.log(document.getElementById('inp1').value);
alert("您已注册成功请登录")
},
error: function (error, Msgerror) {
console.log(Msgerror);
alert("您已注册请直接用账号密码登录")
}
})
})
登录注册AJAX
最新推荐文章于 2024-01-20 16:27:12 发布