mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
加了角色的赋值
This commit is contained in:
@@ -44,9 +44,24 @@ public class UserData {
|
|||||||
private String orgNamePath;
|
private String orgNamePath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户类型,1表学员,2表教师,3表管理员
|
* 用户类型,1表学员,2表教师,3表管理员 此在这只默认只表学员
|
||||||
*/
|
*/
|
||||||
private Integer userType;
|
private Integer userType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表教师 是为1
|
||||||
|
* */
|
||||||
|
private Boolean teacher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表系统管理员 是为1
|
||||||
|
* */
|
||||||
|
private Boolean SysAdmin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表学习管理员 是为1
|
||||||
|
* */
|
||||||
|
private Boolean StudyAdmin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除的,如果是删除的,上面所有的字段可以不提供,只提供id就可以了
|
* 是否删除的,如果是删除的,上面所有的字段可以不提供,只提供id就可以了
|
||||||
|
|||||||
@@ -113,6 +113,20 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
|||||||
user.setName(result.get("realName").asText());
|
user.setName(result.get("realName").asText());
|
||||||
user.setOrgNamePath(result.get("orgNamePath").asText());
|
user.setOrgNamePath(result.get("orgNamePath").asText());
|
||||||
user.setUserType(1);//直接设置为学员
|
user.setUserType(1);//直接设置为学员
|
||||||
|
if(result.get("roleList")!=null){
|
||||||
|
JsonNode result1 = rootNode.get("result");
|
||||||
|
for(JsonNode jsonNode :result1) {
|
||||||
|
if(getNodeText(jsonNode.get("code")).equals("system-admin")){
|
||||||
|
user.setSysAdmin(true);
|
||||||
|
}
|
||||||
|
if(getNodeText(jsonNode.get("code")).equals("learning-admin")){
|
||||||
|
user.setStudyAdmin(true);
|
||||||
|
}
|
||||||
|
if(getNodeText(jsonNode.get("code")).equals("teacher")){
|
||||||
|
user.setTeacher(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(StringUtils.isBlank(user.getCode())) {
|
if(StringUtils.isBlank(user.getCode())) {
|
||||||
log.error("通过接口获取当前用户信息【"+user.getId()+"】"+user.getName()+",工号为空,不能使用");
|
log.error("通过接口获取当前用户信息【"+user.getId()+"】"+user.getName()+",工号为空,不能使用");
|
||||||
throw new RuntimeException("通过接口获取当前用户信息,工号为空,不能使用");
|
throw new RuntimeException("通过接口获取当前用户信息,工号为空,不能使用");
|
||||||
|
|||||||
Reference in New Issue
Block a user