mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
提交
This commit is contained in:
@@ -114,6 +114,7 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
if(result!=null && result.isObject()) {
|
||||
//这里应该是单独的线程去处理
|
||||
user.setId(getNodeText(result.get("userId")));//最新接口变化,id改成userId
|
||||
log.info("用户的id="+user.getId());
|
||||
String band=getNodeText(result.get("bandCode"));
|
||||
if(StringUtils.isNotBlank(band) && band.length()>4) {
|
||||
String bandNum=band.substring(4);
|
||||
@@ -173,8 +174,10 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
JsonNode permission=permissionNodes.next();
|
||||
String permissionText=permission.asText();
|
||||
if("front-admin".equals(permissionText)) {
|
||||
log.info("用户是默认管理员");
|
||||
user.setAdminType(1);//设置为管理员,但是是非默认管理员
|
||||
}else if("front-teacher".equals(permissionText)) {
|
||||
log.info("用户有教师身份");
|
||||
user.setTeacher(true);//设置为教师
|
||||
}
|
||||
}
|
||||
@@ -209,7 +212,7 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
|
||||
|
||||
}
|
||||
//System.out.println("用户管理员:"+user.getAdminType());
|
||||
log.info("用户管理员:"+user.getAdminType());
|
||||
//System.out.println("老师:"+user.getTeacher());
|
||||
return user;
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -66,22 +66,24 @@ public class PortalConsoleApi extends ApiBaseController{
|
||||
UserData userData = outsideDataService.getUserInfoByUserId(null);
|
||||
if(userData==null) {
|
||||
log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户");
|
||||
//return error("未能获取当前用户信息");
|
||||
return error("未能获取当前用户信息");
|
||||
}
|
||||
|
||||
User user = userService.get(getCurrent().getAccountId());
|
||||
Organization org = null;
|
||||
|
||||
String departName = "";
|
||||
String departFullName = "";
|
||||
if(StringUtil.isNotBlank(user.getDepartId())) {
|
||||
org = organizationService.get(user.getDepartId());
|
||||
if(org!=null) {
|
||||
departName = org.getName();
|
||||
if(StringUtil.isNotBlank(org.getNamePath())) {
|
||||
departFullName = org.getNamePath().substring(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
String departFullName = userData.getOrgNamePath();
|
||||
|
||||
// Organization org = null;
|
||||
// if(StringUtil.isNotBlank(user.getDepartId())) {
|
||||
// org = organizationService.get(user.getDepartId());
|
||||
// if(org!=null) {
|
||||
// departName = org.getName();
|
||||
// if(StringUtil.isNotBlank(org.getNamePath())) {
|
||||
// departFullName = org.getNamePath().substring(1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//检查是否是教师,并计算用户的类型,修改于220507
|
||||
|
||||
// Teacher t = teacherService.get(account.getId());
|
||||
@@ -107,7 +109,7 @@ public class PortalConsoleApi extends ApiBaseController{
|
||||
//以下是使用的接口数据判断身份
|
||||
int utype=1;//仅仅是学员
|
||||
if(userData!=null) {
|
||||
if(userData.getTeacher()) {
|
||||
if(userData.getTeacher()!=null && userData.getTeacher()) {
|
||||
utype=2;
|
||||
}
|
||||
if(userData.getAdminType()>0) {
|
||||
|
||||
Reference in New Issue
Block a user