vue.config.js文件中
publicPath: '/' + (process.env.VUE_APP_BASE_Title||''),
.env.production和**.env.development**文件中
VUE_APP_BASE_Title = 'url'
F:\机构软件\src\router\index.js中
export default new Router({
base: process.env.VUE_APP_BASE_Title,
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
全局搜索location.href
location.href = '/index';
改为
location.href = '/' +process.env.VUE_APP_BASE_Title + '/index';