From b827132931b9db8bac58824564ff3a750ac93a2d Mon Sep 17 00:00:00 2001 From: Lkeme <19500576+lkeme@users.noreply.github.com> Date: Sun, 6 Aug 2023 16:21:56 +0800 Subject: [PATCH] [update] VipPoint --- README.md | 19 +++--- captcha/index.php | 7 +- captcha/static/css/style.css | 4 +- captcha/static/index.html | 76 +++++++++++----------- captcha/static/js/gt.js | 9 +-- captcha/static/js/index.js | 2 +- docs/CAPTCHA.md | 6 +- docs/DOC.md | 45 +++++++------ plugin/DailyGold/DailyGold.php | 2 +- plugin/MainSite/MainSite.php | 2 +- plugin/VipPoint/Traits/Bonus.php | 3 +- plugin/VipPoint/Traits/DressBuyAmount.php | 39 +++++++++++ plugin/VipPoint/Traits/DressView.php | 40 ++++++++++++ plugin/VipPoint/Traits/PointInfo.php | 13 +++- plugin/VipPoint/Traits/Privilege.php | 5 +- plugin/VipPoint/Traits/ViewAnimate.php | 1 - plugin/VipPoint/Traits/ViewFilmChannel.php | 3 +- plugin/VipPoint/Traits/ViewVipMall.php | 3 +- plugin/VipPoint/VipPoint.php | 27 ++++++-- src/Api/Api/Pgc/Activity/Score/ApiTask.php | 2 + src/Api/Passport/ApiCaptcha.php | 5 +- src/Api/PassportTv/ApiQrcode.php | 2 +- src/Request/MultiRequest.php | 4 +- src/Task/Task.php | 2 +- src/TimeLock/TimeLock.php | 2 +- src/Util/Qrcode/Lib/QrSpec.php | 2 +- 26 files changed, 216 insertions(+), 109 deletions(-) create mode 100644 plugin/VipPoint/Traits/DressBuyAmount.php create mode 100644 plugin/VipPoint/Traits/DressView.php diff --git a/README.md b/README.md index c90b665..1c24342 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -

+

