//添加路由的格式 [Route("api/[controller]/[action]")] [ApiController] public class ggController : ControllerBase { /// <summary> /// 测试 /// </summary> /// <param name="dd"></param> /// <returns></returns> /// [HttpGet]//每个函数的请求方式 public ActionResult<string> ggAction(string dd) { return "Test"; } }
效果: