Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue Jul 19 10:29:44 CST 2022
There was an unexpected error (type=Bad Request, status=400).
Required request body is missing: public com.course.server.dto.PageDto com.course.business.controller.admin.ChapterController.list(com.course.server.dto.PageDto)
org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public com.course.server.dto.PageDto com.course.business.controller.admin.ChapterController.list(com.course.server.dto.PageDto)
vue:
<script>
export default {
name: "chapter",
data:function () {
return {
chapters:[]
}
},
mounted: function() {
let _this = this;
_this.list();
//sidebar 激活样式 方式一
// this.$parent.activeSidebar("business-chapter-sidebar");
},
methods: {
list() {
let _this = this;
_this.$ajax.post('http://127.0.0.1:9000/business/admin/chapter/list', {
page: 1,
size: 1
}).then((response)=>{
console.log("查询大章列表结果:", response);
_this.chapters = response.data.list;
})
}
}
}
</script>
ChapterController
@RestController
@RequestMapping("/admin/chapter")
public class ChapterController {
private static final Logger LOG = LoggerFactory.getLogger(ChapterController.class);
@Resource
private ChapterService chapterService;
@RequestMapping("/list")
public PageDto list(@RequestBody PageDto pageDto) {
LOG.info("pageDto: {}", pageDto);
chapterService.getList(pageDto);
return pageDto;
}
}