Browse Source

改正式环境部署路径

任一存 2 years ago
parent
commit
dc554f3f3c
7 changed files with 40 additions and 13 deletions
  1. 2 0
      web/.env
  2. 2 0
      web/.env.prod
  3. 2 0
      web/.env.test
  4. 2 1
      web/package.json
  5. 28 9
      web/src/config.js
  6. 3 2
      web/src/views/bottom/Index.vue
  7. 1 1
      web/vue.config.js

+ 2 - 0
web/.env

@@ -0,0 +1,2 @@
+VUE_APP_ENV=dev
+NODE_ENV=development

+ 2 - 0
web/.env.prod

@@ -0,0 +1,2 @@
+VUE_APP_ENV=prod
+NODE_ENV=production

+ 2 - 0
web/.env.test

@@ -0,0 +1,2 @@
+VUE_APP_ENV=test
+NODE_ENV=production

+ 2 - 1
web/package.json

@@ -4,7 +4,8 @@
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build"
+    "build-test": "vue-cli-service build --mode test",
+    "build-prod": "vue-cli-service build --mode prod"
   },
   "dependencies": {
     "core-js": "^3.6.5",

+ 28 - 9
web/src/config.js

@@ -1,32 +1,51 @@
 let publicPath = '/'
-switch (process.env.NODE_ENV) {
-  case 'development':
+switch (process.env.VUE_APP_ENV) {
+  case 'dev':
     break;
-  case 'production':
+  case 'test':
     publicPath = '/shouBo/'
     break;
+  case 'prod':
+    break;
+  default:
+    break;
+}
+
+let mobilePath = ''
+switch (process.env.VUE_APP_ENV) {
+  case 'dev':
+    mobilePath = ''
+    break;
+  case 'test':
+    mobilePath = `/shouBoM/index.html`
+    break;
+  case 'prod':
+    mobilePath = `/mobile/index.html`
+    break;
   default:
     break;
 }
 
 let ajaxOrigin = ''
-switch (process.env.NODE_ENV) {
-  case 'development':
+switch (process.env.VUE_APP_ENV) {
+  case 'dev':
     ajaxOrigin = 'http://47.107.166.80:8008'
     break;
-  case 'production':
-    // ajaxOrigin = `http://47.107.166.80:8008`
-    // ajaxOrigin = `https://tts.4dage.com/` // 测试环境
+  case 'test':
+    ajaxOrigin = `https://tts.4dage.com/` // 测试环境
+    break;
+  case 'prod':
     ajaxOrigin = `https://cssbbwg.4dage.com` // 生产环境
     break;
   default:
     break;
 }
 
-const version = 'v1114.1500'
+const version = 'v1114.1600'
 
 module.exports = {
   publicPath,
+  mobilePath,
   ajaxOrigin,
   version,
 }

+ 3 - 2
web/src/views/bottom/Index.vue

@@ -94,6 +94,7 @@
 
 <script>
 import accessibilityMixin from "/src/views/accessibilityMixin.js"
+import { mobilePath } from "@/config.js";
 
 export default {
   name: "bottomIndex",
@@ -457,7 +458,7 @@ export default {
           width: "105px",
           top: 1,
           left: "0px",
-          path: "https://zzbbh.4dage.com/shouBoM/index.html#/Layout/Home",
+          path: location.origin + mobilePath + '#/Layout/Home',
         },
         {
           title: "Terms of Use",
@@ -491,7 +492,7 @@ export default {
   //方法集合
   methods: {
     skip(url, sroll) {
-      if(url==='https://zzbbh.4dage.com/shouBoM/index.html#/Layout/Home') {
+      if(url === location.origin + mobilePath + '#/Layout/Home') {
         window.open(url)
         return
       }

+ 1 - 1
web/vue.config.js

@@ -3,7 +3,7 @@ const config = require('./src/config.js')
 
 module.exports = {
   pages: {
-    main: 'src/main.js',
+    index: 'src/main.js',
     help: 'src/help.js',
   },
   publicPath: config.publicPath,