Kaynağa Gözat

fix(分辨率): 修复分辨率上报请求错误

zengzhixiang 2 yıl önce
ebeveyn
işleme
bfc0e2778a

+ 17 - 16
static/screenAndroid/WXtrialInterface.html

@@ -1641,22 +1641,6 @@
       //   centeredSlides: true,
       // });
       function setPhoneSize(config) {
-        $.ajax({
-          url:
-            baseUrl +
-            '/api/resources/v5/machine/resolution/operationResolvingPower',
-          headers: {
-            Authorization: token,
-          },
-          type: 'post',
-          dataType: 'json',
-          data: {
-            userCardId: window.userCardId,
-            width: config.width,
-            height: config.height,
-            resolvingPowerId: config.id,
-          },
-        });
         wsss.send(
           JSON.stringify({
             type: 'setPhoneSize',
@@ -1678,6 +1662,23 @@
             },
           }),
         );
+        $.ajax({
+          url:
+            baseUrl +
+            '/api/resources/v5/machine/resolution/operationResolvingPower',
+          headers: {
+            Authorization: token,
+          },
+          type: 'post',
+          dataType: 'json',
+          contentType: 'application/json; charset=UTF-8',
+          data: JSON.stringify({
+            userCardId: window.userCardId,
+            width: config.width,
+            height: config.height,
+            resolvingPowerId: config.id,
+          }),
+        });
         window.currentPhoneSize = config;
       }
       // wsss.addEventListener('message', function (event) {

+ 19 - 17
static/screenIos/WXtrialInterface.html

@@ -1430,23 +1430,6 @@
       //   centeredSlides: true,
       // });
       function setPhoneSize(config) {
-        // 上报分辨率
-        $.ajax({
-          url:
-            baseUrl +
-            '/api/resources/v5/machine/resolution/operationResolvingPower',
-          headers: {
-            Authorization: token,
-          },
-          type: 'post',
-          dataType: 'json',
-          data: {
-            userCardId: window.userCardId,
-            width: config.width,
-            height: config.height,
-            resolvingPowerId: config.id,
-          },
-        });
         // 修改云机分辨率
         wsss.send(
           JSON.stringify({
@@ -1470,6 +1453,25 @@
             },
           }),
         );
+        // 上报分辨率
+        $.ajax({
+          url:
+            baseUrl +
+            '/api/resources/v5/machine/resolution/operationResolvingPower',
+          headers: {
+            Authorization: token,
+          },
+          type: 'post',
+          dataType: 'json',
+          contentType: 'application/json; charset=UTF-8',
+          data: JSON.stringify({
+            userCardId: window.userCardId,
+            width: config.width,
+            height: config.height,
+            resolvingPowerId: config.id,
+          }),
+        });
+
         window.currentPhoneSize = config;
       }
       // wsss.addEventListener('message', function (event) {