a6cc190751
P1b Task 9: apps/admin based on art-design-pro v3.0.2 (tag, commit d224dd4; source recorded in apps/admin/SOURCE.md), trimmed to layout/login/i18n/request/table-form core. Login wired to real POST /v1/auth/password (single-token session), Bearer header on all requests, 401 interceptor logout+redirect, request-driven sliding renewal (refresh at ~80% TTL, single-flight), best-effort POST /v1/auth/logout on user-menu logout. One protected stub page (相册管理). Dev port 5176 strictPort + /v1 proxy to 8080. Admin keeps its own eslint9 flat config; root eslint ignores apps/admin/**. vitest unit tests for renewal pacing + Playwright e2e (guard redirect, localized wrong-password error, login lands on stub, token persists across reload, logout clears session). Co-Authored-By: Claude Code <noreply@anthropic.com>
40 lines
878 B
Vue
40 lines
878 B
Vue
<template>
|
|
<ElConfigProvider
|
|
size="default"
|
|
:locale="locales[language]"
|
|
:z-index="3000"
|
|
:card="{
|
|
shadow: 'never'
|
|
}"
|
|
>
|
|
<RouterView></RouterView>
|
|
</ElConfigProvider>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useUserStore } from './store/modules/user'
|
|
import zh from 'element-plus/es/locale/lang/zh-cn'
|
|
import en from 'element-plus/es/locale/lang/en'
|
|
import { toggleTransition } from './utils/ui/animation'
|
|
import { checkStorageCompatibility } from './utils/storage'
|
|
import { initializeTheme } from './hooks/core/useTheme'
|
|
|
|
const userStore = useUserStore()
|
|
const { language } = storeToRefs(userStore)
|
|
|
|
const locales = {
|
|
zh: zh,
|
|
en: en
|
|
}
|
|
|
|
onBeforeMount(() => {
|
|
toggleTransition(true)
|
|
initializeTheme()
|
|
})
|
|
|
|
onMounted(() => {
|
|
checkStorageCompatibility()
|
|
toggleTransition(false)
|
|
})
|
|
</script>
|