ctx 输出为nutzsite/
function login() {
console.log(ctx);
$.modal.loading($("#btnSubmit").data("loading"));
var username = $.common.trim($("input[name='username']").val());
var password = $.common.trim($("input[name='password']").val());
var validateCode = $("input[name='validateCode']").val();
var rememberMe = $("input[name='rememberme']").is(':checked');
$.ajax({
type: "post",
url: ctx + "login/login",
data: {
"username": username,
"password": password,
"validateCode" : validateCode,
"rememberMe": rememberMe,
"update": true
},
success: function(r) {
if (r.code == 0) {
location.href = 'index';
} else {
$.modal.closeLoading();
$('.imgcode').click();
$(".code").val("");
$.modal.msg(r.msg);
}
}
});
}
请求地址却变成 http://localhost:8080/nutzsite/nutzsite/login/login
404
这个问题 困扰我好久
怎么 解决好