在router的配置文件index.js中加上红色标注的两行,
import configJson from '../../static/config.json'
export default new Router({
mode:'history',
base:configJson.publishFolder,
routes: [
{
path: '/',
。。。
}
config.json文件在static文件夹下面,内容如下
{
"publishFolder":"/catalog"
}