diff --git a/.gitignore b/.gitignore index a547bf3..3cb0088 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ node_modules dist dist-ssr *.local +components.d.ts # Editor directories and files .vscode/* diff --git a/src/App.vue b/src/App.vue index ccc5d67..56d9bf4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,10 +8,14 @@ import { STORAGE_KEY } from "./utils/const" import hljs from "highlight.js/lib/core" onMounted(async () => { - const data = await Account.getMyProfile() - user.loaded = true - user.username = data.username - user.role = data.role + try { + const data = await Account.getMyProfile() + user.loaded = true + user.username = data.username + user.role = data.role + } catch { + user.loaded = true + } }) watch(authed, (v) => { diff --git a/src/main.ts b/src/main.ts index 34e694c..a11700b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,6 +16,7 @@ import hljs from "highlight.js/lib/core" import xml from "highlight.js/lib/languages/xml" import css from "highlight.js/lib/languages/css" import javascript from "highlight.js/lib/languages/javascript" +import plaintext from "highlight.js/lib/languages/plaintext" //@ts-ignore import "highlight.js/styles/github.min.css" import { router } from "./router" @@ -24,6 +25,7 @@ hljs.registerLanguage("html", xml) hljs.registerLanguage("css", css) hljs.registerLanguage("js", javascript) hljs.registerLanguage("javascript", javascript) +hljs.registerLanguage("plaintext", plaintext) marked.use({ gfm: true,