Kaynağa Gözat

优化生成链接逻辑

yjwang 2 gün önce
ebeveyn
işleme
83a66fa3df

+ 12 - 5
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -359,18 +359,25 @@ public class FsUserCourseVideoController extends AppBaseController {
     @ApiOperation("获取登录小程id值")
     @GetMapping("/getLoginMiniAppId/{appId}")
     public ResponseResult getLoginMiniAppId(@PathVariable String appId){
+        if(appId == null){
+            return ResponseResult.fail(500,"操作失败APPID不能为空!");
+        }
+
+        //判断配置的appid是否为芳华惠选appid 如果配置了直接返回芳华惠选的appid
+        if(appId.equals(FANG_HUA_APP_ID)){
+            return ResponseResult.ok(appId);
+        }
+
         String json = configService.selectConfigByKey("course.config");
         if(null == json || com.hc.openapi.tool.util.StringUtils.isBlank(json)){
             ResponseResult.fail(500,"请先配置课程系统参数");
         }
+
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
-        //判断配置的appid是否为芳华惠选appid 如果配置了直接返回芳华惠选的appid
         if(null != config && StringUtils.isNotBlank(config.getLoginMiniAppId())){
-            String loginMiniAppId = config.getLoginMiniAppId();
-            if(FANG_HUA_APP_ID.equals(loginMiniAppId)){
-                return ResponseResult.ok(FANG_HUA_APP_ID);
-            }
+            return ResponseResult.ok(config.getLoginMiniAppId());
         }
+
         return ResponseResult.ok(appId);
     }