-[//]: # (

) +[//]: # (

) -
+
[![](https://img.shields.io/badge/Author-Lkeme-blueviolet "作者")](https://github.com/lkeme/ ) ![](https://img.shields.io/badge/dynamic/json?label=GitHub%20Followers&query=%24.data.totalSubs&url=https%3A%2F%2Fapi.spencerwoo.com%2Fsubstats%2F%3Fsource%3Dgithub%26queryKey%3Dlkeme&labelColor=282c34&color=181717&logo=github&longCache=true "关注数量") @@ -27,7 +27,7 @@ [//]: # (
)
-

+

@@ -53,8 +53,8 @@ ## 👤 游客访问 -

- +

+ [//]: # (
) @@ -77,7 +77,7 @@ 如果觉得本项目好用,对你有所帮助,欢迎打赏支持本项目,请作者喝杯奶茶可乐哦。 -

+

[comment]: <> (![Image](https://i.loli.net/2019/07/13/5d2963e5cc1eb22973.png)) @@ -92,7 +92,7 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问 以下任务都是按设定周期自动执行,`true`为正常使用,`false`为暂停使用或抛弃。 [//]: # (
点击展开) -
已经藏起来啦~~ 点击展开 嘻嘻~ +
已经藏起来啦~~ 点击展开 嘻嘻~
@@ -117,7 +117,6 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问 | DailyGold | 0.0.1 | 每日电池(APP) | Lkeme | 1114 | 24(小时) | √ | | PolishMedal | 0.0.1 | 点亮灰色勋章 | possible318/Lkeme | 1115 | 1(小时) | √ | -
## 🖥️星图 @@ -130,7 +129,7 @@ Group: [602815575](https://jq.qq.com/?_wv=1027&k=UaalVexM) | **请不要来问 效果图不代表当前版本,请以当前最新版本运行结果为准。 -

+

[comment]: <> (![Image](https://i.loli.net/2019/07/13/5d296961a4bae41364.png)) diff --git a/captcha/index.php b/captcha/index.php index f5a5770..62ee484 100644 --- a/captcha/index.php +++ b/captcha/index.php @@ -15,7 +15,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - class JsonFileManager { private string $filename; @@ -109,7 +108,7 @@ class HttpServer 'seccode' => $seccode, ]; $this->json->write($data); - $this->toResponse(10003); + $this->toResponse(10003); return; } if ($path === '/fetch' && $method === 'GET') { @@ -117,9 +116,9 @@ class HttpServer $challenge = $_GET['challenge']; $data = $this->json->read(); if (empty($data[$challenge])) { - $this->toResponse(10001, '暂未获取到验证结果'); + $this->toResponse(10001, '暂未获取到验证结果'); } else { - $this->toResponse(10000, '成功获取到验证结果', $data[$challenge]); + $this->toResponse(10000, '成功获取到验证结果', $data[$challenge]); } return; } diff --git a/captcha/static/css/style.css b/captcha/static/css/style.css index 4701602..b121e53 100644 --- a/captcha/static/css/style.css +++ b/captcha/static/css/style.css @@ -90,6 +90,7 @@ a { outline: 0; box-shadow: 0 0 0 4px rgb(32 107 196 / 25%); } + .form-control:disabled { background-color: #f1f5f9; opacity: 1; @@ -123,6 +124,7 @@ a { background-color: #437cff; border-color: transparent; } + #success { background-color: #2fb344; cursor: default; @@ -188,4 +190,4 @@ a { .geetest_radar_btn { border-radius: 4px !important; -} \ No newline at end of file +} diff --git a/captcha/static/index.html b/captcha/static/index.html index cf848cb..a75249a 100644 --- a/captcha/static/index.html +++ b/captcha/static/index.html @@ -14,49 +14,49 @@ -
-
极验手动验证
-
- - -
-
- - -
+
+
极验手动验证
+
+ + +
+
+ + +
-
-
生成验证码
-
验证成功
-
-
-
-
-
-
-
+
+
生成验证码
+
验证成功
+
+
+
+
+
+
- -
-
验证结果
-
- - -
-
- - -
-
- - -
-
提交反馈结果
-
-
消息
+
+
验证结果
+
+ + +
+
+ + +
+
+ + +
+
提交反馈结果
+
+
+ +
消息
diff --git a/captcha/static/js/gt.js b/captcha/static/js/gt.js index 1b57f93..1fcdee2 100644 --- a/captcha/static/js/gt.js +++ b/captcha/static/js/gt.js @@ -126,7 +126,7 @@ script.async = true; // 对geetest的静态资源添加 crossOrigin - if ( /static\.geetest\.com/g.test(url)) { + if (/static\.geetest\.com/g.test(url)) { script.crossOrigin = "anonymous"; } @@ -258,7 +258,8 @@ pt: pt, exception_url: url, error_code: config.error_code - }, function (err) {}) + }, function (err) { + }) } var throwError = function (errorType, config) { @@ -298,11 +299,11 @@ config.api_server = 'yumchina.geetest.com'; } - if(userConfig.gt){ + if (userConfig.gt) { window.GeeGT = userConfig.gt } - if(userConfig.challenge){ + if (userConfig.challenge) { window.GeeChallenge = userConfig.challenge } diff --git a/captcha/static/js/index.js b/captcha/static/js/index.js index 4bb9ac1..c2a4690 100644 --- a/captcha/static/js/index.js +++ b/captcha/static/js/index.js @@ -143,7 +143,7 @@ window.onload = function () { dataType: 'json', data: { challenge: challengeInput.value, - new_challenge : newChallengeInput.value, + new_challenge: newChallengeInput.value, validate: validateInput.value, seccode: seccodeInput.value }, diff --git a/docs/CAPTCHA.md b/docs/CAPTCHA.md index 7d6b56a..99dabb3 100644 --- a/docs/CAPTCHA.md +++ b/docs/CAPTCHA.md @@ -12,7 +12,7 @@ enable = false url = "http://localhost:50001" ``` -### 如何开启验证码手动识别服务地址 +### 如何开启验证码手动识别服务地址 > 需要手动开启配置开关`enable = true`,并且配置`url`为验证码手动识别服务地址。 @@ -28,7 +28,6 @@ docker run -itd --rm -e CAPTCHA=1 -e CAPTCHA_HOST=localhost -e CAPTCHA_PORT=5000 -e CAPTCHA_PORT=50002 # 验证码手动识别服务地址 默认 50001 需要注意端口映射关系 ``` - > 注意:如果你使用的是`docker-compose`,请参考`docker-compose.yml`文件中的`captcha`服务配置。 ##### 本地用户 @@ -40,8 +39,7 @@ cd captcha && php -S localhost:50002 > 验证码处理目录在`captcha`目录下,可以自行修改。 - -### 如何使用验证码手动识别服务地址 +### 如何使用验证码手动识别服务地址 在开启验证码手动识别服务地址后,登录模块会自动显示手动地址。复制地址到浏览器中打开,会显示相应的界面。 diff --git a/docs/DOC.md b/docs/DOC.md index 02cbfb6..2c5e7a0 100644 --- a/docs/DOC.md +++ b/docs/DOC.md @@ -1,8 +1,8 @@ -

+

-[comment]: <> (

) +[comment]: <> (

) -
+
[![](https://img.shields.io/badge/Author-Lkeme-blueviolet "作者")](https://github.com/lkeme/ ) ![](https://img.shields.io/badge/dynamic/json?label=GitHub%20Followers&query=%24.data.totalSubs&url=https%3A%2F%2Fapi.spencerwoo.com%2Fsubstats%2F%3Fsource%3Dgithub%26queryKey%3Dlkeme&labelColor=282c34&color=181717&logo=github&longCache=true "关注数量") @@ -64,7 +64,9 @@
其余镜像 展开查看

+
 + cnpkg(全量镜像)
+
 ```shell script
 # 使用帮助
 > https://php.cnpkg.org/
@@ -108,7 +110,8 @@
 > composer config -g repos.packagist composer https://packagist.mirrors.sjtug.sjtu.edu.cn
 ```
 
-
+ +
## 使用指南 @@ -176,27 +179,28 @@ $ php app.php 9. 单个或者多个插件测试 ```shell -$ php app.php test m:d -p plugin -$ php app.php test m:d -P plugin,plugin1 -$ php app.php test m:d -p VipPoint +$ php app.php test m:d -p plugin # 单个插件 +$ php app.php test m:d -p VipPoint # 单个插件示例 +$ php app.php test m:d -P plugin,plugin1 # 多个插件 +$ php app.php test m:d -P VipPoint,Lottery # 多个插件 ``` -

+

-[comment]: <> (

) +[comment]: <> (

) ## Docker使用指南 🌐 镜像加速器(部分网络原因导致拉取镜像失败)

-
已经藏起来啦~~ 点击展开 嘻嘻~ +
~ -> 以下是通用系统配置,部分特殊系统修改可能不一样,请自行搜索解决。 +> 以下是通用系统配置,部分特殊系统修改可能不一样,请自行搜索解决。 -`在文件 /etc/docker/daemon.json 写入以下内容,如果部分不可用节点自行删除` +`在文件 /etc/docker/daemon.json 写入以下内容,如果部分不可用节点自行删除` ```json { - "registry-mirrors":[ + "registry-mirrors": [ "https://0b27f0a81a00f3560fbdc00ddd2f99e0.mirror.swr.myhuaweicloud.com", "https://dockerproxy.com", "https://hub-mirror.c.163.com", @@ -210,10 +214,10 @@ $ php app.php test m:d -p VipPoint } ``` +
- 1. 安装好[Docker](https://yeasy.gitbooks.io/docker_practice/content/install/) 2. 直接命令行拉取镜像后运行 @@ -231,7 +235,10 @@ $ docker run -itd --rm -e USER_NAME=你的B站登录账号 -e USER_PASSWORD=你 [//]: # (2. 修改) -1. 下载 [配置文件夹](https://github.com/lkeme/BiliHelper-personal/tree/master/profile) `注意是文件夹,可以完整下载后提出来` +1. + +下载 [配置文件夹](https://github.com/lkeme/BiliHelper-personal/tree/master/profile) `注意是文件夹,可以完整下载后提出来` + 2. 重命名 `profile/example -> profile/user` , 修改 `profile/user/config/user.ini` 3. 通过下面的命令进行挂载并运行 @@ -355,10 +362,10 @@ stdout_logfile=/tmp/bilibili.log 脚本出现 error 级别的报错,会调用通知地址进行提醒,这里推荐两个服务 -|服务|官网| -|---|---| -|Server酱|https://sc.ftqq.com/| -|TelegramBot|https://core.telegram.org/bots/api| +| 服务 | 官网 | +|-------------|------------------------------------| +| Server酱 | https://sc.ftqq.com/ | +| TelegramBot | https://core.telegram.org/bots/api | 示范如下 diff --git a/plugin/DailyGold/DailyGold.php b/plugin/DailyGold/DailyGold.php index d3c1547..f72c77b 100644 --- a/plugin/DailyGold/DailyGold.php +++ b/plugin/DailyGold/DailyGold.php @@ -137,7 +137,7 @@ class DailyGold extends BasePlugin $filteredArray = array_filter($filteredArray, function ($element) { return ($element['status'] == 2); }); - if ($filteredArray){ + if ($filteredArray) { Log::info("每日电池: 任务已经完成,可以领取奖励"); return -2; } diff --git a/plugin/MainSite/MainSite.php b/plugin/MainSite/MainSite.php index e355493..7163a8f 100644 --- a/plugin/MainSite/MainSite.php +++ b/plugin/MainSite/MainSite.php @@ -268,7 +268,7 @@ class MainSite extends BasePlugin return 0; } // - $logs = $response['data']['list'] ; + $logs = $response['data']['list']; $coins = 0; // foreach ($logs as $log) { diff --git a/plugin/VipPoint/Traits/Bonus.php b/plugin/VipPoint/Traits/Bonus.php index 6e75377..af2db08 100644 --- a/plugin/VipPoint/Traits/Bonus.php +++ b/plugin/VipPoint/Traits/Bonus.php @@ -14,7 +14,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - trait Bonus { use CommonTaskInfo; @@ -33,7 +32,7 @@ trait Bonus return true; } // - $this->worker($data, $name, $title, $code,1); + $this->worker($data, $name, $title, $code, 1); return false; } diff --git a/plugin/VipPoint/Traits/DressBuyAmount.php b/plugin/VipPoint/Traits/DressBuyAmount.php new file mode 100644 index 0000000..d20dac0 --- /dev/null +++ b/plugin/VipPoint/Traits/DressBuyAmount.php @@ -0,0 +1,39 @@ +isComplete($data, $name, $title, $code)) { + return true; + } + // + return $this->worker($data, $name, $title, $code, 4); + } + + +} diff --git a/plugin/VipPoint/Traits/DressView.php b/plugin/VipPoint/Traits/DressView.php new file mode 100644 index 0000000..8769a01 --- /dev/null +++ b/plugin/VipPoint/Traits/DressView.php @@ -0,0 +1,40 @@ +isComplete($data, $name, $title, $code)) { + return true; + } + // + $this->worker($data, $name, $title, $code, 1); + return false; + } + + +} diff --git a/plugin/VipPoint/Traits/PointInfo.php b/plugin/VipPoint/Traits/PointInfo.php index 4077e9d..19569dd 100644 --- a/plugin/VipPoint/Traits/PointInfo.php +++ b/plugin/VipPoint/Traits/PointInfo.php @@ -26,10 +26,17 @@ trait PointInfo */ public function pointInfo(array $data, string $name): bool { - $now = date('Y-m-d H:i:s', $data['data']['current_ts']); + $ts = date('Y-m-d H:i:s', $data['data']['current_ts']); $point = $data['data']['point_info']['point']; - - Log::notice("大会员积分@{$name}: 截至 {$now} 您当前拥有 {$point} 个积分"); + Log::notice("大会员积分@$name: 截至 $ts 您当前拥有 $point 个积分"); + // + $score_limit = $data['data']['task_info']['score_limit']; + $score_month = $data['data']['task_info']['score_month']; + Log::notice("大会员积分@$name: 本月已经获得 $score_month/$score_limit 大积分"); + // + $base_score = $data['data']['task_info']['sing_task_item']['base_score']; + $sign_count = $data['data']['task_info']['sing_task_item']['count']; + Log::notice("大会员积分@$name: 已连续签到 $sign_count 天 获取到 $base_score 个大积分"); return true; } diff --git a/plugin/VipPoint/Traits/Privilege.php b/plugin/VipPoint/Traits/Privilege.php index 2870fe7..fa7fde4 100644 --- a/plugin/VipPoint/Traits/Privilege.php +++ b/plugin/VipPoint/Traits/Privilege.php @@ -14,7 +14,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - trait Privilege { use CommonTaskInfo; @@ -24,7 +23,7 @@ trait Privilege * @param string $name * @return bool */ - public function privilege(array $data, string $name):bool + public function privilege(array $data, string $name): bool { $title = '体验任务'; $code = 'privilege'; @@ -33,7 +32,7 @@ trait Privilege return true; } // - $this->worker($data, $name, $title, $code,1); + $this->worker($data, $name, $title, $code, 1); return false; } diff --git a/plugin/VipPoint/Traits/ViewAnimate.php b/plugin/VipPoint/Traits/ViewAnimate.php index dfd56f5..be56fa5 100644 --- a/plugin/VipPoint/Traits/ViewAnimate.php +++ b/plugin/VipPoint/Traits/ViewAnimate.php @@ -14,7 +14,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - trait ViewAnimate { use CommonTaskInfo; diff --git a/plugin/VipPoint/Traits/ViewFilmChannel.php b/plugin/VipPoint/Traits/ViewFilmChannel.php index 5f7a1d1..464dbcf 100644 --- a/plugin/VipPoint/Traits/ViewFilmChannel.php +++ b/plugin/VipPoint/Traits/ViewFilmChannel.php @@ -14,7 +14,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - trait ViewFilmChannel { use CommonTaskInfo; @@ -34,7 +33,7 @@ trait ViewFilmChannel return true; } // - $this->worker($data, $name, $title, $code,2, $channel); + $this->worker($data, $name, $title, $code, 2, $channel); return false; } diff --git a/plugin/VipPoint/Traits/ViewVipMall.php b/plugin/VipPoint/Traits/ViewVipMall.php index 186b1cf..2f2f36d 100644 --- a/plugin/VipPoint/Traits/ViewVipMall.php +++ b/plugin/VipPoint/Traits/ViewVipMall.php @@ -14,7 +14,6 @@ * | |_| | | | | |___ | | | | | | | |___ | |___ | | | |___ | | \ \  じしf_, )ノ * |_____/ |_| |_____| |_| |_| |_| |_____| |_____| |_| |_____| |_| \_\ */ - trait ViewVipMall { use CommonTaskInfo; @@ -33,7 +32,7 @@ trait ViewVipMall return true; } // - $this->worker($data, $name, $title, $code,3); + $this->worker($data, $name, $title, $code, 3); return false; } diff --git a/plugin/VipPoint/VipPoint.php b/plugin/VipPoint/VipPoint.php index 861950e..5d49580 100644 --- a/plugin/VipPoint/VipPoint.php +++ b/plugin/VipPoint/VipPoint.php @@ -16,6 +16,7 @@ */ +use Bhp\Api\Api\X\VipPoint\ApiTask; use Bhp\Cache\Cache; use Bhp\Log\Log; use Bhp\Plugin\BasePlugin; @@ -39,6 +40,8 @@ class VipPoint extends BasePlugin use BuyVipProduct; use BuyVipMall; use PointInfo; + use DressView; + use DressBuyAmount; /** * 插件信息 @@ -54,6 +57,16 @@ class VipPoint extends BasePlugin 'cycle' => '5(分钟)', // 运行周期 ]; + /** + * @var string + */ + protected string $home_task = 'https://big.bilibili.com/mobile/bigPoint/task'; + + /** + * @var string + */ + protected string $home = 'https://big.bilibili.com/mobile/bigPoint'; + /** * @var string */ @@ -69,9 +82,11 @@ class VipPoint extends BasePlugin * @var array|string[] */ protected array $target_tasks = [ - 'signIn' => '签到任务', - 'bonus' => '福利任务', - 'privilege' => '体验任务', +// 'dressUp' => '使用免费体验装扮权益', + + 'signIn' => '每日签到', + 'bonus' => '大会员福利大积分', + 'privilege' => '浏览大会员权益页面', 'viewAnimate' => '浏览追番频道页10秒', 'viewFilmChannel' => '浏览影视频道页10秒', 'viewVipMall' => '浏览会员购页面10秒', @@ -79,7 +94,9 @@ class VipPoint extends BasePlugin 'buyVipVideo' => '购买单点付费影片', 'buyVipProduct' => '购买指定大会员产品', 'buyVipMall' => '购买指定会员购商品', - 'pointInfo' => '已有积分' + 'dressView' => '浏览装扮商城主页', + 'dressBuyAmount' => '购买装扮', + 'pointInfo' => '积分信息' ]; /** @@ -174,7 +191,7 @@ class VipPoint extends BasePlugin */ protected function getTaskList(): bool { - $response = \Bhp\Api\Api\X\VipPoint\ApiTask::combine(); + $response = ApiTask::combine(); if ($response['code']) { Log::warning('大会员积分: 获取任务列表失败'); return false; diff --git a/src/Api/Api/Pgc/Activity/Score/ApiTask.php b/src/Api/Api/Pgc/Activity/Score/ApiTask.php index b2dce96..6f827fb 100644 --- a/src/Api/Api/Pgc/Activity/Score/ApiTask.php +++ b/src/Api/Api/Pgc/Activity/Score/ApiTask.php @@ -62,6 +62,7 @@ class ApiTask $user = User::parseCookie(); // $url = 'https://api.bilibili.com/pgc/activity/score/task/receive'; + // $url = 'https://api.bilibili.com/pgc/activity/score/task/receive/v2'; $payload = [ 'taskCode' => $task_code, 'csrf' => $user['csrf'], @@ -82,6 +83,7 @@ class ApiTask $user = User::parseCookie(); // $url = 'https://api.bilibili.com/pgc/activity/score/task/complete'; + // $url = 'https://api.bilibili.com/pgc/activity/score/task/complete/v2'; $payload = [ 'taskCode' => $task_code, 'csrf' => $user['csrf'], diff --git a/src/Api/Passport/ApiCaptcha.php b/src/Api/Passport/ApiCaptcha.php index c5e810d..6a8c1ce 100644 --- a/src/Api/Passport/ApiCaptcha.php +++ b/src/Api/Passport/ApiCaptcha.php @@ -43,7 +43,8 @@ class ApiCaptcha * @param array $captcha * @return array */ - public static function ocr(array $captcha):array{ + public static function ocr(array $captcha): array + { $url = 'https://captcha-v1.mudew.com:19951/'; $payload = [ 'type' => 'gt3', @@ -54,7 +55,7 @@ class ApiCaptcha $headers = [ 'Content-Type' => 'application/json', ]; - return Request::postJson(true,'other', $url, $payload, $headers); + return Request::postJson(true, 'other', $url, $payload, $headers); } /** diff --git a/src/Api/PassportTv/ApiQrcode.php b/src/Api/PassportTv/ApiQrcode.php index 59036a7..1251efc 100644 --- a/src/Api/PassportTv/ApiQrcode.php +++ b/src/Api/PassportTv/ApiQrcode.php @@ -88,7 +88,7 @@ class ApiQrcode public static function goConfrimUrl(string $url): array { // 取出url的主体部分 - $query = parse_url($url)['query']; + $query = parse_url($url)['query']; // 取出url参数部分转为数组 parse_str($query, $payload); $headers = [ diff --git a/src/Request/MultiRequest.php b/src/Request/MultiRequest.php index 50db72b..90571ce 100644 --- a/src/Request/MultiRequest.php +++ b/src/Request/MultiRequest.php @@ -33,8 +33,8 @@ class MultiRequest protected array $options = []; protected Closure $successCallback; protected Closure $errorCallback; - protected array$urls = []; - protected string$method; + protected array $urls = []; + protected string $method; protected int $concurrency = 10; /** diff --git a/src/Task/Task.php b/src/Task/Task.php index a8803d2..39bee99 100644 --- a/src/Task/Task.php +++ b/src/Task/Task.php @@ -71,7 +71,7 @@ class Task extends SingleTon */ public static function execTasks(): void { - Future\awaitAll(self::$promises); + Future\awaitAll(self::$promises); } } diff --git a/src/TimeLock/TimeLock.php b/src/TimeLock/TimeLock.php index 7ec8a61..0fd64bb 100644 --- a/src/TimeLock/TimeLock.php +++ b/src/TimeLock/TimeLock.php @@ -159,7 +159,7 @@ class TimeLock extends SingleTon * @param string $end * @return bool */ - public static function isWithinTimeRange(string $start, string $end):bool + public static function isWithinTimeRange(string $start, string $end): bool { // date_default_timezone_set('Asia/Shanghai'); $startTime = strtotime(date($start)); diff --git a/src/Util/Qrcode/Lib/QrSpec.php b/src/Util/Qrcode/Lib/QrSpec.php index 4eb5be2..972f39b 100644 --- a/src/Util/Qrcode/Lib/QrSpec.php +++ b/src/Util/Qrcode/Lib/QrSpec.php @@ -75,7 +75,7 @@ class QrSpec return self::$capacity[$version][Constants::QRCAP_WORDS] - self::$capacity[$version][Constants::QRCAP_EC][$level]; } - public static function getECCLength(int $version,int $level) + public static function getECCLength(int $version, int $level) { return self::$capacity[$version][Constants::QRCAP_EC][$level]; }