lyhzzz 2 years ago
parent
commit
e38efaf59e

+ 11 - 9
src/main/java/com/fdkankan/ucenter/controller/app/SceneApiController.java

@@ -42,6 +42,8 @@ public class SceneApiController {
     @Autowired
     IScenePlusService scenePlusService;
     @Autowired
+    IScenePlusExtService scenePlusExtService;
+    @Autowired
     IUserService userService;
     @Autowired
     LoginService loginService;
@@ -97,6 +99,8 @@ public class SceneApiController {
         }
         Long userId = scene == null ? scenePlus.getUserId() : scene.getUserId();
 
+        String webSite = scene == null ? scenePlusExtService.getByPlusId(scenePlus.getId()).getWebSite()  : scene.getWebSite();
+
         if(StringUtils.isNotEmpty(childName)){
             Camera cameraEntity = cameraService.getByChildName(childName);
             if(cameraEntity != null){
@@ -178,22 +182,20 @@ public class SceneApiController {
         String token = JwtUtil.createJWT(-1, ssoUser.getUserName(),"user");
         loginService.redisLogin(ssoUser.getUserName(),JSONObject.toJSONString(ssoUser));
         //登录成功
-        if(scene.getWebSite().contains(sceneProUrl)){
+        if(webSite.contains(sceneProUrl)){
             response.sendRedirect(mainUrl + sceneProUrl.replace("show", "edit").replace("PC", "Mobile") +
                     sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
                     (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
         }
 
-        if(scene.getIsUpgrade() != null && scene.getIsUpgrade() == 1){
-            if(scene.getWebSite().contains(sceneProV4Url)){
-                response.sendRedirect(mainUrl + sceneProV4Url.replace("s", "e") +
-                        sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
-                        (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
-                return;
-            }
+        if(webSite.contains(sceneProV4Url)){
+            response.sendRedirect(mainUrl + sceneProV4Url.replace("s", "e") +
+                    sceneNum + "&t=" +System.currentTimeMillis() + "&token=" + token + "&app" +
+                    (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));
+            return;
         }
 
-        if(scene.getWebSite().contains(sceneProNewUrl)) {
+        if(webSite.contains(sceneProNewUrl)) {
             response.sendRedirect(mainUrl + sceneProNewUrl.replace("s", "e") +
                     sceneNum + "&t=" + System.currentTimeMillis() + "&token=" + token + "&app" +
                     (lang == null ? "" : "&lang=" + lang) + (vlog == null ? "" : "&vlog=" + vlog));