使用的是SpringBoot框架,部分代码如下JS代码:function login() {var userName = $("#inputName").val();var userPassword = $("#inputPassword").val();var rememberUser = $("input[type=checkbox]").get(0).checked;$.ajax({url : "login/userLogin",type : "post",dataType : "json",data : {"userName" : userName,"userPassword" : userPassword},success : function(result) {if (result.status == 1) {if (rememberUser) {addCookie("userName", userName, 30);} else {delCookie("userName");}window.location.href = "menu.html";} else if (result.status == 0) {alert(result.message);}}});return false;}Controller代码:@RequestMapping(value = "login/userLogin", method = RequestMethod.POST)@ResponseBodypublic Result login(User user) {Result result = userService.login(user);return result;}登录form提交后,每次都是显示返回的json,而不是跳转到menu.html,应该怎么改
添加回答
举报
0/150
提交
取消