增加本地控制

This commit is contained in:
daihh
2023-01-12 12:40:40 +08:00
parent 91c7381687
commit 84faeb4eaa

View File

@@ -87,41 +87,42 @@ public class PortalConsoleApi extends ApiBaseController{
} }
} }
//检查是否是教师,并计算用户的类型,修改于220507 //检查是否是教师,并计算用户的类型,修改于220507
Teacher t = teacherService.get(account.getId());
int utype=1,ttype=0; // Teacher t = teacherService.get(account.getId());
//本地判断是否是管理员 // int utype=1,ttype=0;
if(user.getUserType()!=null && user.getUserType()==3) { // //本地判断是否是管理员
utype=3; // if(user.getUserType()!=null && user.getUserType()==3) {
} // utype=3;
//判断是否是老师 // }
if(t!=null && (t.getDeleted()==null || !t.getDeleted())) { // //判断是否是老师
ttype=2; // if(t!=null && (t.getDeleted()==null || !t.getDeleted())) {
} // ttype=2;
if(utype==3) { // }
if(ttype==2) { // if(utype==3) {
utype=5;//是管理员,又是教师 // if(ttype==2) {
} // utype=5;//是管理员,又是教师
}else { // }
if(ttype==2) { // }else {
utype=2; // if(ttype==2) {
} // utype=2;
} // }
// }
//以下是使用的接口数据判断身份 //以下是使用的接口数据判断身份
// int utype=1;//仅仅是学员 int utype=1;//仅仅是学员
// if(userData!=null) { if(userData!=null) {
//
// if(userData.getTeacher()) { if(userData.getTeacher()) {
// utype=2; utype=2;
// } }
// if(userData.getAdminType()>0) { if(userData.getAdminType()>0) {
// if(utype==2) { if(utype==2) {
// utype=5;//是管理员,又是教师 utype=5;//是管理员,又是教师
// }else { }else {
// utype=3; utype=3;
// } }
// } }
// } }
map.put("aid",account.getId()); map.put("aid",account.getId());
map.put("sysId",user.getSysId()); map.put("sysId",user.getSysId());
@@ -132,7 +133,12 @@ public class PortalConsoleApi extends ApiBaseController{
map.put("sex",user.getGender()); map.put("sex",user.getGender());
map.put("userNo",user.getUserNo()); map.put("userNo",user.getUserNo());
map.put("showHome",user.getShowHome()==null? true:user.getShowHome()); map.put("showHome",user.getShowHome()==null? true:user.getShowHome());
map.put("userType",utype); if(isLocalDevelopment()) {
map.put("userType",3);
}else {
map.put("userType",utype);
}
map.put("departId",user.getDepartId()); map.put("departId",user.getDepartId());
map.put("sign",user.getSign()); map.put("sign",user.getSign());
map.put("departName",departName); map.put("departName",departName);