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

baseUrl修改后刷新网页出现Cannot GET #65

Open
stark1092 opened this issue Mar 11, 2019 · 4 comments
Open

baseUrl修改后刷新网页出现Cannot GET #65

stark1092 opened this issue Mar 11, 2019 · 4 comments

Comments

@stark1092
Copy link

将baseURL从'/'改成'/tv/'之后router.js里的路由无法通过url直接访问。
比如想访问/tv/list/channel/XXXX必须通过进入/tv/的主页面,然后点击进入频道。
如果直接输入/tv/list/channel/XXXX或者在页面点击刷新,就会出现Cannot GET的错误。

@huiyiqun
Copy link
Collaborator

这个应该是因为浏览器直接访问了后端的 web 服务器造成的,可以参考这里的文档:

https://github.com/tvly/tvly-web/blob/master/docs/zh_CN/deloy.md#%E6%9C%8D%E5%8A%A1

@huiyiqun
Copy link
Collaborator

@stark1092 我明白你的意思了。

由于这种情况比较罕见,建议是通过后端配置一个 301 跳转解决。

@stark1092
Copy link
Author

@stark1092 我明白你的意思了。

由于这种情况比较罕见,建议是通过后端配置一个 301 跳转解决。

但是按照doc里的描述,应该是可以自己设置baseURL的,所以现在是baseURL不为'/'就会出现这个问题,还是我的用法有错误呢?

@huiyiqun
Copy link
Collaborator

huiyiqun commented Mar 19, 2019 via email

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

2 participants