优化构架

This commit is contained in:
2026-08-03 18:49:18 +08:00
parent 1241d11c01
commit 44c33a6280
133 changed files with 651 additions and 603 deletions
+19
View File
@@ -0,0 +1,19 @@
import { createPinia, setActivePinia } from 'pinia'
import { mount } from '@vue/test-utils'
import { createMemoryHistory, createRouter } from 'vue-router'
import { describe, expect, it } from 'vitest'
import ForbiddenView from './ForbiddenView.vue'
describe('ForbiddenView', () => {
it('shows server-account guidance and sanitizes the source path', async () => {
const pinia = createPinia()
setActivePinia(pinia)
const router = createRouter({ history: createMemoryHistory(), routes: [{ path: '/403', component: ForbiddenView }] })
await router.push({ path: '/403', query: { from: '//example.com' } })
await router.isReady()
const wrapper = mount(ForbiddenView, { global: { plugins: [pinia, router] } })
expect(wrapper.text()).toContain('当前登录账号无法访问此页面')
expect(wrapper.text()).toContain('来源页面:/')
expect(wrapper.text()).not.toContain('权限预览')
})
})