|
@@ -21,6 +21,7 @@ import cn.com.qmth.examcloud.commons.base.util.UUID;
|
|
|
import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.Role;
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
+import cn.com.qmth.examcloud.commons.web.security.enums.RoleMeta;
|
|
|
import cn.com.qmth.examcloud.core.basic.base.constants.PropKeys;
|
|
|
import cn.com.qmth.examcloud.core.basic.base.enums.AccountType;
|
|
|
import cn.com.qmth.examcloud.core.basic.base.enums.UserType;
|
|
@@ -170,11 +171,20 @@ public class AuthServiceImpl implements AuthService {
|
|
|
user.setRoleList(roleList);
|
|
|
}
|
|
|
|
|
|
+ Org org = null;
|
|
|
if (null != user.getOrgId()) {
|
|
|
- Org org = orgRepo.findOne(user.getOrgId());
|
|
|
+ org = orgRepo.findOne(user.getOrgId());
|
|
|
user.setOrgName(org.getName());
|
|
|
}
|
|
|
|
|
|
+ // 学习中心角色的用户
|
|
|
+ if (1 == user.getRoleList().size()
|
|
|
+ && user.getRoleList().get(0).getRoleCode().equals(RoleMeta.LC_USER)) {
|
|
|
+ if (null != org && !org.getEnable()) {
|
|
|
+ throw new StatusException("B-001008", "学习中心被禁用");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
setSession(user);
|
|
|
|
|
|
return user;
|