鍍金池/ 問答/HTML5  HTML/ vue寫的應(yīng)用在瀏覽器測試的時候,刷新界面,界面跳轉(zhuǎn)到登錄頁了。

vue寫的應(yīng)用在瀏覽器測試的時候,刷新界面,界面跳轉(zhuǎn)到登錄頁了。

1.在谷歌瀏覽器測試的時候在任意界面點擊刷新都會跳轉(zhuǎn)到登錄頁。怎么實現(xiàn)刷新的時候路由不跳轉(zhuǎn),還是在當(dāng)前頁面。
路由代碼:
const routes = [
{

path: '/', component: Index, redirect: '/home',
children: [
  {path: '/system',component: SystemConfiguration,name: '系統(tǒng)配置'},
  {path: '/initialize', component: Initialize, name: '初始化'},
  {path: '/online/assemblyOnline', component: AssemblyOnline, name: '裝配上線'},
  {path: '/online/machineplusOnline', component: MachineplusOnline, name: '機加上線'},
  {path: '/assembleInsert', component: AssembleInsert, name: '裝配下線'},
  {path: '/hothost', component: HostTest, name: '熱試'}

]

},
{path: '/login', component: Login}
]

回答
編輯回答
陌璃

路由在哪里,刷新就在哪里。
刷新之后跳登錄,是你代碼里面控制的。找找看哪里判斷了登錄狀態(tài),把路由指向了登錄頁

2018年6月16日 20:26
編輯回答
哚蕾咪

路由配置正確的話,不會出現(xiàn)這個問題,你應(yīng)該貼一下你路由的代碼

2018年8月27日 20:24
編輯回答
鹿惑

這個可能是你后端跳轉(zhuǎn)的,或是前端代碼里面自動跳的。去找到處理一下吧

2017年1月12日 18:44