Browse Source

配置修改

15102826049 1 week ago
parent
commit
3db244ff06

+ 9 - 0
jshERP-web/.env.development

@@ -0,0 +1,9 @@
+
+# 开发环境配置
+ENV = 'development'
+
+# ERP管理系统/开发环境
+VUE_APP_BASE_API = '/stage-api'
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 8 - 0
jshERP-web/.env.production

@@ -0,0 +1,8 @@
+# 页面标题
+VUE_APP_TITLE = ERP系统
+
+# 生产环境配置
+ENV = 'production'
+
+# 若依管理系统/生产环境
+VUE_APP_BASE_API = '/prod-api'

+ 10 - 0
jshERP-web/.env.staging

@@ -0,0 +1,10 @@
+# 页面标题
+VUE_APP_TITLE = ERP系统
+
+NODE_ENV = production
+
+# 测试环境配置
+ENV = 'staging'
+
+# 若依管理系统/测试环境
+VUE_APP_BASE_API = '/stage-api'

+ 3 - 1
jshERP-web/public/index.html

@@ -247,6 +247,7 @@
       function getPlatform(type) {
         let res = ''
         let ajax = new XMLHttpRequest()
+
         let url = window._CONFIG['domianURL'] + '/platformConfig/getPlatform/' + type
         ajax.onreadystatechange = function () {
           if (ajax.readyState === 4 && ajax.status === 200) {
@@ -260,12 +261,13 @@
         return res
       }
       window._CONFIG = {}
-      window._CONFIG['domianURL'] = '/jshERP-boot'
+      window._CONFIG['domianURL'] = `<%= process.env.VUE_APP_BASE_API %>` //process.env.VUE_APP_BASE_API //'/jshERP-boot'
       let statisticsCode = '1cd9bcbaae133f03a6eb19da6579aaba'
       window.SYS_TITLE = getPlatform('name')
       window.SYS_URL = getPlatform('url')
       window._statistics = 'https://hm.baidu.com/hm.js?' + statisticsCode
       document.title = window.SYS_TITLE
+
       //statistics
       var _hmt = _hmt || []
       ;(function () {

+ 0 - 5
jshERP-web/src/tailwind.css

@@ -269,11 +269,6 @@
   font-style: italic
 }
 
-.text-red-500 {
-  --tw-text-opacity: 1;
-  color: rgb(239 68 68 / var(--tw-text-opacity))
-}
-
 .text-orange-500 {
   --tw-text-opacity: 1;
   color: rgb(249 115 22 / var(--tw-text-opacity))

+ 1 - 1
jshERP-web/src/utils/request.js

@@ -11,7 +11,7 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
  * 则映射后端域名,通过 vue.config.js
  * @type {*|string}
  */
-let apiBaseUrl = window._CONFIG['domianURL'] || '/jshERP-boot'
+let apiBaseUrl = window._CONFIG['domianURL']
 //console.log("apiBaseUrl= ",apiBaseUrl)
 // 创建 axios 实例
 const service = axios.create({

+ 0 - 1
jshERP-web/src/views/user/Login.vue

@@ -61,7 +61,6 @@
           >登 录
         </a-button>
       </a-form-item>
-      <div class="text-orange-500">你好你好1</div>
 
       <div class="login-copyright" v-if="device === 'mobile'">
         <a-row>

+ 11 - 5
jshERP-web/vue.config.js

@@ -4,6 +4,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
 function resolve(dir) {
   return path.join(__dirname, dir)
 }
+const port = process.env.port || process.env.npm_config_port || 80 // 端口
 
 // vue.config.js
 module.exports = {
@@ -48,14 +49,19 @@ module.exports = {
   },
 
   devServer: {
-    port: 80,
+    host: '0.0.0.0',
+    port: port,
+    open: true,
     proxy: {
-      '/jshERP-boot': {
-        target: 'http://localhost:8080', // 请求本地 需要jshERP-boot后台项目
-        ws: false,
+      [process.env.VUE_APP_BASE_API]: {
+        target: 'http://120.26.144.244:8082', // 请求本地 需要jshERP-boot后台项目
         changeOrigin: true,
+        pathRewrite: {
+          ['^' + process.env.VUE_APP_BASE_API]: '',
+        },
       },
     },
+    disableHostCheck: true,
   },
-  lintOnSave: undefined,
+  lintOnSave: false,
 }