-
Notifications
You must be signed in to change notification settings - Fork 10
/
RouteConfig.cs
43 lines (39 loc) · 1.65 KB
/
RouteConfig.cs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Web.Mvc;
using System.Web.Routing;
using MVCForum.Domain.Constants;
namespace MVCForum.Website
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
RouteTable.Routes.LowercaseUrls = true;
RouteTable.Routes.AppendTrailingSlash = true;
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
// API Attribute Routes
//routes.MapMvcAttributeRoutes();wechatconnect
routes.MapRoute(
"wechatconnect", // Route name
"wechatconnect", // URL with parameters
new { controller = "Wechat", action = "CallBack", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"weiboconnect", // Route name
"weiboconnect", // URL with parameters
new { controller = "Weibo", action = "CallBack", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"qqconnect", // Route name
"qqconnect", // URL with parameters
new { controller = "QQOAuth", action = "CallBack", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
//.RouteHandler = new SlugRouteHandler()
}
}
}