优化构架

This commit is contained in:
2026-08-03 18:52:30 +08:00
parent 35c713a7ca
commit fed46f42ef
59 changed files with 691 additions and 325 deletions
@@ -2,16 +2,16 @@ import assert from 'node:assert/strict'
import fs from 'node:fs'
import test from 'node:test'
const routerSource = fs.readFileSync(new URL('../router/index.ts', import.meta.url), 'utf8')
const navigationSource = fs.readFileSync(new URL('../navigation/clientNavigation.ts', import.meta.url), 'utf8')
const routerSource = fs.readFileSync(new URL('../routes.ts', import.meta.url), 'utf8')
const viewSource = fs.readFileSync(new URL('./AccountProfileView.vue', import.meta.url), 'utf8')
const authSource = fs.readFileSync(new URL('../stores/auth.ts', import.meta.url), 'utf8')
const authApiSource = fs.readFileSync(new URL('../api/auth.ts', import.meta.url), 'utf8')
const authSource = fs.readFileSync(new URL('../../auth/store/auth.ts', import.meta.url), 'utf8')
const authApiSource = fs.readFileSync(new URL('../../auth/api/auth.ts', import.meta.url), 'utf8')
test('registers the account profile route and navigation entry', () => {
assert.match(routerSource, /account\/profile'.*AccountProfileView\.vue/)
assert.match(routerSource, /path: 'account\/profile'[\s\S]*?component: \(\) => import\('\.\/views\/AccountProfileView\.vue'\)/)
assert.match(routerSource, /release: 'active'/)
assert.match(routerSource, /permission: 'account:profile:view'/)
assert.match(navigationSource, /title: '我的信息'.*path: '\/account\/profile'/)
assert.match(routerSource, /navigation: \{ key: 'account-profile'/)
})
test('implements profile view, edit, save and cancel states', () => {
@@ -12,14 +12,13 @@ import {
UserRound,
X,
} from '@lucide/vue'
import { useAuthStore } from '@/stores/auth'
import { changeCurrentPassword } from '@/api/auth'
import { changeCurrentPassword, useAuthStore } from '@/modules/auth/public'
import {
getPasswordStrength,
validateEditableAccountProfile,
validatePasswordChange,
type PasswordChangePayload,
} from '@/utils/accountProfile'
} from '@/modules/account/utils/accountProfile'
type AccountTab = 'profile' | 'password'