From 22bb816a36609ce98f4f88e2c175b67c78f80a09 Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Fri, 7 Mar 2025 13:31:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Rocketgo=20API=20?= =?UTF-8?q?=E5=B0=81=E8=A3=85=E7=B1=BB=EF=BC=8C=E6=94=AF=E6=8C=81=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=AA=8C=E8=AF=81=E7=A0=81=E3=80=81=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=8F=8A=E8=B4=A6=E6=88=B7=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Utils/API/Rocketgo.php | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 app/Utils/API/Rocketgo.php diff --git a/app/Utils/API/Rocketgo.php b/app/Utils/API/Rocketgo.php new file mode 100644 index 0000000..0e8b4ca --- /dev/null +++ b/app/Utils/API/Rocketgo.php @@ -0,0 +1,75 @@ +get("self::1baseurl/prod-api1/captchaImage"); + + // 获取响应体内容 + $body = $response->getBody(); + $responseData = json_decode($body, true); // 如果返回的是 JSON 格式,解析它 + return $responseData; + } + //login发送参数 + // { + // "username": "h102067452", + // "password": "yBQnfuBShGl1MTBN", + // "code": "23", + // "uuid": "9cbe6a9037dc47cf80c9f2a23c0672a5" + // } + public static function login($username,$password,$code,$uuid) + { + $client = new Client(); // 创建 Guzzle 客户端 + // 请求数据 + $data = [ + "username" => $username, + "password" => $password, + "code" => $code, + "uuid" => $uuid, + ]; + // 发送 POST 请求 + $response = $client->post("self::1baseurl/prod-api1/login", [ + 'json' => $data, // 以 JSON 格式发送数据 + ]); + // 获取响应体内容 + $body = $response->getBody(); + $responseData = json_decode($body, true); // 如果返回的是 JSON 格式,解析它 + return $responseData; + } + public static function account_list() + { + $client = new Client(); // 创建 Guzzle 客户端 + // 请求数据 + // 发送 POST 请求 + $response = $client->get("self::1baseurl/prod-api1/biz/account/list?pageNum=1&pageSize=1000&accountStatus=1&sendCount=0"); + + // 获取响应体内容 + $body = $response->getBody(); + $responseData = json_decode($body, true); // 如果返回的是 JSON 格式,解析它 + return $responseData; + } +}