jt
2021-06-10 5d0d028456874576560552f5a5c4e8b801786f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Newtonsoft.Json.Linq;
 
namespace HH.WMS.WebUI
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*allActiveReport}", new { allActiveReport = @".*\.ar12(/.*)?" });
            routes.MapRoute(
                name: "Default",//新建Route的名称    
                url: "{controller}/{action}/{id}",//主要的映射关系
                defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional },//默认参数,当映射不匹配时,会根据此参数进行Action匹配 
                namespaces: new[] { "HH.WMS.WebUI.Controllers" }
                );
            ModelBinders.Binders.Add(typeof(JObject), new JObjectModelBinder()); //for dynamic model binder
        }
    }
}