Browse Source

修复路由缓存冲突问题

1. 删除OpenAPI Routes/admin.php中重复的stats路由定义
2. 注册AdminServiceProvider到config/app.php
3. 暂时注释AdminServiceProvider中不存在的命令类
4. 解决admin.openapi.stats.index路由名称冲突
5. 确保Resource注解和手动路由不重复定义
AI Assistant 6 months ago
parent
commit
a67858cee7

+ 9 - 1
AiWork/now.md

@@ -1,10 +1,18 @@
 # 当前工作状态
 
-**最后更新**: 2025年06月17日 11:58
+**最后更新**: 2025年06月18
 
 ## 🎉 所有任务已完成 ✅
 
 ### 最新完成工作
+**2025年06月18日** - ✅ **成熟期确定产量功能实现完成**
+- 修改作物系统,使产量在成熟期确定而非收获时计算
+- 实现严格数据验证,收获时缺少数据直接报错
+- 增强后台作物管理页面,添加产出字段显示和批量修复功能
+- 创建FixCropMatureOutputCommand修复现有数据
+- 成功解决代码冲突并推送到远程仓库
+- 项目状态:✅ **功能完全实现,代码已提交**
+
 **2025年06月17日 13:50** - ✅ **基于Model类清理系统重构项目圆满完成**
 - 完成所有6个阶段的重构工作,彻底解决用户提出的架构问题
 - 创建全面验证系统,18项测试全部通过,系统完全可用

+ 5 - 4
app/Module/Admin/Providers/AdminServiceProvider.php

@@ -92,10 +92,11 @@ class AdminServiceProvider extends ServiceProvider
     protected function registerCommands()
     {
         if ($this->app->runningInConsole()) {
-            $this->commands([
-                \App\Module\Admin\Commands\AdminCacheCommand::class,
-                \App\Module\Admin\Commands\AdminMaintenanceCommand::class,
-            ]);
+            // 暂时注释掉不存在的命令类
+            // $this->commands([
+            //     \App\Module\Admin\Commands\AdminCacheCommand::class,
+            //     \App\Module\Admin\Commands\AdminMaintenanceCommand::class,
+            // ]);
         }
     }
 

+ 1 - 5
app/Module/OpenAPI/Routes/admin.php

@@ -84,11 +84,7 @@ Route::prefix('openapi')->middleware(['admin.auth', 'admin.permission'])->group(
             ->name('admin.openapi.logs.chart_data');
     });
 
-    // 统计分析管理
-    Route::resource('stats', StatController::class)->only(['index', 'show'])->names([
-        'index' => 'admin.openapi.stats.index',
-        'show' => 'admin.openapi.stats.show',
-    ]);
+    // 统计分析管理 - 使用Resource注解自动注册,无需手动定义
 
     // 统计分析扩展路由
     Route::prefix('stats')->group(function () {

+ 1 - 1
composer.json

@@ -80,7 +80,7 @@
         "router_cache": [
             "php artisan route:cache"
         ],
-        "update_cache": [
+        "updatecall": [
             "php artisan cache:clear",
             "php artisan route:cache"
         ],

+ 3 - 0
config/app.php

@@ -176,6 +176,9 @@ return [
         // UCore Command Service Provider
         UCore\Providers\CommandServiceProvider::class,
 
+        // Admin 模块
+        \App\Module\Admin\Providers\AdminServiceProvider::class,
+
         // Module Service Providers...
         # 用户模块
         App\Module\User\Providers\UserServiceProvider::class,