• 作業系統
    • Windows
    • Linux
  • 資料庫
    • SQL Server
    • MySQL/MariaDB
  • 腳本
    • PowerShell
    • Shell Script
  • 開源服務
  • 虛擬化
  • 容器
  • 雲服務
  • 網路
  • 其他
  • WordPress
  • Javascript
  • PHP
  • Search
挨踢攻城獅學習之路
不太詳細紀錄
Skip to content
  • 作業系統
    • Windows
    • Linux
  • 資料庫
    • SQL Server
    • MySQL/MariaDB
  • 腳本
    • PowerShell
    • Shell Script
  • 開源服務
  • 虛擬化
  • 容器
  • 雲服務
  • 網路
  • 其他
  • WordPress
  • Javascript
  • PHP
  • Search
Vue.js:router出現 message: “Navigating to current location (XXX) is not allowed”

Vue.js:router出現 message: “Navigating to current location (XXX) is not allowed”

2020-03-05 2020-03-05 Javascript
Home 全端 Javascript Vue.js:router出現 message: “Navigating to current location (XXX) is not allowed”
Vue.js:import axios報錯Cannot read property ‘protocol’ of undefined
Vue.js:解決Vuex重新整理頁面,State就被清掉問題
2020-03-05 2020-03-05 Javascript

印象是在設定使用者未登入,就導回首頁跳出以下錯誤

Navigating to current location ("/") is not allowed

解決辦法為在router.js裡加入

const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error)
}

就不會再跳錯

來源:解决vue项目路由出现message: “Navigating to current location (XXX) is not allowed”的问题

近期文章

  • WSL2:運行 npm install 錯誤
  • Let`s Encrypt:certbot renew 更新憑證失敗
  • Go:取前端傳入的用戶 IP
  • ShellScript:bash 與 sh 不一樣的坑 [[: not found
  • Docker:WSL 掛載 Volume 問題

分類

  • WordPress (27)
  • 作業系統 (43)
    • Linux (30)
    • Windows (13)
  • 全端 (24)
    • CSS (3)
    • Dev Env (4)
    • Go (1)
    • Javascript (11)
    • PHP (5)
  • 其他 (7)
  • 容器 (10)
    • Docker (7)
    • Kubernetes (2)
  • 網路 (5)
  • 腳本 (10)
    • Batch (1)
    • PowerShell (4)
    • Shell Script (5)
  • 虛擬化 (8)
  • 資料庫 (9)
    • MySQL/MariaDB (1)
    • SQL Server (8)
  • 開源服務 (17)
  • 雲服務 (1)

標籤

analysis apache backup btrfs centos cisco command css docker duplicati esxi firewall git hyper-v javascript jquery kubernetes linux mariadb meeting network nextcloud nfs nginx nvr php plugins powershell redmine samba security selinux shellscript snapper speedup sql ssr swap troubleshooting vembu vps vue.js wordpress wsl xsibackup
Back to Top
©2019 挨踢攻城獅學習紀錄
Powered by Anima & WordPress.