问题描述:
使用window.open打开新窗口跳转本系统的某一个页面
如: http://192.168.1.206:9529/#/previewScreen?idx=1653966398075965442
刷新总是回到首页
找了很久也没找到解决办法。
最后曲线救国:
将路由模式更改为history模式,该问题不再出现。
注意history模式需要配置ngnix,,如下
location / {
root D:\dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
否则刷新出现404的问题