mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 03:16:48 +08:00
修改身份切换,改回到本地数据为准
This commit is contained in:
@@ -15,7 +15,6 @@ import com.xboe.core.CurrentUser;
|
||||
import com.xboe.core.IAuthorizationToken;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.data.dto.UserData;
|
||||
import com.xboe.data.outside.IOutSideDataService;
|
||||
import com.xboe.module.teacher.entity.Teacher;
|
||||
import com.xboe.module.teacher.service.ITeacherService;
|
||||
@@ -67,11 +66,11 @@ public class PortalConsoleApi extends ApiBaseController{
|
||||
return error("账号错误,无此账号");
|
||||
}
|
||||
|
||||
UserData userData = outsideDataService.getUserInfoByUserId(null);
|
||||
if(userData==null) {
|
||||
log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户");
|
||||
return error("未能获取当前用户信息");
|
||||
}
|
||||
// UserData userData = outsideDataService.getUserInfoByUserId(null);
|
||||
// if(userData==null) {
|
||||
// log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户");
|
||||
// return error("未能获取当前用户信息");
|
||||
// }
|
||||
|
||||
User user = userService.get(getCurrent().getAccountId());
|
||||
Organization org = null;
|
||||
@@ -87,42 +86,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.getTeacher()) {
|
||||
utype=2;
|
||||
Teacher t = teacherService.get(account.getId());
|
||||
int utype=1,ttype=0;
|
||||
//本地判断是否是管理员
|
||||
if(user.getUserType()!=null && user.getUserType()==3) {
|
||||
utype=3;
|
||||
}
|
||||
if(userData.getAdminType()>0) {
|
||||
if(utype==2) {
|
||||
//判断是否是老师
|
||||
if(t!=null && (t.getDeleted()==null || !t.getDeleted())) {
|
||||
ttype=2;
|
||||
}
|
||||
if(utype==3) {
|
||||
if(ttype==2) {
|
||||
utype=5;//是管理员,又是教师
|
||||
}else {
|
||||
utype=3;
|
||||
}
|
||||
}else {
|
||||
if(ttype==2) {
|
||||
utype=2;
|
||||
}
|
||||
}
|
||||
|
||||
// int utype=1;//仅仅是学员
|
||||
// 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.getAdminType());//管理员类型,1表默认管理员,2表非默认管理员,0表不是管理员
|
||||
//map.put("adminType",0);
|
||||
//map.put("adminType",userData.getAdminType());//管理员类型,1表默认管理员,2表非默认管理员,0表不是管理员
|
||||
map.put("adminType",0);
|
||||
map.put("companyId",user.getCompanyId());
|
||||
map.put("name",user.getName());
|
||||
map.put("sex",user.getGender());
|
||||
|
||||
Reference in New Issue
Block a user