Browse Source

需要考虑环境是开发还是测试的地方,做判断。

任一存 3 năm trước cách đây
mục cha
commit
e35550f980
3 tập tin đã thay đổi với 14 bổ sung3 xóa
  1. 1 2
      web/src/main.js
  2. 1 1
      web/src/views/accessibility.vue
  3. 12 0
      web/vue.config.js

+ 1 - 2
web/src/main.js

@@ -10,8 +10,7 @@ Vue.use(ElementUI);
 // Vue.mixin({
 // })
 
-// 不能通过location去判断
-Vue.prototype.$homePageUrl = 'http://192.168.0.81:8081/main'
+Vue.prototype.$homePageUrl = location.origin + location.pathname
 
 Vue.prototype.$eventBus = new Vue({})
 

+ 1 - 1
web/src/views/accessibility.vue

@@ -938,7 +938,7 @@ export default {
       this.ariaSettings.isMagnifying = !this.ariaSettings.isMagnifying
     },
     onClickHelp() {
-      window.open('../help')
+      window.open('./help.html')
     },
     onClickElderlyServicesAreaEntry() {
       this.ariaSettings.menuMode = 'old'

+ 12 - 0
web/vue.config.js

@@ -1,10 +1,22 @@
 const webpack = require('webpack')
 
+let publicPath = '/'
+switch (process.env.NODE_ENV) {
+  case 'development':
+    break;
+  case 'production':
+    publicPath = '/shouBo/'
+    break;
+  default:
+    break;
+}
+
 module.exports = {
   pages: {
     main: 'src/main.js',
     help: 'src/help.js',
   },
+  publicPath,
   configureWebpack: {
     module: {
       rules: [