🐛 Fixing a bug. #753 413 (Request Entity Too Large)

This commit is contained in:
冷冷 committed 2020-02-10 22:29:27 +08:00
1 parent f0d18f82d5
commit 934f2ec361
2 files changed
+46 -6

No files matched your search

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.admin.api.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author lengleng
* @date 2020/2/10
*/
@Data
@ApiModel(value = "前端角色展示对象")
public class RoleVo {
/**
* 角色id
*/
private Integer roleId;
/**
* 菜单列表
*/
private String menuIds;
}
@@ -22,6 +22,7 @@ package com.pig4cloud.pigx.admin.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.admin.api.entity.SysRole;
import com.pig4cloud.pigx.admin.api.vo.RoleVo;
import com.pig4cloud.pigx.admin.service.SysRoleMenuService;
import com.pig4cloud.pigx.admin.service.SysRoleService;
import com.pig4cloud.pigx.common.core.util.R;
@@ -36,7 +37,7 @@ import java.util.List;
/**
* @author lengleng
* @date 2017/11/5
* @date 2020-02-10
*/
@RestController
@AllArgsConstructor
@@ -120,16 +121,16 @@ public class SysRoleController {
/**
* 更新角色菜单
*
* @param roleId 角色ID
* @param menuIds 菜单ID拼成的字符串,每个id之间根据逗号分隔
* @param roleVo 角色对象
* @return success、false
*/
@SysLog("更新角色菜单")
@PutMapping("/menu")
@PreAuthorize("@pms.hasPermission('sys_role_perm')")
public R saveRoleMenus(Integer roleId, @RequestParam(value = "menuIds", required = false) String menuIds) {
SysRole sysRole = sysRoleService.getById(roleId);
return R.ok(sysRoleMenuService.saveRoleMenus(sysRole.getRoleCode(), roleId, menuIds));
public R saveRoleMenus(@RequestBody RoleVo roleVo) {
SysRole sysRole = sysRoleService.getById(roleVo.getRoleId());
return R.ok(sysRoleMenuService.saveRoleMenus(sysRole.getRoleCode()
, roleVo.getRoleId(), roleVo.getMenuIds()));
}
/**