[HttpGet, AllowAnonymous] //AllowAnonymous允许控制器匿名访问 public dynamic Update(int id = 0, string name = null) { var test = new Test() { Id = id, Name = name }; TestMapper mapper = new TestMapper(); mapper.Update(test); return(Success("操作成功")); }