build(custom): 增加错误上报监控
This commit is contained in:
@@ -3,6 +3,7 @@ import { setupRouterGuard } from './guard'
|
||||
import { basicRoutes, EMPTY_ROUTE, NOT_FOUND_ROUTE } from './routes'
|
||||
import { getToken, isNullOrWhitespace } from '@/utils'
|
||||
import { useUserStore, usePermissionStore } from '@/store'
|
||||
import * as Sentry from '@sentry/vue'
|
||||
|
||||
const isHash = true
|
||||
export const router = createRouter({
|
||||
@@ -14,6 +15,22 @@ export const router = createRouter({
|
||||
export async function setupRouter(app) {
|
||||
await addDynamicRoutes()
|
||||
setupRouterGuard(router)
|
||||
if (import.meta.env.VITE_SENTRY) {
|
||||
Sentry.init({
|
||||
app,
|
||||
dsn: 'https://aa4308fc56a9d107786b8dbcd2ae56e8@w.huakk.top/13',
|
||||
integrations: [
|
||||
new Sentry.BrowserTracing({
|
||||
tracePropagationTargets: ['localhost', /^https:\/\/w\.huakk\.top\/api/],
|
||||
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
|
||||
}),
|
||||
new Sentry.Replay(),
|
||||
],
|
||||
tracesSampleRate: 1.0,
|
||||
replaysSessionSampleRate: 0.1,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
})
|
||||
}
|
||||
app.use(router)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<CommonPage show-footer :title="$route.title">
|
||||
{{ model }}
|
||||
<!-- {{ model }} -->
|
||||
<n-spin size="large" :show="isShowSpin">
|
||||
<n-form ref="formRef" label-width="100" :model="model" :rules="rules" label-placement="left">
|
||||
<n-grid :cols="2" :x-gap="24">
|
||||
|
||||
Reference in New Issue
Block a user