From 84faeb4eaa0c3652338e81270911cff858576f67 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 12 Jan 2023 12:40:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=AC=E5=9C=B0=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/api/PortalConsoleApi.java | 74 ++++++++++--------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java b/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java index 1d3cdbcb..1523278e 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java @@ -87,41 +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; - } - } + +// 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; -// } -// } -// } + 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()); @@ -132,7 +133,12 @@ public class PortalConsoleApi extends ApiBaseController{ map.put("sex",user.getGender()); map.put("userNo",user.getUserNo()); 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("sign",user.getSign()); map.put("departName",departName);