|
@@ -1,11 +1,13 @@
|
|
|
package com.fdkankan.fusion.controller;
|
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
import com.fdkankan.fusion.common.enums.RoleKeyEnum;
|
|
|
import com.fdkankan.fusion.entity.TmRole;
|
|
|
import com.fdkankan.fusion.service.ITmRoleService;
|
|
|
+import com.fdkankan.fusion.service.ITmUserRoleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -25,13 +27,19 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class TmRoleController {
|
|
|
|
|
|
@Autowired
|
|
|
- private ITmRoleService roleService;
|
|
|
+ private ITmRoleService tmRoleService;
|
|
|
+ @Autowired
|
|
|
+ private ITmUserRoleService tmUserRoleService;
|
|
|
|
|
|
@GetMapping("/getAllRoleList")
|
|
|
public ResultData getAllRoleList(){
|
|
|
LambdaQueryWrapper<TmRole> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.ne(TmRole::getRoleKey, RoleKeyEnum.ADMIN_SUPER.getKey());
|
|
|
- return ResultData.ok(roleService.list(wrapper));
|
|
|
+ TmRole tmRole = tmRoleService.getByUserId((String) StpUtil.getLoginId());
|
|
|
+ if(!tmRole.getRoleKey().equals(RoleKeyEnum.ADMIN_SUPER.getKey())){
|
|
|
+ wrapper.ne(TmRole::getRoleKey, RoleKeyEnum.ADMIN.getKey());
|
|
|
+ }
|
|
|
+ return ResultData.ok(tmRoleService.list(wrapper));
|
|
|
}
|
|
|
}
|
|
|
|