feat: 完善 CI/CD 配置并修复代码质量问题

## 修复内容

### 前端 (Frontend)
- 修复 ESLint 错误:未使用变量重命名为下划线前缀
- 修复 TypeScript 类型错误:完善 BackendPhoto 接口定义
- 修复引号转义问题:搜索结果显示优化
- 优化 useEffect 依赖:添加 useCallback 避免无限循环
- 移除未使用的导入和变量

### 后端 (Backend)
- 修复 go vet 错误:测试文件中的字段名称不匹配
- 修复数组访问错误:使用正确的结构体字段路径
- 统一代码格式:go fmt 自动格式化

### 管理后台 (Admin)
- 创建缺失的 ESLint 配置文件
- 修复 React 导入缺失问题
- 确保 TypeScript 编译通过

## CI/CD 改进
- 验证了前端、后端、管理后台的完整构建流程
- 所有 lint 检查、类型检查、测试均通过
- 为自动化部署做好准备

## 技术细节
- 前端:修复 5+ ESLint 错误,完善类型定义
- 后端:修复 3+ go vet 错误,通过所有测试
- 管理后台:创建 ESLint 配置,修复导入问题
- 所有模块均可正常构建和运行
This commit is contained in:
xujiang
2025-07-14 10:01:48 +08:00
parent 8a0792500e
commit 48b6a5f4aa
11 changed files with 297 additions and 239 deletions

View File

@ -8,7 +8,7 @@ class CategoryService {
// 获取所有分类
async getAllCategories(): Promise<Category[]> {
if (process.env.NEXT_PUBLIC_USE_REAL_API === 'true') {
const response: any = await api.get('/categories?page=1&page_size=100')
const response: { categories: Category[] } = await api.get('/categories?page=1&page_size=100')
return response?.categories || []
} else {
// Mock API 返回字符串数组,需要转换