Selaa lähdekoodia

服务号授权的,缺mpOpenId的重新登录

三七 6 päivää sitten
vanhempi
commit
ace37508ca

+ 6 - 4
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1174,10 +1174,6 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 return R.error("会员被停用,无权限,请联系客服!");
             }
 
-            if (StringUtil.strIsNullOrEmpty(user.getMpOpenId())){
-                return R.error(401,"授权后可继续!");
-            }
-
             FsCourseWatchLog watchLog = new FsCourseWatchLog();
 
             // 根据链接类型判断是否已发放奖励
@@ -1216,6 +1212,12 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             // 获取配置信息
             String json = configService.selectConfigByKey("course.config");
             CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+
+            //服务号授权的,缺mpOpenId的重新登录
+            if (config.getMiniAppAuthType()==2 && StringUtil.strIsNullOrEmpty(user.getMpOpenId())){
+                return R.error(401,"授权后可继续!");
+            }
+
             log.info("奖励类型:{}", config.getRewardType());
             // 根据奖励类型发放不同奖励
             switch (config.getRewardType()) {