2024-05-08 11:01:54 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Web;
|
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
using System.Web.Routing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WebApi
|
|
|
|
|
|
{
|
2026-02-10 15:41:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 路由配置
|
|
|
|
|
|
/// </summary>
|
2024-05-08 11:01:54 +08:00
|
|
|
|
public class RouteConfig
|
|
|
|
|
|
{
|
2026-02-10 15:41:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 路由控制器-方法-参数
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="routes"></param>
|
2024-05-08 11:01:54 +08:00
|
|
|
|
public static void RegisterRoutes(RouteCollection routes)
|
|
|
|
|
|
{
|
|
|
|
|
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
|
|
|
|
|
|
|
|
|
|
routes.MapRoute(
|
|
|
|
|
|
name: "Default",
|
|
|
|
|
|
url: "{controller}/{action}/{id}",
|
|
|
|
|
|
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|