yangzongzhuan / RuoYi-Vue3

:tada: (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue3 & Vite、Element Plus 的前后端分离权限管理系统
http://ruoyi.vip
MIT License
4.82k stars 1.96k forks source link

当项目有base路径时,部署完毕后此时部分页面跳转报404 #112

Closed John0Winston closed 1 year ago

John0Winston commented 1 year ago

当项目有base路径时,例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 部署完毕后此时部分页面跳转报404、 需修改的地方有

router/index.js中 history: createWebHistory=> history: createWebHistory(import.meta.env.BASE_URL)

utils/request.js中 location.href = '/index'; =>location.href = import.meta.env.BASE_URL + 'index';

layout/components/Navbar.vue 中 location.href = '/index'; =>location.href = import.meta.env.BASE_URL + 'index';

yangzongzhuan commented 1 year ago

项目技术相关的问题请到 https://gitee.com/y_project/RuoYi-Vue/issues 提问,同时提供出能复现问题步骤。

John0Winston commented 1 year ago

项目技术相关的问题请到 https://gitee.com/y_project/RuoYi-Vue/issues 提问,同时提供出能复现问题步骤。

第一次用这玩意 不怎么清楚怎么使用