|
|
@@ -1,7 +1,9 @@
|
|
|
package com.ydtech.modules.admin.controller;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.admin.model.dto.SysUserDto;
|
|
|
import com.ydtech.modules.admin.model.dto.SysUserLinkSysAddDto;
|
|
|
@@ -118,4 +120,34 @@ public class SysUserLinkSysController extends BaseController {
|
|
|
return HttpResult.error("查询错误"+e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2024/10/17 17:14
|
|
|
+ * @Description: 查询控制台用户是否授权
|
|
|
+ */
|
|
|
+ @GetMapping("authorizeByUserId")
|
|
|
+ @ApiOperation(value = "查看控制台用户是否授权")
|
|
|
+ public HttpResult<Boolean> authorizeByUserId(String userId) {
|
|
|
+ Boolean flag =false;
|
|
|
+ try{
|
|
|
+ if(StringUtils.isBlank(userId)){
|
|
|
+ throw new SystemException("用戶id为空!!");
|
|
|
+ }
|
|
|
+ if(userId.equals("admin")){
|
|
|
+ flag =true;
|
|
|
+ }else{
|
|
|
+ LambdaQueryWrapper<SysUserLinkSys> sysLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ sysLambdaQueryWrapper.eq(SysUserLinkSys::getUserId, userId);
|
|
|
+ sysLambdaQueryWrapper.eq(SysUserLinkSys::getSysId, "2");
|
|
|
+ List<SysUserLinkSys> list = sysUserLinkSysService.list(sysLambdaQueryWrapper);
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ flag =true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.ok(flag);
|
|
|
+ }catch (Exception e){
|
|
|
+ return HttpResult.error("查询错误"+e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|