vue-router 二级域名使用

2020-03-05  本文已影响0人  web5

修改三个配置,具体操作日后有时间更新,不懂私聊

  1. router配置
const route = new Router({
  mode: 'history',
  base: '/doctor-html/',
  routes
})
  1. webpack配置,vue-cli配置
publicPath: config.publicPath,
  1. nginx配置
try_files $uri $uri/ /doctor-html/index.html;
  1. 代码部署路径
项目目录配置实例
项目路径web/doctor-html/index.html
nginx配置root指向 web/ 项目放在doctor-html,但是nginx指向web,url访问com/doctor-html就好了

参考链接 https://segmentfault.com/a/1190000015753352

上一篇 下一篇

猜你喜欢

热点阅读