Explorar el Código

Merge branch 'test' into release-buffer

chenlei hace 1 año
padre
commit
b820601a20
Se han modificado 5 ficheros con 46 adiciones y 23 borrados
  1. 31 17
      README.md
  2. 0 1
      package.json
  3. 1 1
      src/configure.ts
  4. 13 3
      src/utils/hot.js
  5. 1 1
      yarn.lock

+ 31 - 17
README.md

@@ -70,30 +70,44 @@ yarn serve
 测试环境项目地址:https://scene.4dage.com/?m=1172
 
 ```bash
-mv .temp/* .
-
 scene=${SPUG_GIT_BRANCH%%/*}
-lastFileDir=$(ls -d -F /home/spug_backup/vue3-scene-web/* -t | grep '/$' | head -n 2 | tail -n 1)
 
 echo "当前场景值:$scene"
-echo "上一个部署目录:$lastFileDir"
 
-if [ -d "${lastFileDir}data/" ]
+if [ $SPUG_DEPLOY_TYPE == "2" ]
 then
-  echo "copy data file"
-  cp -r -n ${lastFileDir}data/ .
-fi
+  echo "开始回滚"
+  basename "$PWD"
+else
+  mv .temp/* .
 
-if [ -d "${lastFileDir}resources/web/" ]
-then
-  echo "copy resources file"
-  if [ $scene = "test" ]
+  fileCount=$(find /home/spug_backup/vue3-scene-web/* -maxdepth 0 -type d -printf '.' | wc -c)
+  echo "当前文件夹数量:$fileCount"
+
+  if [ ${fileCount} -gt 1 ]
   then
-    rsync -au --exclude=js --exclude=img --exclude=fonts --exclude=css ${lastFileDir}resources/web ./resources
-  else
-    rsync -au --exclude=$scene ${lastFileDir}resources/web ./resources
+    lastFileDir=$(ls -d -F /home/spug_backup/vue3-scene-web/* -t | grep '/$' | head -n 2 | tail -n 1)
+
+    echo "上一个部署目录:$lastFileDir"
+
+    if [ -d "${lastFileDir}data/" ]
+    then
+      echo "copy data file"
+      cp -rTn ${lastFileDir}data/ ./data
+    fi
+
+    if [ -d "${lastFileDir}resources/web/" ]
+    then
+      echo "copy resources file"
+      if [ $scene = "test" ]
+      then
+        rsync -rtvu --exclude=./js --exclude=./img --exclude=./fonts --exclude=./css ${lastFileDir}resources/web/ ./resources/web/
+      else
+        rsync -rtvu --exclude=$scene ${lastFileDir}resources/web/ ./resources/web/
+      fi
+    fi
   fi
-fi
 
-rm -r .temp
+  rm -r .temp
+fi
 ```

+ 0 - 1
package.json

@@ -51,7 +51,6 @@
     "lint-staged": "^11.1.2",
     "lodash-webpack-plugin": "^0.11.6",
     "node-polyfill-webpack-plugin": "^2.0.1",
-    "prettier": "^2.4.1",
     "sass": "^1.32.7",
     "sass-loader": "^12.0.0",
     "ts-jest": "^27.0.4",

+ 1 - 1
src/configure.ts

@@ -4,7 +4,7 @@ const urlParams = queryString.parse(location.search.slice(1));
 
 window.number = urlParams.m as string;
 
-if (!!performance) {
+if (performance) {
   window.navigationStart = performance.timing.navigationStart;
 } else {
   window.navigationStart = Date.now() + 300;

+ 13 - 3
src/utils/hot.js

@@ -784,7 +784,11 @@ window.initHot = function (model) {
 
         //addPoints(cornerPoint)
 
-        this.cornerPoints[player.currentPano.id] = { cornerPoint, diffLon, diffLat };
+        this.cornerPoints[player.currentPano.id] = {
+          cornerPoint,
+          diffLon,
+          diffLat,
+        };
 
         return this.cornerPoints[player.currentPano.id];
       }
@@ -917,14 +921,20 @@ window.initHot = function (model) {
         }
       } else if (state) {
         if (/* !isVideoPlayed(video) */ video.paused) {
-          console.log({ str: 'videoControl play ' + ', ' + this.sid, level: 1 });
+          console.log({
+            str: 'videoControl play ' + ', ' + this.sid,
+            level: 1,
+          });
           this.loadVideo(video);
           video.play();
           //video.currentTime = video.lastCurTime || 0
           this.changeOpaWhenPlay(video);
 
           if (isVideoPlayed(video))
-            console.log({ str: 'played ' + this.sid + video.duration, level: 1 });
+            console.log({
+              str: 'played ' + this.sid + video.duration,
+              level: 1,
+            });
         }
       }
     }

+ 1 - 1
yarn.lock

@@ -7882,7 +7882,7 @@ prettier-linter-helpers@^1.0.0:
   dependencies:
     fast-diff "^1.1.2"
 
-"prettier@^1.18.2 || ^2.0.0", prettier@^2.4.1:
+"prettier@^1.18.2 || ^2.0.0":
   version "2.7.1"
   resolved "https://registry.npmmirror.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
   integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==