$.ajax({
type : "post",
url : "${ctx}/admin/login",
data : {
"username" : username,
"password" : pass
},
dataType : "json",
success : function(data) {
if (data.ok) {
window.location.href = "${ctx}/admin/index";
dispose();
} else {
alert(data.message);
alert("用户名或者密码错误");
}
},
error : function(e) {
}
});
@At
@Ok("json")
public Object login(@Param("username") String username,
@Param("password") String password, Ioc ioc, HttpServletRequest req) {
NutMap re = new NutMap();
re.put("message", "接收不到用户名或者密码" + username + "==" + password);
if (username == null || password == null) {
re.put("message", "接收不到用户名或者密码" + username + "==" + password);
re.put("ok", false);
return re;
}
}