码迷,mamicode.com
首页 > 其他好文 > 详细

vue 跑本地的路由配置

时间:2019-02-14 20:34:02      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:change   icp   hang   env   int   域名   flow   module   one   

‘use strict‘
const path = require(‘path‘)

module.exports = {
dev: {
assetsSubDirectory: ‘static‘,
assetsPublicPath: ‘/‘,
proxyTable: {
‘/login‘: {
target: ‘https://mgt.oilchem.net/login‘,
changeOrigin: true,
pathRewrite: {
‘^/login‘: ‘‘
}
},
‘/callcenter‘: {
target: ‘https://mgt.oilchem.net/callcenter‘,
changeOrigin: true,
pathRewrite: {
‘^/callcenter‘: ‘‘
}
},
‘/website‘: {
target: ‘https://mgt.oilchem.net‘,
changeOrigin: true,
pathRewrite: {
‘^/website‘: ‘website‘
}
},
‘/product‘: {
target: ‘https://mgt.oilchem.net/product‘,
changeOrigin: true,
pathRewrite: {
‘^/product‘: ‘‘
}
},
‘/crm‘: {
// crm测试环境
//target: ‘https://mgt.oilchem.net/crm‘,
target: ‘http://tx.mgt.oilchem.net‘,
changeOrigin: true,
pathRewrite: {
‘^/crm‘: ‘‘
}
},
‘/news‘: {
target: ‘https://mgt.oilchem.net/news‘,
changeOrigin: true,
pathRewrite: {
‘^/news‘: ‘‘
}
},
‘/finance‘: {
// 财务测试环境
target: ‘https://mgt.oilchem.net/finance‘,
changeOrigin: true,
pathRewrite: {
‘^/finance‘: ‘‘
}
},
‘/basedata‘: {
// cms测试环境
target: ‘https://mgt.oilchem.net/basedata‘,
changeOrigin: true,
pathRewrite: {
‘^/basedata‘: ‘‘
}
},
‘/eac‘: {
// eac测试环境
target: ‘https://mgt.oilchem.net/eac‘,
changeOrigin: true,
pathRewrite: {
‘^/eac‘: ‘‘
}
},
‘/information‘: {
// information测试环境
target: ‘https://mgt.oilchem.net/information‘,
changeOrigin: true,
pathRewrite: {
‘^/information‘: ‘‘
}
},
‘/topic‘: {
// topicbase测试环境
target: ‘https://mgt.oilchem.net/topic‘, // 接口域名
// target: ‘http://192.168.212.64:8080‘, // 接口域名
changeOrigin: true, // 是否跨域
pathRewrite: {
‘^/topic‘: ‘‘
}
},
‘/taskReport‘: {
target: ‘https://mgt.oilchem.net/taskReport‘,
changeOrigin: true,
pathRewrite: {
‘^/taskReport‘: ‘‘
}
},
‘/cmsworkbench‘: {
target: ‘https://mgt.oilchem.net/cmsworkbench‘,
changeOrigin: true,
pathRewrite: {
‘^/cmsworkbench‘: ‘‘
}
},
‘/report‘: {
target: ‘https://mgt.oilchem.net/report‘,
changeOrigin: true,
pathRewrite: {
‘^/report‘: ‘‘
}
},
‘/datacenter‘:{
target:‘https://mgt.oilchem.net/datacenter‘,
changeOrigin:true,
pathRewrite:{
‘^/datacenter‘:‘‘
}
},
‘/workbench‘: {
target: ‘https://mgt.oilchem.net/workbench‘,
changeOrigin: true,
pathRewrite: {
‘^/workbench‘: ‘‘
}
},
‘/openapi‘: {
target: ‘https://mgt.oilchem.net/openapi‘,
changeOrigin: true,
pathRewrite: {
‘^/openapi‘: ‘‘
}
},
‘/mysteel‘: {
// workflow
target: ‘https://mgt.oilchem.net/mysteel‘, // 接口域名
// target: ‘http://lycs.oilchem.net:8080/mysteel‘,
changeOrigin: true, //是否跨域
pathRewrite: {
‘^/mysteel‘: ‘‘ //需要rewrite重写的,
}
},
// 钢联呼叫中心
‘/json‘: {
target: ‘https://avaya.mysteel.com‘,
changeOrigin: true
},
‘/cmsweb‘: {
target: ‘https://mgr.mysteelcms.com‘,
changeOrigin: true
}
},

host: ‘localhost‘,
port: 8000,
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false,
useEslint: false,
showEslintErrorsInOverlay: false,

/**
* Source Maps
*/

devtool: ‘cheap-module-eval-source-map‘,
cacheBusting: true,
cssSourceMap: true
},

build: {
index: path.resolve(__dirname, ‘../dist/index.html‘),
assetsRoot: path.resolve(__dirname, ‘../dist‘),
assetsSubDirectory: ‘static‘,
assetsPublicPath: ‘/‘,

/**
* Source Maps
*/

productionSourceMap: true,
devtool: ‘#source-map‘,
productionGzip: false,
productionGzipExtensions: [‘js‘, ‘css‘],
bundleAnalyzerReport: process.env.npm_config_report
}
}

vue 跑本地的路由配置

标签:change   icp   hang   env   int   域名   flow   module   one   

原文地址:https://www.cnblogs.com/guilf/p/10376700.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!