fix: register plaintext hljs language and handle profile fetch error
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

- Register highlight.js plaintext language to fix "Unknown language" error
- Add try/catch around getMyProfile() to handle network errors gracefully
- Add components.d.ts to .gitignore (auto-generated by unplugin-vue-components)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 11:59:18 +08:00
parent a7aa4f63ac
commit 2bd9382c8c
3 changed files with 11 additions and 4 deletions

View File

@@ -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) => {