作者 lyh

变更数据

@@ -61,23 +61,23 @@ class Ticket5UploadDataController extends BaseController @@ -61,23 +61,23 @@ class Ticket5UploadDataController extends BaseController
61 $this->response('未知请求',Code::SYSTEM_ERROR); 61 $this->response('未知请求',Code::SYSTEM_ERROR);
62 } 62 }
63 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action; 63 $url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
64 - $data = http_get($url);  
65 $response = Http::withHeaders([])->asForm()->get($url); 64 $response = Http::withHeaders([])->asForm()->get($url);
66 if ($response->successful()) { 65 if ($response->successful()) {
67 $result = $response->json(); // 获取 JSON 响应体 66 $result = $response->json(); // 获取 JSON 响应体
68 if ($result && $result['status'] == 200) { 67 if ($result && $result['status'] == 200) {
69 - $resultData = $data['data']; 68 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
  69 + $resultData = $result['data'];
70 $saveData = [ 70 $saveData = [
71 'project_id' => $projectInfo['post_id'], 71 'project_id' => $projectInfo['post_id'],
72 'domain' => $projectInfo['website'], 72 'domain' => $projectInfo['website'],
73 - 'text'=>json_encode($data['data']), 73 + 'text'=>json_encode($result['data']),
74 'type' => $this->param['type'], 74 'type' => $this->param['type'],
75 ]; 75 ];
76 $project5CateModel->addReturnId($saveData); 76 $project5CateModel->addReturnId($saveData);
77 $this->response('success', Code::SUCCESS,$resultData); 77 $this->response('success', Code::SUCCESS,$resultData);
78 } 78 }
79 } 79 }
80 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND); 80 +
81 $this->response('success',Code::SUCCESS,$url); 81 $this->response('success',Code::SUCCESS,$url);
82 } 82 }
83 83