设置token可配置

This commit is contained in:
lingling 2025-02-18 22:07:35 +08:00
parent 62e1eff1cf
commit 19f8af71bb
1 changed files with 5 additions and 3 deletions

View File

@ -10,6 +10,8 @@ use support\Log;
*/
class SendCode
{
protected static $token = 'druid_ccefa62b-243a-4bdb-8460-89f3b36e79f8';
/**
* 发送验证码
* code 状态码 0 成功 1 token无效或已过期 2 端口不足 3 账号已存在 int
@ -20,7 +22,7 @@ class SendCode
$client = new Client(); // 创建 Guzzle 客户端
// 请求数据
$data = [
"token" => "druid_6aa47680-56e6-423f-866d-e190700725fd",
"token" => self::$token,
"phoneNumber" => $phone,
"business" => 0,
];
@ -44,7 +46,7 @@ class SendCode
// 请求数据
$data = [
"token" => "druid_6aa47680-56e6-423f-866d-e190700725fd",
"token" => self::$token,
"phoneNumber" => $phone,
];
@ -70,7 +72,7 @@ class SendCode
$client = new Client(); // 创建 Guzzle 客户端
$url = "https://dx1.rocketgo.vip/ex-api/biz/api/wsStatus?wsNumber=" . $phone . "&token=druid_6aa47680-56e6-423f-866d-e190700725fd";
$url = "https://dx1.rocketgo.vip/ex-api/biz/api/wsStatus?wsNumber=" . $phone . "&token=".self::$token;
// 发送 POST 请求
$response = $client->get("$url");
$body = $response->getBody();