Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
John0Winston opened this issue Nov 14, 2022 · 2 comments · May be fixed by #114
Closed

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

John0Winston opened this issue Nov 14, 2022 · 2 comments · May be fixed by #114

Comments

@John0Winston
Copy link

John0Winston commented Nov 14, 2022

当项目有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
Copy link
Owner

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

@John0Winston
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants