$level, 'levelName' => "第{$level}档", 'config' => $config ]; } return view('admin.common_config.index', compact('configs')); } public function update(Request $request) { $config = $request->input('config'); \Log::info('公用配置更新请求', [ 'config' => $config, 'all_data' => $request->all() ]); if (!$config) { \Log::error('公用配置更新失败:参数错误'); return response()->json(['status' => 'error', 'message' => '参数错误']); } try { $configData = json_decode($config, true); if (json_last_error() !== JSON_ERROR_NONE) { \Log::error('公用配置更新失败:JSON格式错误', ['error' => json_last_error_msg()]); throw new \Exception('JSON格式错误: ' . json_last_error_msg()); } Redis::set("GameConfigX_Common", $config); \Log::info('公用配置更新成功'); return response()->json(['status' => 'success', 'message' => '更新成功']); } catch (\Exception $e) { \Log::error('公用配置更新失败:异常', ['message' => $e->getMessage()]); return response()->json(['status' => 'error', 'message' => $e->getMessage()]); } } }