فهرست منبع

本地化部署

任一存 2 سال پیش
والد
کامیت
70cd1f5a8c
15فایلهای تغییر یافته به همراه25 افزوده شده و 66 حذف شده
  1. 1 5
      .env
  2. 7 0
      .env.local
  3. 0 1
      .env.prod
  4. 1 6
      .env.proddev
  5. 2 7
      .env.testdev
  6. 0 9
      .env.testprod
  7. 2 2
      .gitignore
  8. 1 1
      package.json
  9. 3 8
      src/apis/index.js
  10. 0 3
      src/app.js
  11. 6 4
      src/pages/show.vue
  12. 0 1
      src/pages/showMobile.vue
  13. 0 3
      src/utils/config.js
  14. 0 13
      src/utils/debuggerHelper.js
  15. 2 3
      vue.config.js

+ 1 - 5
.env

@@ -1,8 +1,4 @@
 VUE_APP_STATIC_DIR=showviewer
 VUE_APP_CDN=https://4dkk.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
-VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_URL_FILL=
-
-# 接口请求地址
-VUE_APP_APIS_URL=https://test.4dkankan.com/
+VUE_APP_URL_FILL=

+ 7 - 0
.env.local

@@ -0,0 +1,7 @@
+NODE_ENV=production
+VUE_APP_STATIC_DIR=showviewer
+VUE_APP_CDN=../..
+VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
+VUE_APP_URL_FILL=https://www.4dkankan.com/qjkankan
+
+VUE_APP_CLI_MODE=local

+ 0 - 1
.env.prod

@@ -2,5 +2,4 @@ NODE_ENV=production
 VUE_APP_STATIC_DIR=showviewer
 VUE_APP_CDN=https://4dkk.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
-VUE_APP_PROXY_URL='https://www.4dkankan.com/qjkankan/'
 VUE_APP_URL_FILL=https://www.4dkankan.com/qjkankan

+ 1 - 6
.env.proddev

@@ -1,9 +1,4 @@
 VUE_APP_STATIC_DIR=showviewer
 VUE_APP_CDN=https://4dkk.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
-VUE_APP_PROXY_URL='https://www.4dkankan.com/qjkankan/'
-VUE_APP_URL_FILL=
-
-# 接口请求地址
-VUE_APP_APIS_URL=https://www.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0506-01
+VUE_APP_URL_FILL=

+ 2 - 7
.env.testdev

@@ -1,9 +1,4 @@
 VUE_APP_STATIC_DIR=showviewer
 VUE_APP_CDN=https://4dkk.4dage.com
-VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
-VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_URL_FILL=https://www.4dkankan.com/qjkankan
-
-# 接口请求地址
-VUE_APP_APIS_URL=https://test.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0425-01
+VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
+VUE_APP_URL_FILL=https://www.4dkankan.com/qjkankan

+ 0 - 9
.env.testprod

@@ -1,9 +0,0 @@
-NODE_ENV=production
-VUE_APP_STATIC_DIR=showviewer
-VUE_APP_CDN=https://ossxiaoan.4dage.com
-VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
-VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
-VUE_APP_URL_FILL=https://test.4dkankan.com/qjkankan
-# 接口请求地址
-VUE_APP_APIS_URL=https://test.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0507-01

+ 2 - 2
.gitignore

@@ -4,8 +4,8 @@ node_modules
 
 
 # local env files
-.env.local
-.env.*.local
+# .env.local
+# .env.*.local
 
 # Log files
 npm-debug.log*

+ 1 - 1
package.json

