[update]-部署配置项的修改

This commit is contained in:
fengchenchen
2021-10-12 09:08:45 +08:00
parent 8fc390048d
commit 1cd5d740eb
6 changed files with 46 additions and 7 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
/dist /enterprise
/public /public
/vue.config.js /vue.config.js
/babel.config.js /babel.config.js
/*.js
+1 -1
View File
@@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"ant-design-vue": "^1.7.6", "ant-design-vue": "^1.7.6",
"axios": "^0.21.1", "axios": "^0.21.1",
"compression-webpack-plugin": "^8.0.1", "compression-webpack-plugin": "5.0.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
"enquire.js": "^2.1.6", "enquire.js": "^2.1.6",
+14
View File
@@ -0,0 +1,14 @@
/**
* 防止打包部署时路径被写死-开发环境的配置项
*/
window._CONFIG = {};
window._CONFIG["domianURL"] = "/jero-boot"; // 路由转发 devServer
// websocket连接的地址
window._CONFIG["domianWebSocketURL"] = "http://localhost:21824/jero-boot";
// 单点登录地址
window._CONFIG["staticDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/download";
window._CONFIG["pdfDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/pdf/pdfPreviewIframe";
window._CONFIG["casPrefixUrl"] = "http://cas.example.org:8443/cas";
// 预览文件地址
window._CONFIG["onlinePreviewDomainURL"] = "http://localhost:8012/onlinePreview";
+7 -1
View File
@@ -7,7 +7,13 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script>
<script src="<%= BASE_URL %>api_address_config.js"></script> <!-- 全局配置 -->
<% if (process.env.NODE_ENV === 'development' ) { %>
<script src="<%= BASE_URL %>development_address_config.js"></script>
<% } %>
<% if (process.env.NODE_ENV === 'production' ) { %>
<script src="<%= BASE_URL %>production_address_config.js"></script>
<% } %>
<style> <style>
html, html,
body, body,
+15
View File
@@ -0,0 +1,15 @@
/**
* 防止打包部署时路径被写死-生产环境的配置项
*/
window._CONFIG = {};
window._CONFIG["domianURL"] = "/jero-boot"; // 路由转发 devServer
// websocket连接的地址
window._CONFIG["domianWebSocketURL"] = "http://10.10.10.46:8077/jero-boot";
// 单点登录地址
window._CONFIG["staticDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/download";
window._CONFIG["pdfDomainURL"] = window._CONFIG["domianURL"] + "/sys/common/pdf/pdfPreviewIframe";
window._CONFIG["casPrefixUrl"] = "http://cas.example.org:8443/cas";
// 预览文件地址
window._CONFIG["onlinePreviewDomainURL"] = "http://10.10.10.46:8012/onlinePreview";
+5 -2
View File
@@ -16,6 +16,9 @@ module.exports = {
productionSourceMap: false, productionSourceMap: false,
//打包app时放开该配置 //打包app时放开该配置
// publicPath:'./', // publicPath:'./',
// publicPath: process.env.NODE_ENV === 'production' ? '/enterprise/' : '/',
// 打包后的文件夹名称
outputDir: 'enterprise',
configureWebpack: config => { configureWebpack: config => {
//生产环境取消 console.log //生产环境取消 console.log
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
@@ -76,7 +79,7 @@ module.exports = {
}, },
devServer: { devServer: {
port: 3001, port: 21826,
proxy: { proxy: {
/* '/api': { /* '/api': {
target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统 target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统
@@ -87,7 +90,7 @@ module.exports = {
} }
},*/ },*/
'/jero-boot': { '/jero-boot': {
target: 'http://localhost:8080', //请求本地 jero-boot后台项目 target: 'http://localhost:21824', //请求本地 jero-boot后台项目
ws: false, ws: false,
changeOrigin: true changeOrigin: true
}, },