fix: 修复前端登录体验和API调用问题
- 修复路由守卫:未登录时直接跳转,不显示提示信息 - 修复API拦截器:401错误直接跳转,无需确认 - 移除不必要的ElMessageBox确认框 - 优化Token过期处理逻辑 - 修复文件管理API引入路径和URL前缀 - 修复调拨/回收管理API端点不匹配问题 - 修复通知管理API方法不匹配问题 - 统一系统配置API路径为单数形式 影响文件: - src/router/index.ts - src/api/request.ts - src/api/file.ts - src/api/index.ts 测试状态: - 前端构建通过 - 所有API路径已验证 - 登录流程测试通过 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
29
tests/e2e/global-setup.ts
Normal file
29
tests/e2e/global-setup.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Playwright E2E测试 - 全局设置
|
||||
*
|
||||
* 在所有测试运行前执行
|
||||
*/
|
||||
|
||||
import { FullConfig } from '@playwright/test'
|
||||
|
||||
async function globalSetup(config: FullConfig) {
|
||||
console.log('🚀 开始E2E测试全局设置...')
|
||||
|
||||
// 可以在这里进行测试前的准备工作:
|
||||
// 1. 启动测试数据库
|
||||
// 2. 运行数据库迁移
|
||||
// 3. 准备测试数据
|
||||
// 4. 启动后端服务
|
||||
// 5. 启动前端服务(通常由playwright.config.ts配置)
|
||||
|
||||
const baseURL = config.projects?.[0]?.use?.baseURL || 'http://localhost:5173'
|
||||
|
||||
console.log(`📝 测试基础URL: ${baseURL}`)
|
||||
|
||||
// 等待服务启动
|
||||
await new Promise(resolve => setTimeout(resolve, 2000))
|
||||
|
||||
console.log('✅ E2E测试全局设置完成!')
|
||||
}
|
||||
|
||||
export default globalSetup
|
||||
Reference in New Issue
Block a user