62,041
社区成员
发帖
与我相关
我的任务
分享
$('#loginForm').form('submit', {
url: '/Admin/Login',
onSubmit: function () {
},
success: function (data) {
data = $.parseJSON(data);
if (data.statusCode == "200") { location.href = "/Admin/Index"; }
else {
$.messager.alert('温馨提示', data.message, 'info', function () {
//status = true;
});
}
}
});
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "tt",
url: "tt/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
在 js 请求路径许改成
$('#loginForm').form('submit', {
url: '/tt/Admin/Login',
onSubmit: function () {
},
success: function (data) {
data = $.parseJSON(data);
if (data.statusCode == "200") { location.href = "/Admin/Index"; }
else {
$.messager.alert('温馨提示', data.message, 'info', function () {
//status = true;
});
}
}
});
@Url.Action("Login","Admin")
应该是这样,上面的写反了