#!/bin/bash # Phase 3 验证脚本 echo "======================================" echo "Phase 3 - 上传与存储功能验证" echo "======================================" echo "" # 检查文件是否存在 echo "检查 Rust 源文件..." files=( "src-tauri/src/config.rs" "src-tauri/src/upload.rs" "src-tauri/src/database.rs" "src-tauri/src/lib.rs" "src-tauri/Cargo.toml" ) missing_files=0 for file in "${files[@]}"; do if [ -f "$file" ]; then echo " ✓ $file" else echo " ✗ $file (缺失)" missing_files=$((missing_files + 1)) fi done echo "" echo "检查前端文件..." frontend_files=( "src/api/index.ts" "src/store/index.ts" "src/store/config.ts" "src/store/upload.ts" "src/store/records.ts" "src/store/settings.ts" "src/components/views/ConfigManager.vue" "src/components/views/UploadHistory.vue" ) for file in "${frontend_files[@]}"; do if [ -f "$file" ]; then echo " ✓ $file" else echo " ✗ $file (缺失)" missing_files=$((missing_files + 1)) fi done echo "" echo "======================================" echo "验证结果" echo "======================================" if [ $missing_files -eq 0 ]; then echo "✓ 所有文件都已创建" echo "" echo "下一步:" echo "1. 如果已安装 Rust,运行 'cd src-tauri && cargo check' 检查编译" echo "2. 确保 Node.js 依赖已安装: 'npm install'" echo "3. 启动开发服务器: 'npm run tauri dev'" exit 0 else echo "✗ 缺失 $missing_files 个文件" exit 1 fi