前端代码
async editResource(){
this.$refs.editFormRef.validate(async valid => {
const _this = this
if (!valid) return
if(this.editForm.parentId === '') this.editForm.parentId = 0
//为什么这里打印的与后台接收的不一样
console.log(_this.editForm)
const {data : res} =await role.editResource(_this.editForm)
if(res.code !== 20000) return this.$message.error(res.message)
this.editDialogVisible = false
await this.getResourceList()
this.$message.success('修改资源信息成功!')
})
}
后端代码
@PutMapping("update")
public R update(@RequestBody SysResourceVo sysResourceVo){
System.out.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,");
System.out.println(sysResourceVo);
return getResult(resourceService.updateResource(sysResourceVo));
}