修改 前端菜单 管理菜单,角色前后端分配 及通道创建失败的问题
This commit is contained in:
@@ -21,6 +21,7 @@ import com.xinda.framework.manager.factory.AsyncFactory;
|
||||
import com.xinda.framework.security.context.AuthenticationContextHolder;
|
||||
import com.xinda.system.service.ISysConfigService;
|
||||
import com.xinda.system.service.ISysDeptService;
|
||||
import com.xinda.system.service.ISysRoleService;
|
||||
import com.xinda.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
@@ -62,6 +63,8 @@ public class SysLoginService {
|
||||
@Resource
|
||||
private ISysDeptService sysDeptService;
|
||||
|
||||
@Resource
|
||||
private ISysRoleService sysRoleService;
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
@@ -175,9 +178,9 @@ public class SysLoginService {
|
||||
public String login(Long deptId,String username, String password, String code, String uuid, Integer sourceType, String language) {
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
// 验证码开关
|
||||
if (captchaEnabled) {
|
||||
validateCaptcha(username, code, uuid);
|
||||
}
|
||||
// if (captchaEnabled) {
|
||||
// validateCaptcha(username, code, uuid);
|
||||
// }
|
||||
// 用户验证
|
||||
Authentication authentication = null;
|
||||
try {
|
||||
@@ -205,6 +208,19 @@ public class SysLoginService {
|
||||
if (null != sourceType && 1 == sourceType && null == userDeptId) {
|
||||
throw new ServiceException("web端只允许租户登录!");
|
||||
}
|
||||
if (null != sourceType && 1 == sourceType && !SysUser.isAdmin(loginUser.getUserId())) {
|
||||
int msize = sysRoleService.selectRoleByUserIdAndIm(loginUser.getUserId()).size();
|
||||
if(msize==0){
|
||||
throw new ServiceException("该用户无管理端权限!");
|
||||
}
|
||||
|
||||
}else if(null != sourceType && 0 == sourceType && !SysUser.isAdmin(loginUser.getUserId())){
|
||||
int bsize = sysRoleService.selectRoleByUserIdAndIb(loginUser.getUserId()).size();
|
||||
if(bsize==0){
|
||||
throw new ServiceException("该用户无前端权限!");
|
||||
}
|
||||
}
|
||||
|
||||
// if (!"admin".equals(loginUser.getUsername()) && null != sourceType) {
|
||||
// Long deptId = loginUser.getDeptId();
|
||||
// if (1 == sourceType && null == deptId) {
|
||||
|
||||
Reference in New Issue
Block a user