Browse Source

Merge branch 'online' of http://git.dayaedu.com/yonge/cooleshow into zx_online_0913pdf

zouxuan 6 months ago
parent
commit
6d5cb60e37

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/TeacherController.java

@@ -127,6 +127,9 @@ public class TeacherController extends BaseController {
     @GetMapping("/queryHotTeacherList")
     public HttpResponseResult<List<HotTeacherVo>> queryHotTeacherList() {
         SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
         Long userId = null;
         if (user != null && null != user.getId()) {
             userId = user.getId();

+ 4 - 0
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/TokenController.java

@@ -49,6 +49,7 @@ import java.util.Base64;
 import java.util.Calendar;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
@@ -97,6 +98,9 @@ public class TokenController extends BaseController {
         if (authUser != null) {
             // 获取用户信息
             SysUser sysUser = userService.get(authUser.getUserId());
+            if (Objects.isNull(sysUser)) {
+                return null;
+            }
             // 获取用户机构信息
             sysUser.setTenantId(userService.getTenantByClient(authUser.getUserId(),authUser.getClientId()));
             return sysUser;

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -1200,8 +1200,8 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         }
 
         Student student = studentService.getById(userId);
-        Long subjectId = null;
-        if (student.getSubjectId() != null) {
+        Long subjectId = -1L;
+        if (student !=null && student.getSubjectId() != null) {
             subjectId = Long.parseLong(student.getSubjectId());
         }