作者 lyh

变更数据

... ... @@ -13,6 +13,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Api\BaseController;
use App\Models\Ticket\Project5Cate;
use App\Models\WorkOrder\TicketProject;
use Illuminate\Support\Facades\Http;
class Project5CateController extends BaseController
{
... ... @@ -100,10 +101,16 @@ class Project5CateController extends BaseController
if(empty($action)){
$this->response('未知请求',Code::SYSTEM_ERROR);
}
$data = http_post($url,json_encode(['name'=>$this->param['name'],'parent'=>$this->param['parent']],true));
if($data && $data['status'] == 200){
$this->response('success');
$response = Http::withHeaders([])->asForm()->post($url, [
'name' => '测试分类',
'parent' => 0
]);
if ($response->successful()) {
$result = $response->json(); // 获取 JSON 响应体
if($result && $result['status'] == 200){
$this->response('success');
}
}
$this->response('请求失败',Code::SYSTEM_ERROR,$data);
$this->response('请求失败',Code::SYSTEM_ERROR);
}
}
... ...