@@ -5,8 +5,8 @@
   "scripts": {
     "serve": "vue-cli-service serve --mode testdev",
     "serve-proddev": "vue-cli-service serve --mode proddev",
-    "build-testprod": "vue-cli-service build --mode testprod",
     "build-prod": "vue-cli-service build --mode prod",
+    "build-local": "vue-cli-service build --mode local",
     "lint": "vue-cli-service lint"
   },
   "dependencies": {

+ 3 - 8
src/apis/index.js

@@ -13,11 +13,6 @@ const HDNumber = function () {
   return config.hengdaNum;
 };
 
-let ossUrl = config.CDN;
-let fdkkURL = config.fdkkURL;
-
-
-const URL_FILL =  config.urlFill
 /**
  * 获取全景作品基本信息
  * @param {*} data
@@ -25,7 +20,7 @@ const URL_FILL =  config.urlFill
  * @param {*} no
  */
 export function getPanoInfo(ok, no) {
-  return http.get(`${ossUrl}/720yun_fd_manage/${number()}/someData.json?_=${Math.random()}`, {}, ok, no);
+  return http.get(`${process.env.VUE_APP_CDN}/720yun_fd_manage/${number()}/someData.json?_=${Math.random()}`, {}, ok, no);
 }
 
 /**
@@ -35,7 +30,7 @@ export function getPanoInfo(ok, no) {
  * @param {*} no
  */
  export function getFdkkInfo(data, ok, no) {
-  return http.get(`${fdkkURL}api/scene/getInfo?num=${data.num}&_=${Math.random()}`, {}, ok, no);
+  return http.get(`${process.env.VUE_APP_PROXY_URL_ROOT}/api/scene/getInfo?num=${data.num}&_=${Math.random()}`, {}, ok, no);
 }
 
 /**
@@ -45,5 +40,5 @@ export function getPanoInfo(ok, no) {
  * @param {*} no
  */
 export function checkWork(ok, no) {
-  return http.get(`${URL_FILL}/web/common/checkWork/${number()}?visit=1111`, {}, ok, no);
+  return http.get(`${process.env.VUE_APP_URL_FILL}/web/common/checkWork/${number()}?visit=1111`, {}, ok, no);
 }

+ 0 - 3
src/app.js

@@ -2,9 +2,6 @@ import QJKanKan from '@/sdk/QJKanKan'
 let _app
 let _num
 let deferred = QJKanKan.Deferred()
-import { debuggerHelper } from './utils/debuggerHelper'
-
-debuggerHelper(true);
 
 export function createApp(opitons = {}) {
     if (_app) {

+ 6 - 4
src/pages/show.vue

@@ -76,10 +76,12 @@ onMounted(async () => {
     );
     return;
   }
-  let res = await checkWork();
-  if (!res.data) {
-    workEnable.value = res.data;
-    return;
+  if (process.env.VUE_APP_CLI_MODE !==local) {
+    let res = await checkWork();
+    if (!res.data) {
+      workEnable.value = res.data;
+      return;
+    }
   }
   getPanoInfo().then(async (data) => {
     isShowOpeningAnimation.value = Number(data.isShowOpeningAnimation);

+ 0 - 1
src/pages/showMobile.vue

@@ -210,7 +210,6 @@ onMounted(async () => {
     document.body.setAttribute("is-mobile", true);
 
     const app = createApp({
-      // xml: "%HTMLPATH%/static/template/tour.xml",
       xml: `${process.env.VUE_APP_CDN}/720yun_fd_manage/${
         config.projectNum
       }/tour.xml?rnd=${Math.random()}`,

+ 0 - 3
src/utils/config.js

@@ -6,15 +6,12 @@ const config = {
      * 静态资源路径
      */
     staticURL: process.env.VUE_APP_STATIC_DIR,
-    urlFill:  process.env.VUE_APP_URL_FILL, 
     thumb:require('@/assets/images/default/img_cover_default.jpg'),
     noresult:require('@/assets/images/default/img_noresults@2x.png'),
     empty: require('@/assets/images/default/img_empty@2x.png'),
     projectNum: browser.urlQueryValue('id'),
     sceneNum: browser.urlQueryValue('vr'),
     lang: browser.urlQueryValue('lang')||'zh',
-    CDN: process.env.VUE_APP_CDN,
-    fdkkURL: process.env.VUE_APP_PROXY_URL_ROOT+'/',
 
     getKrpano(obj){
         if(typeof(obj)=="undefined"||obj==null) obj="krpanoSWFObject";

+ 0 - 13
src/utils/debuggerHelper.js

@@ -1,13 +0,0 @@
-
-export const debuggerHelper = (show = true) => {
-
-    if (show) {
-        // log.setColors({
-        var css = "background: #28b561; color:#fff;font-size:14px;padding:5px;";
-
-        console.log(`%c 👉:当前测试版本::---> 1.3.0--${process.env.VUE_APP_DEBBUG_FLAG}`,css);
-
-    }
-
-
-}

+ 2 - 3
vue.config.js

@@ -1,5 +1,4 @@
 const { defineConfig } = require("@vue/cli-service");
-const proxy_url = process.env.VUE_APP_PROXY_URL;
 
 module.exports = defineConfig({
   transpileDependencies: true,
@@ -25,11 +24,11 @@ module.exports = defineConfig({
     },
     proxy: {
       "/manage": {
-        target: proxy_url,
+        target: process.env.VUE_APP_URL_FILL + '/',
         changeOrigin: true,
       },
       "/web": {
-        target: proxy_url,
+        target: process.env.VUE_APP_URL_FILL + '/',
         changeOrigin: true,
       },
       "/api": {