在Controller上加上特性
[ApiController][Route("[controller]/[action]")]public class XXXXController : ControllerBase
必须要加上Route,否则会有如下提示:
xxx does not have an attribute route. Action methods on controllers annotated with ApiControllerAttribute must be attribute routed.