-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { createRouter, createWebHashHistory } from "vue-router"; | ||
|
||
const routes = [ | ||
{ path: "/", component: () => import("../views/Jwt.vue") }, | ||
{ | ||
path: "/jku", | ||
beforeEnter: (to, from, next) => { | ||
Check failure on line 7 in src/router/index.ts GitHub Actions / build
Check failure on line 7 in src/router/index.ts GitHub Actions / build
|
||
console.log("jku"); | ||
const jsonResponse = { | ||
name: "John Doe", | ||
age: 30, | ||
country: "USA", | ||
}; | ||
|
||
// 将 JSON 数据直接写入到页面,避免 HTML 渲染 | ||
document.body.innerHTML = `<pre>${JSON.stringify( | ||
jsonResponse, | ||
null, | ||
2 | ||
)}</pre>`; | ||
|
||
// 直接结束路由导航,不继续渲染组件 | ||
next(false); | ||
next(false); | ||
}, | ||
component: () => import("../views/Jwt.vue"), | ||
}, | ||
{ | ||
path: "/:catchAll(.*)", | ||
component: () => import("../views/Notfound.vue"), | ||
}, | ||
]; | ||
|
||
const router = createRouter({ | ||
history: createWebHashHistory(), | ||
routes, | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<div> | ||
Not Found | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
</script> | ||
|
||
<style scoped></style> |