ff2bb77cdd
Desktop Client Build / Resolve Build Metadata (push) Successful in 32s
Frontend CI / Frontend (push) Successful in 4m4s
Desktop Client Build / Publish Client Artifacts to NAS (push) Has been cancelled
Desktop Client Build / Build Desktop Client (push) Has been cancelled
Mark 401/refresh-failure errors as handled so per-view catch blocks fall through silently while a single global "登录已过期" warning is shown. Centralize ops-web error rendering via showOpsError. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
108 lines
1.6 KiB
TypeScript
108 lines
1.6 KiB
TypeScript
import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
|
|
import {
|
|
Alert,
|
|
App as AntApp,
|
|
Avatar,
|
|
Badge,
|
|
Button,
|
|
Card,
|
|
Checkbox,
|
|
ConfigProvider,
|
|
DatePicker,
|
|
Descriptions,
|
|
Drawer,
|
|
Dropdown,
|
|
Empty,
|
|
Form,
|
|
Input,
|
|
InputNumber,
|
|
Layout,
|
|
Menu,
|
|
Modal,
|
|
Pagination,
|
|
Popconfirm,
|
|
Radio,
|
|
Result,
|
|
Select,
|
|
Space,
|
|
Spin,
|
|
Statistic,
|
|
Switch,
|
|
Table,
|
|
Tabs,
|
|
Tag,
|
|
Tooltip,
|
|
message,
|
|
} from 'ant-design-vue'
|
|
import { createApp } from 'vue'
|
|
|
|
import { bindUnauthorizedHandler } from '@/lib/http'
|
|
import { router } from '@/router'
|
|
import { useAuthStore } from '@/stores/auth'
|
|
import { pinia } from '@/stores/pinia'
|
|
import 'ant-design-vue/dist/reset.css'
|
|
import App from './App.vue'
|
|
import './styles.css'
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 30000,
|
|
refetchOnWindowFocus: false,
|
|
retry: false,
|
|
},
|
|
},
|
|
})
|
|
|
|
const app = createApp(App)
|
|
|
|
message.config({
|
|
maxCount: 1,
|
|
})
|
|
|
|
bindUnauthorizedHandler(() => {
|
|
const auth = useAuthStore(pinia)
|
|
auth.logout()
|
|
void router.replace({ name: 'login' })
|
|
message.destroy()
|
|
message.warning('登录已过期,请重新登录')
|
|
})
|
|
;[
|
|
Alert,
|
|
AntApp,
|
|
Avatar,
|
|
Badge,
|
|
Button,
|
|
Card,
|
|
Checkbox,
|
|
ConfigProvider,
|
|
DatePicker,
|
|
Descriptions,
|
|
Drawer,
|
|
Dropdown,
|
|
Empty,
|
|
Form,
|
|
Input,
|
|
InputNumber,
|
|
Layout,
|
|
Menu,
|
|
Modal,
|
|
Pagination,
|
|
Popconfirm,
|
|
Radio,
|
|
Result,
|
|
Select,
|
|
Space,
|
|
Spin,
|
|
Statistic,
|
|
Switch,
|
|
Table,
|
|
Tabs,
|
|
Tag,
|
|
Tooltip,
|
|
].forEach((component) => {
|
|
app.use(component)
|
|
})
|
|
|
|
app.use(pinia).use(router).use(VueQueryPlugin, { queryClient }).mount('#app')
|