| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.core.domain.entity.SysUserRole; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | |
| | | @Value("${isAdmin}") |
| | | private List<Long> isAdmin; |
| | | |
| | |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysRole role) { |
| | | startPage(); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | role.setOrgid(user.getOrgid()); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | return getDataTable(list); |
| | | } |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @Log(title = "角色管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysRole role) { |
| | | role.setOrgid(getLoginUser().getUser().getOrgid()); |
| | | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysRole role) { |
| | | role.setOrgid(getLoginUser().getUser().getOrgid()); |
| | | roleService.checkRoleAllowed(role); |