Skip to content

Commit

Permalink
修复我的节点页面未登录跳转404问题
Browse files Browse the repository at this point in the history
  • Loading branch information
unify-z committed Aug 24, 2024
1 parent 06ba0ac commit 0fdabef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mycluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<script setup>
import { onMounted } from 'vue';
import { ElMessageBox } from 'element-plus';
import { useRouter } from 'vue-router'
const router = useRouter()
function getCookie(name) {
let cookieArr = document.cookie.split(';');
Expand All @@ -29,7 +30,7 @@ function checkTokenInCookie() {
ElMessageBox.alert('用户未登录','提示', {
confirmButtonText: '去登录',
callback: () => {
window.location.href = '/auth/login';
router.push('/auth/login');
},
});
}
Expand Down

0 comments on commit 0fdabef

Please sign in to comment.