- 更新了 DEPLOYMENT.md 文档,增加了更多部署细节和说明 - 添加了 Linux 和 Windows 平台的自动化部署脚本 - 更新了 README.md,增加了部署相关说明 - 调整了 .env 文件配置,以适应新的部署流程 - 移除了部分不必要的代码和配置
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
// 测试模拟数据功能
|
|
const mockAPI = require('./src/api/mockData.ts')
|
|
|
|
console.log('🧪 测试模拟数据API...')
|
|
|
|
// 测试登录功能
|
|
console.log('\n1. 测试登录功能')
|
|
mockAPI.mockAuthAPI.login({ username: 'admin', password: 'admin123' })
|
|
.then(response => {
|
|
console.log('✅ 登录成功:', response.data.admin.username)
|
|
return mockAPI.mockAuthAPI.getCurrentUser()
|
|
})
|
|
.then(response => {
|
|
console.log('✅ 获取当前用户成功:', response.data.admin.nickname)
|
|
})
|
|
.catch(error => {
|
|
console.log('❌ 登录测试失败:', error.message)
|
|
})
|
|
|
|
// 测试用户列表
|
|
console.log('\n2. 测试用户列表')
|
|
mockAPI.mockUserAPI.getUsers({ page: 1, pageSize: 5 })
|
|
.then(response => {
|
|
console.log('✅ 获取用户列表成功:', response.data.list.length + '个用户')
|
|
})
|
|
.catch(error => {
|
|
console.log('❌ 用户列表测试失败:', error.message)
|
|
})
|
|
|
|
// 测试系统统计
|
|
console.log('\n3. 测试系统统计')
|
|
mockAPI.mockSystemAPI.getSystemStats()
|
|
.then(response => {
|
|
console.log('✅ 获取系统统计成功:')
|
|
console.log(' - 用户数:', response.data.userCount)
|
|
console.log(' - 商家数:', response.data.merchantCount)
|
|
console.log(' - 旅行数:', response.data.travelCount)
|
|
console.log(' - 动物数:', response.data.animalCount)
|
|
})
|
|
.catch(error => {
|
|
console.log('❌ 系统统计测试失败:', error.message)
|
|
})
|
|
|
|
console.log('\n🎉 模拟数据测试完成!') |