用户身份切换 成接口的

This commit is contained in:
daihh
2023-01-11 16:09:44 +08:00
parent ce6c9adf47
commit 3bf0f8de0c

View File

@@ -87,42 +87,42 @@ public class PortalConsoleApi extends ApiBaseController{
}
}
//检查是否是教师,并计算用户的类型,修改于220507
Teacher t = teacherService.get(account.getId());
int utype=1,ttype=0;
//本地判断是否是管理员
if(user.getUserType()!=null && user.getUserType()==3) {
utype=3;
}
//判断是否是老师
if(t!=null && (t.getDeleted()==null || !t.getDeleted())) {
ttype=2;
}
if(utype==3) {
if(ttype==2) {
utype=5;//是管理员,又是教师
}
}else {
if(ttype==2) {
utype=2;
}
}
//以下是使用的接口数据判断身份
// int utype=1;//仅仅是学员
// if(userData!=null) {
//
// if(userData.getTeacher()) {
// utype=2;
// }
// if(userData.getAdminType()>0) {
// if(utype==2) {
// utype=5;//是管理员,又是教师
// }else {
// Teacher t = teacherService.get(account.getId());
// int utype=1,ttype=0;
// //本地判断是否是管理员
// if(user.getUserType()!=null && user.getUserType()==3) {
// utype=3;
// }
// //判断是否是老师
// if(t!=null && (t.getDeleted()==null || !t.getDeleted())) {
// ttype=2;
// }
// if(utype==3) {
// if(ttype==2) {
// utype=5;//是管理员,又是教师
// }
// }else {
// if(ttype==2) {
// utype=2;
// }
// }
//以下是使用的接口数据判断身份
int utype=1;//仅仅是学员
if(userData!=null) {
if(userData.getTeacher()) {
utype=2;
}
if(userData.getAdminType()>0) {
if(utype==2) {
utype=5;//是管理员,又是教师
}else {
utype=3;
}
}
}
map.put("aid",account.getId());
map.put("sysId",user.getSysId());
map.put("adminType",userData==null? 0:userData.getAdminType());//管理员类型1表默认管理员2表非默认管理员0表不是管理员