第一种解决方式;
改vue的路由为hash模式
第二种解决方式:
改nginx配置文件,加入一行即可
location / {
try_files $uri $uri/ /index.html;
}
但是还是最好在vue中加入404页面的路由
const router = new VueRouter({
mode: 'history',
routes: [
{ path: '*', component: NotFoundComponent }
]
})