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

vue的history模式下,部署到tomcat服务,输入 非首页路径 而页面空白的问题,有办法解决吗 #4141

Open
928979883 opened this issue Mar 3, 2023 · 6 comments

Comments

@928979883
Copy link

Question(提问)

Steps to reproduce(问题复现步骤)

Screenshot or Gif(截图或动态图)

Link to minimal reproduction(最小可在线还原demo)

Other relevant information(格外信息)

  • Your OS:
  • Node.js version:
  • vue-element-admin version:
@Isaac-chip
Copy link

看看资源引用路径,是不是打包出问题了

@928979883
Copy link
Author

928979883 commented Mar 6, 2023 via email

@928979883
Copy link
Author

我查到了SEO优化的方法,但是我试了十几个小时,就是打包不成功,提示报错:[prerender-spa-plugin] Unable to prerender all routes

@imlison
Copy link

imlison commented Mar 7, 2023

history要在服务端做配合的。简单地说就是把所有请求到导向 index.html 入口。vue 的文档中有说明,tomcat 我不太熟悉。

@928979883
Copy link
Author

我知道这个全部重定向到首页,只是单纯防止跳转空白
但是随之而来的需求就是,能不能跳转到相对应后缀地址的页面

@imlison
Copy link

imlison commented Mar 7, 2023

我知道这个全部重定向到首页,只是单纯防止跳转空白 但是随之而来的需求就是,能不能跳转到相对应后缀地址的页面

可以的,优先跳转到存在的页面,都不匹配才重定向到 index.html

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

No branches or pull requests

3 participants