feat: 添加测试框架和覆盖率报告功能
feat(测试): 新增Playwright和Vitest测试配置 feat(测试): 添加测试覆盖率报告生成功能 feat(测试): 实现前后端测试脚本集成 fix(测试): 修复测试密码不匹配问题 fix(测试): 修正URL等待策略 fix(测试): 调整错误消息选择器 refactor(测试): 重构测试目录结构 refactor(测试): 优化测试用例组织方式 docs: 更新测试报告文档 docs: 添加测试覆盖率报告模板 ci: 添加Docker测试环境配置 ci: 实现测试自动化脚本 chore: 更新依赖版本 chore: 添加测试相关配置文件
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import request from '@/utils/request'
|
||||
import type { PageResponse } from './user.api'
|
||||
import { RoleStatus } from '@/constants/status'
|
||||
|
||||
export interface Role {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
description: string
|
||||
status: 'ACTIVE' | 'INACTIVE'
|
||||
roleName: string
|
||||
roleKey: string
|
||||
roleSort: number
|
||||
status: RoleStatus
|
||||
permissions: Permission[]
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
@@ -21,24 +22,25 @@ export interface Permission {
|
||||
}
|
||||
|
||||
export interface CreateRoleRequest {
|
||||
name: string
|
||||
code: string
|
||||
description: string
|
||||
roleName: string
|
||||
roleKey: string
|
||||
roleSort: number
|
||||
permissions: number[]
|
||||
}
|
||||
|
||||
export interface UpdateRoleRequest {
|
||||
name?: string
|
||||
description?: string
|
||||
status?: 'ACTIVE' | 'INACTIVE'
|
||||
roleName?: string
|
||||
roleKey?: string
|
||||
roleSort?: number
|
||||
status?: RoleStatus
|
||||
permissions?: number[]
|
||||
}
|
||||
|
||||
export interface RolePageRequest {
|
||||
page: number
|
||||
size: number
|
||||
name?: string
|
||||
code?: string
|
||||
roleName?: string
|
||||
roleKey?: string
|
||||
status?: string
|
||||
sortBy?: string
|
||||
sortOrder?: 'asc' | 'desc'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
import { UserStatus } from '@/constants/status'
|
||||
|
||||
export interface User {
|
||||
id: number
|
||||
@@ -7,7 +8,7 @@ export interface User {
|
||||
email: string
|
||||
phone: string
|
||||
avatar: string
|
||||
status: 'ACTIVE' | 'INACTIVE' | 'LOCKED'
|
||||
status: UserStatus
|
||||
roles: string[]
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
@@ -27,7 +28,7 @@ export interface UpdateUserRequest {
|
||||
email?: string
|
||||
phone?: string
|
||||
avatar?: string
|
||||
status?: 'ACTIVE' | 'INACTIVE' | 'LOCKED'
|
||||
status?: UserStatus
|
||||
roles?: string[]
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ export const userApi = {
|
||||
resetPassword: (id: number) =>
|
||||
request.post<void>(`/users/${id}/reset-password`),
|
||||
|
||||
updateStatus: (id: number, status: 'ACTIVE' | 'INACTIVE' | 'LOCKED') =>
|
||||
updateStatus: (id: number, status: UserStatus) =>
|
||||
request.put<void>(`/users/${id}/status`, { status }),
|
||||
|
||||
assignRoles: (id: number, roleIds: number[]) =>
|
||||
|
||||
Reference in New Issue
Block a user