Parcourir la source

Merge branch 'release/v5.4.0' of Software/android-cloud-H5 into develop

zengzhixiang il y a 2 ans
Parent
commit
49eb333d62
2 fichiers modifiés avec 53 ajouts et 48 suppressions
  1. 27 24
      static/screenAndroid/WXdraw.js
  2. 26 24
      static/screenIos/WXdraw.js

+ 27 - 24
static/screenAndroid/WXdraw.js

@@ -154,7 +154,8 @@ function doConnectDirectives() {
             return;
           }
           case '4000': {
-            if (isAuth === 'huo') {
+            // 当前是获取方
+            if (isAuth === 'huo' && result.data.desc === "控制权限收回") {
               $.confirm(
                 '授权方已收回控制权,您进入观看屏幕模式',
                 function () {
@@ -169,36 +170,38 @@ function doConnectDirectives() {
               );
               return;
             }
+            if (!isControl && isAuth === 'shou') {
+              // 当前是授权方切没有控制权
+              $.confirm(
+                '当前云手机正在授控,是否请求获取云手机控制权?',
+                function () {
+                  //点击确认后的回调函数
+                  wsss.send(
+                    JSON.stringify({
+                      type: 'forwardMsg',
+                      data: {
+                        code: '5000',
+                        desc: '控制权限收回', // 可选
+                      },
+                    }),
+                  );
+                  changIsControl(true);
+                },
+                function () {
+                  //点击取消后的回调函数
+                  changIsControl(false);
+                },
+              );
 
-            $.confirm(
-              '当前云手机正在授控,是否请求获取云手机控制权?',
-              function () {
-                //点击确认后的回调函数
-                wsss.send(
-                  JSON.stringify({
-                    type: 'forwardMsg',
-                    data: {
-                      code: '5000',
-                      desc: '控制权限收回', // 可选
-                    },
-                  }),
-                );
-                changIsControl(true);
-              },
-              function () {
-                //点击取消后的回调函数
-                changIsControl(false);
-              },
-            );
-
-            return;
+              return;
+            }
           }
           case '5000': {
             // if (result.data.username === username) {
             //   changIsControl(true);
             //   return;
             // }
-            if (isAuth === 'huo') {
+            if (isAuth === 'huo' && result.data.desc === "控制权限收回") {
               $.confirm(
                 '授权方已收回控制权,您进入观看屏幕模式',
                 function () {

+ 26 - 24
static/screenIos/WXdraw.js

@@ -162,7 +162,7 @@ function doConnectDirectives() {
             return;
           }
           case '4000': {
-            if (isAuth === 'huo') {
+            if (isAuth === 'huo' && result.data.desc === "控制权限收回") {
               $.confirm(
                 '授权方已收回控制权,您进入观看屏幕模式',
                 function () {
@@ -177,29 +177,31 @@ function doConnectDirectives() {
               );
               return;
             }
-
-            $.confirm(
-              '当前云手机正在授控,是否请求获取云手机控制权?',
-              function () {
-                //点击确认后的回调函数
-                wsss.send(
-                  JSON.stringify({
-                    type: 'forwardMsg',
-                    data: {
-                      code: '5000',
-                      desc: '控制权限收回', // 可选
-                    },
-                  }),
-                );
-                changIsControl(true);
-              },
-              function () {
-                //点击取消后的回调函数
-                changIsControl(false);
-              },
-            );
-
-            return;
+            if (!isControl && isAuth === 'shou') {
+              // 当前是授权方切没有控制权
+              $.confirm(
+                '当前云手机正在授控,是否请求获取云手机控制权?',
+                function () {
+                  //点击确认后的回调函数
+                  wsss.send(
+                    JSON.stringify({
+                      type: 'forwardMsg',
+                      data: {
+                        code: '5000',
+                        desc: '控制权限收回', // 可选
+                      },
+                    }),
+                  );
+                  changIsControl(true);
+                },
+                function () {
+                  //点击取消后的回调函数
+                  changIsControl(false);
+                },
+              );
+  
+              return;
+            }
           }
           case '5000': {
             // if (result.data.username === username) {