vue路由history模式刷新404问题解决方案


更改router 的base // biz是二级目录,路由文件改成
const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  base: '/biz/', // biz是二级目录
  routes
})

下面是nginx配置

server {
        listen       34567;
        server_name  localhost;
        location / {
            index  index.html index.htm;
            try_files $uri $uri/ /biz/index.html;
        }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM