fix: use addRoute refresh page 404

This commit is contained in:
xiaoxian521
2021-06-29 14:46:09 +08:00
parent 3a69af233f
commit 6b36c93779
3 changed files with 73 additions and 59 deletions

View File

@@ -59,7 +59,9 @@ export interface ContextProps {
dynamicText?: string;
}
import { useRouter, useRoute } from "vue-router";
import { useRouter, useRoute, Router } from "vue-router";
import { initRouter } from "/@/router/index";
export default defineComponent({
name: "Info",
@@ -133,7 +135,9 @@ export default defineComponent({
username: "admin",
accessToken: "eyJhbGciOiJIUzUxMiJ9.test"
});
router.push("/");
initRouter("admin").then((router: Router) => {
router.push("/");
});
};
onBeforeMount(() => {