diff --git a/app/AutoReseed.php b/app/AutoReseed.php index c762f03..ec0ece2 100644 --- a/app/AutoReseed.php +++ b/app/AutoReseed.php @@ -103,9 +103,12 @@ class AutoReseed */ public static function init() { + global $configALL; + self::$curl = new Curl(); + self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); + self::$curl->setOpt(CURLOPT_SSL_VERIFYHOST, false); // 显示支持站点列表 self::ShowTableSites(); - global $configALL; self::$clients = isset($configALL['default']['clients']) && $configALL['default']['clients'] ? $configALL['default']['clients'] : array(); echo "程序正在初始化运行参数... ".PHP_EOL; // 递归删除上次历史记录 @@ -118,8 +121,6 @@ class AutoReseed self::links(); // 合作站点自动注册鉴权 Oauth::login(self::$apiUrl . self::$endpoints['login']); - self::$curl = new Curl(); - self::$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); } /** @@ -134,12 +135,8 @@ class AutoReseed foreach ($list as $key => $value) { echo $value.PHP_EOL; } - // 发起请求 echo "正在连接IYUUAutoReseed服务器,查询支持列表…… ".PHP_EOL; - $curl = new Curl(); - $curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); // 禁止验证证书 - $curl->setOpt(CURLOPT_SSL_VERIFYHOST, false); // 不检查证书 - $res = $curl->get(self::$apiUrl.self::$endpoints['sites'].'?sign='.Oauth::getSign()); + $res = self::$curl->get(self::$apiUrl.self::$endpoints['sites'].'?sign='.Oauth::getSign()); $rs = json_decode($res->response, true); $sites = isset($rs['data']['sites']) && $rs['data']['sites'] ? $rs['data']['sites'] : false; // 数据写入本地 @@ -432,7 +429,6 @@ class AutoReseed } } } - // 发起请求 echo "正在提交辅种信息……".PHP_EOL; $res = self::$curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray); $res = json_decode($res->response, true); @@ -869,7 +865,6 @@ class AutoReseed return substr($path, strlen($key)); } } - return $path; break; case 2: // 加 foreach ($pathArray as $key => $val) { @@ -884,7 +879,6 @@ class AutoReseed return $val . substr($path, strlen($key)); } } - return $path; break; default: return $path; diff --git a/readme.md b/readme.md index cc4ce5b..df6a8fd 100644 --- a/readme.md +++ b/readme.md @@ -49,6 +49,9 @@ IYUU自动辅种工具(英文名:IYUUAutoReseed),是一款PHP语言编 https://gitee.com/ledc/IYUUAutoReseed/wikis https://gitee.com/ledc/IYUUAutoReseed/tree/master/wiki +## 接口文档 +http://api.iyuu.cn/docs.php?type=expand + ## 需求提交/错误反馈 - 点击链接加入群聊【IYUU自动辅种交流】:[https://jq.qq.com/?_wv=1027&k=5JOfOlM][1] @@ -108,7 +111,7 @@ https://gitee.com/ledc/IYUUAutoReseed/tree/master/wiki | 寒山先生 | ¥200元 | 2020年1月18日12:37 | | 小城流水 | ¥5元 | 2020年1月22日22:14 | | 国旗(未署名) | ¥8.8元 | 2020年1月22日23:28 | -| 当下捐赠 | ¥100元 | 2020年1月28日1:45 | +| 当下丶 | ¥100元 | 2020年1月28日1:45 | 补充说明: