qjwanglei 2024-07-31 18:15 采纳率: 54.5%
浏览 20
已结题

window.open打开本地nginx部署项目路由报错404?

nginx 配置
server {
        listen 90;
        server_name localhost; # 服务器域名或 IP 地址
        location / {
                root   D:/nginx-1.24.0/html/dist;
                index  index.html index.htm projectb.html;
            }
    }

vue 路由配置

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
  },
  {
     path: '/scanCodeScreen',
    name: 'scanCodeScreen',
     component: scanCodeScreen,
  },
  {
    path: '/IndexOld',
    name: 'IndexOld',
    component: IndexOld,
  },
]

const router = new VueRouter({
  mode: 'history', //去掉url中的#
  base: '/',
  routes,
})

export default router

window.open('http://localhost:90/scanCodeScreen', '_blank'); 报错404

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 8月8日
    • 创建了问题 7月31日