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; + } +}