diff --git a/app/data/view/article_content/index.html b/app/data/view/article_content/index.html index f2a003424..c20eccf29 100644 --- a/app/data/view/article_content/index.html +++ b/app/data/view/article_content/index.html @@ -11,6 +11,9 @@ {block name='content'}
+

+ 演示接口文档:http://www.docway.net/project/1WkI0ZyQ7M1/share/1Wld0z7b1zE +

{include file='article_content/index_search'} {notempty name='list'} diff --git a/app/data/view/article_tags/index.html b/app/data/view/article_tags/index.html index 5e1c1cd7a..e67efedf8 100644 --- a/app/data/view/article_tags/index.html +++ b/app/data/view/article_tags/index.html @@ -14,6 +14,9 @@ {block name='content'}
+

+ 演示接口文档:http://www.docway.net/project/1WkI0ZyQ7M1/share/1Wld0z7b1zE +

{include file='article_tags/index_search'}
{notempty name='list'} diff --git a/composer.lock b/composer.lock index 3d9b720da..fb89dc893 100644 --- a/composer.lock +++ b/composer.lock @@ -929,12 +929,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "84f463dd9e1f30421c430f570c0abde3861c4959" + "reference": "e03639f80bccd83c9ab5bb1f1001ea1d62d85afa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/84f463dd9e1f30421c430f570c0abde3861c4959", - "reference": "84f463dd9e1f30421c430f570c0abde3861c4959", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e03639f80bccd83c9ab5bb1f1001ea1d62d85afa", + "reference": "e03639f80bccd83c9ab5bb1f1001ea1d62d85afa", "shasum": "", "mirrors": [ { @@ -978,20 +978,20 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-07-17T08:39:58+00:00" + "time": "2020-07-22T06:32:55+00:00" }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.22", + "version": "v1.2.23", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059" + "reference": "f070dd076a4137ff4e86600b63d1ccfe2f744a92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059", - "reference": "7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/f070dd076a4137ff4e86600b63d1ccfe2f744a92", + "reference": "f070dd076a4137ff4e86600b63d1ccfe2f744a92", "shasum": "", "mirrors": [ { @@ -1044,7 +1044,7 @@ "wechatpay", "wepay" ], - "time": "2020-07-04T07:24:41+00:00" + "time": "2020-07-20T06:55:26+00:00" } ], "packages-dev": [], diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index fb8512d6b..d34cb6c72 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -263,7 +263,6 @@ return array( 'think\\admin\\Exception' => $vendorDir . '/zoujingli/think-library/src/Exception.php', 'think\\admin\\Helper' => $vendorDir . '/zoujingli/think-library/src/Helper.php', 'think\\admin\\Library' => $vendorDir . '/zoujingli/think-library/src/Library.php', - 'think\\admin\\Module' => $vendorDir . '/zoujingli/think-library/src/Module.php', 'think\\admin\\Queue' => $vendorDir . '/zoujingli/think-library/src/Queue.php', 'think\\admin\\Service' => $vendorDir . '/zoujingli/think-library/src/Service.php', 'think\\admin\\Storage' => $vendorDir . '/zoujingli/think-library/src/Storage.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 2a30fe8c1..be7cb838d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -396,7 +396,6 @@ class ComposerStaticInitb911c14a0826c73d9f097343fd33a252 'think\\admin\\Exception' => __DIR__ . '/..' . '/zoujingli/think-library/src/Exception.php', 'think\\admin\\Helper' => __DIR__ . '/..' . '/zoujingli/think-library/src/Helper.php', 'think\\admin\\Library' => __DIR__ . '/..' . '/zoujingli/think-library/src/Library.php', - 'think\\admin\\Module' => __DIR__ . '/..' . '/zoujingli/think-library/src/Module.php', 'think\\admin\\Queue' => __DIR__ . '/..' . '/zoujingli/think-library/src/Queue.php', 'think\\admin\\Service' => __DIR__ . '/..' . '/zoujingli/think-library/src/Service.php', 'think\\admin\\Storage' => __DIR__ . '/..' . '/zoujingli/think-library/src/Storage.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 99f477594..8d19c7203 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -955,12 +955,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "84f463dd9e1f30421c430f570c0abde3861c4959" + "reference": "e03639f80bccd83c9ab5bb1f1001ea1d62d85afa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/84f463dd9e1f30421c430f570c0abde3861c4959", - "reference": "84f463dd9e1f30421c430f570c0abde3861c4959", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e03639f80bccd83c9ab5bb1f1001ea1d62d85afa", + "reference": "e03639f80bccd83c9ab5bb1f1001ea1d62d85afa", "shasum": "", "mirrors": [ { @@ -976,7 +976,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-07-17T08:39:58+00:00", + "time": "2020-07-22T06:32:55+00:00", "type": "library", "extra": { "think": { @@ -1009,17 +1009,17 @@ }, { "name": "zoujingli/wechat-developer", - "version": "v1.2.22", - "version_normalized": "1.2.22.0", + "version": "v1.2.23", + "version_normalized": "1.2.23.0", "source": { "type": "git", "url": "https://github.com/zoujingli/WeChatDeveloper.git", - "reference": "7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059" + "reference": "f070dd076a4137ff4e86600b63d1ccfe2f744a92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059", - "reference": "7eb7f6a2d8aa4a105208c7dff6428dcecd0c7059", + "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/f070dd076a4137ff4e86600b63d1ccfe2f744a92", + "reference": "f070dd076a4137ff4e86600b63d1ccfe2f744a92", "shasum": "", "mirrors": [ { @@ -1039,7 +1039,7 @@ "ext-xml": "*", "php": ">=5.4" }, - "time": "2020-07-04T07:24:41+00:00", + "time": "2020-07-20T06:55:26+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/services.php b/vendor/services.php index 033ac22f9..c01cf8a70 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/Module.php b/vendor/zoujingli/think-library/src/Module.php deleted file mode 100644 index 8776812fe..000000000 --- a/vendor/zoujingli/think-library/src/Module.php +++ /dev/null @@ -1,113 +0,0 @@ -_checkzip($zip); - if (empty($state)) return [$state, $message]; - // 执行文件安装 - if ($zip->extractTo($this->app->getBasePath() . $this->getName())) { - return [1, '应用模块安装成功']; - } else { - return [0, '应用模块安装失败']; - } - } - - /** - * 移除应用模块 - * @return array - */ - protected function _remove(): array - { - $directory = $this->app->getBasePath() . $this->getName(); - if (file_exists($directory) && is_dir($directory)) { - return [0, '提交移除应用模块指令成功']; - } else { - return [1, '待删除的应用模块不存在']; - } - } - - /** - * 检测安装包是否正常 - * @param ZipArchive $zip 安装包 - * @return array - */ - protected function _checkzip(ZipArchive $zip): array - { - $directory = "{$zip->filename}.files"; - file_exists($directory) || mkdir($directory, 0755, true); - // 尝试解压应用包 - if ($zip->extractTo($directory) === false) { - return [0, '应用模块压缩文件解压失败']; - } - // 检测应用配置文件 - $info = @include($directory . DIRECTORY_SEPARATOR . 'app.php'); - // 删除临时解压的文件 - $this->_forceRemove($directory); - // 返回应用模块检查结果 - if (empty($info)) { - return [0, '未获取到应用模块配置信息']; - } elseif ($info['name'] !== $this->getName()) { - return [0, '应用模块名称与注册名称不一致']; - } else { - return [1, '应用模块基础检查通过']; - } - } - - /** - * 强制删除指定的目录 - * @param string $directory - */ - private function _forceRemove(string $directory) - { - if (file_exists($directory) && is_dir($directory) && $handle = opendir($directory)) { - while (false !== ($item = readdir($handle))) if (!in_array($item, ['.', '..'])) { - $this->_forceRemove("{$directory}/{$item}"); - } - [closedir($handle), rmdir($directory)]; - } else { - file_exists($directory) && is_file($directory) && @unlink($directory); - } - } -} \ No newline at end of file diff --git a/vendor/zoujingli/think-library/src/Storage.php b/vendor/zoujingli/think-library/src/Storage.php index 1e2e00efc..b941aba73 100644 --- a/vendor/zoujingli/think-library/src/Storage.php +++ b/vendor/zoujingli/think-library/src/Storage.php @@ -88,7 +88,7 @@ abstract class Storage */ public static function __callStatic($method, $arguments) { - if (method_exists($class = self::instance(), $method)) { + if (method_exists($class = static::instance(), $method)) { return call_user_func_array([$class, $method], $arguments); } else { throw new Exception("method not exists: " . get_class($class) . "->{$method}()"); @@ -141,13 +141,13 @@ abstract class Storage { try { $file = LocalStorage::instance(); - $name = self::name($url, '', 'down/'); + $name = static::name($url, '', 'down/'); if (empty($force) && $file->has($name)) { if ($expire < 1 || filemtime($file->path($name)) + $expire > time()) { return $file->info($name); } } - return $file->set($name, self::getCurl($url)); + return $file->set($name, static::curlGet($url)); } catch (\Exception $exception) { return ['url' => $url, 'hash' => md5($url), 'key' => $url, 'file' => $url]; } @@ -161,7 +161,7 @@ abstract class Storage */ public static function mime($exts, $mime = []) { - $mimes = self::mimes(); + $mimes = static::mimes(); foreach (is_string($exts) ? explode(',', $exts) : $exts as $ext) { $mime[] = $mimes[strtolower($ext)] ?? 'application/octet-stream'; } @@ -184,7 +184,7 @@ abstract class Storage * @param string $url * @return string */ - public static function getCurl($url) + public static function curlGet($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); diff --git a/vendor/zoujingli/think-library/src/extend/DataExtend.php b/vendor/zoujingli/think-library/src/extend/DataExtend.php index b1d80c5e1..f55a41157 100644 --- a/vendor/zoujingli/think-library/src/extend/DataExtend.php +++ b/vendor/zoujingli/think-library/src/extend/DataExtend.php @@ -51,7 +51,7 @@ class DataExtend public static function arr2table(array $list, $cid = 'id', $pid = 'pid', $cpath = 'path', $ppath = '') { $tree = []; - foreach (self::arr2tree($list, $cid, $pid) as $attr) { + foreach (static::arr2tree($list, $cid, $pid) as $attr) { $attr[$cpath] = "{$ppath}-{$attr[$cid]}"; $attr['sub'] = $attr['sub'] ?? []; $attr['spt'] = substr_count($ppath, '-'); @@ -59,7 +59,7 @@ class DataExtend $sub = $attr['sub']; unset($attr['sub']); $tree[] = $attr; - if (!empty($sub)) $tree = array_merge($tree, self::arr2table($sub, $cid, $pid, $cpath, $attr[$cpath])); + if (!empty($sub)) $tree = array_merge($tree, static::arr2table($sub, $cid, $pid, $cpath, $attr[$cpath])); } return $tree; } @@ -76,7 +76,7 @@ class DataExtend { $ids = [intval($id)]; foreach ($list as $vo) if (intval($vo[$pkey]) > 0 && intval($vo[$pkey]) === intval($id)) { - $ids = array_merge($ids, self::getArrSubIds($list, intval($vo[$key]), $key, $pkey)); + $ids = array_merge($ids, static::getArrSubIds($list, intval($vo[$key]), $key, $pkey)); } return $ids; } diff --git a/vendor/zoujingli/think-library/src/extend/ExcelExtend.php b/vendor/zoujingli/think-library/src/extend/ExcelExtend.php index 363dcc45a..5d3a8c384 100644 --- a/vendor/zoujingli/think-library/src/extend/ExcelExtend.php +++ b/vendor/zoujingli/think-library/src/extend/ExcelExtend.php @@ -49,7 +49,7 @@ class ExcelExtend foreach ($list as $data) { $rows = []; foreach ($rules as $rule) { - $rows[] = self::parseKeyDotValue($data, $rule); + $rows[] = static::parseKeyDotValue($data, $rule); } fputcsv($handle, $rows); } diff --git a/vendor/zoujingli/think-library/src/extend/HttpExtend.php b/vendor/zoujingli/think-library/src/extend/HttpExtend.php index de876ef81..ebe231aae 100644 --- a/vendor/zoujingli/think-library/src/extend/HttpExtend.php +++ b/vendor/zoujingli/think-library/src/extend/HttpExtend.php @@ -23,16 +23,16 @@ namespace think\admin\extend; class HttpExtend { /** - * 以GET模拟网络请求 + * 以 GET 模拟网络请求 * @param string $location HTTP请求地址 * @param array|string $query GET请求参数 * @param array $options CURL请求参数 * @return boolean|string */ - public static function get($location, $query = [], $options = []) + public static function get($location, $query = [], array $options = []) { $options['query'] = $query; - return self::request('get', $location, $options); + return static::request('get', $location, $options); } /** @@ -42,10 +42,10 @@ class HttpExtend * @param array $options CURL请求参数 * @return boolean|string */ - public static function post($location, $data = [], $options = []) + public static function post($location, $data = [], array $options = []) { $options['data'] = $data; - return self::request('post', $location, $options); + return static::request('post', $location, $options); } /** @@ -60,27 +60,41 @@ class HttpExtend */ public static function submit($url, array $data = [], array $file = [], array $header = [], $method = 'POST', $returnHeader = true) { - list($boundary, $content) = self::buildFormData($data, $file); + list($line, $boundary) = [[], CodeExtend::random(18)]; + foreach ($data as $key => $value) { + $line[] = "--{$boundary}"; + $line[] = "Content-Disposition: form-data; name=\"{$key}\""; + $line[] = ""; + $line[] = $value; + } + if (is_array($file) && isset($file['field']) && isset($file['name'])) { + $line[] = "--{$boundary}"; + $line[] = "Content-Disposition: form-data; name=\"{$file['field']}\"; filename=\"{$file['name']}\""; + $line[] = ""; + $line[] = $file['content']; + } + $line[] = "--{$boundary}--"; $header[] = "Content-type:multipart/form-data;boundary={$boundary}"; - return self::request($method, $url, ['data' => $content, 'returnHeader' => $returnHeader, 'headers' => $header]); + return static::request($method, $url, ['data' => join("\r\n", $line), 'returnHeader' => $returnHeader, 'headers' => $header]); } /** - * CURL模拟网络请求 - * @param string $method 请求方法 - * @param string $location 请求地址 - * @param array $options 请求参数[headers,data,cookie,cookie_file,timeout,returnHeader] + * 以 CURL 模拟网络请求 + * @param string $method 模拟请求方式 + * @param string $location 模拟请求地址 + * @param array $options 请求参数[headers,query,data,cookie,cookie_file,timeout,returnHeader] * @return boolean|string */ - public static function request($method, $location, $options = []) + public static function request($method, $location, array $options = []) { - $curl = curl_init(); // GET 参数设置 if (!empty($options['query'])) { - $location .= (stripos($location, '?') !== false ? '&' : '?') . http_build_query($options['query']); + $split = strpos($location, '?') !== false ? '&' : '?'; + $location .= $split . http_build_query($options['query']); } - // 浏览器代理设置 - curl_setopt($curl, CURLOPT_USERAGENT, self::getUserAgent()); + $curl = curl_init(); + // Agent 代理设置 + curl_setopt($curl, CURLOPT_USERAGENT, static::getUserAgent()); // CURL 头信息设置 if (!empty($options['headers'])) { curl_setopt($curl, CURLOPT_HTTPHEADER, $options['headers']); @@ -98,7 +112,8 @@ class HttpExtend if (strtolower($method) === 'head') { curl_setopt($curl, CURLOPT_NOBODY, 1); } elseif (isset($options['data'])) { - curl_setopt($curl, CURLOPT_POSTFIELDS, self::buildQueryData($options['data'])); + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_POSTFIELDS, $options['data']); } // 请求超时设置 if (isset($options['timeout']) && is_numeric($options['timeout'])) { @@ -106,6 +121,7 @@ class HttpExtend } else { curl_setopt($curl, CURLOPT_TIMEOUT, 60); } + // 是否返回前部内容 if (empty($options['returnHeader'])) { curl_setopt($curl, CURLOPT_HEADER, false); } else { @@ -118,55 +134,10 @@ class HttpExtend curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - $content = curl_exec($curl); - curl_close($curl); + [$content] = [curl_exec($curl), curl_close($curl)]; return $content; } - /** - * 对 POST 数据过滤处理 - * @param array $data 需要处理的数据 - * @param boolean $build 是否编译数据 - * @return array|string - */ - private static function buildQueryData($data, $build = true) - { - if (!is_array($data)) return $data; - foreach ($data as $key => $value) { - if (is_string($value) && stripos($value, '@') === 0 && class_exists('CURLFile')) { - if (file_exists($filename = realpath(ltrim($value, '@')))) { - list($build, $data[$key]) = [false, new \CURLFile($filename)]; - } - } elseif ($value instanceof \CURLFile) $build = false; - } - return $build ? http_build_query($data) : $data; - } - - /** - * 生成 FormData 格式数据内容 - * @param array $data 表单提交的数据 - * @param array $file 表单上传的文件 - * @return array - */ - private static function buildFormData(array $data = [], array $file = []) - { - list($line, $boundary) = [[], CodeExtend::random(18)]; - foreach ($data as $key => $value) { - $line[] = "--{$boundary}"; - $line[] = "Content-Disposition: form-data; name=\"{$key}\""; - $line[] = ""; - $line[] = $value; - } - if (is_array($file) && isset($file['field']) && isset($file['name'])) { - $line[] = "--{$boundary}"; - $line[] = "Content-Disposition: form-data; name=\"{$file['field']}\"; filename=\"{$file['name']}\""; - $line[] = ""; - $line[] = $file['content']; - } - $line[] = "--{$boundary}--"; - return [$boundary, join("\r\n", $line)]; - } - /** * 获取浏览器代理信息 * @return string @@ -174,7 +145,7 @@ class HttpExtend private static function getUserAgent() { if (!empty($_SERVER['HTTP_USER_AGENT'])) return $_SERVER['HTTP_USER_AGENT']; - $aligs = [ + $agents = [ "Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0", @@ -185,6 +156,6 @@ class HttpExtend "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11", ]; - return $aligs[array_rand($aligs, 1)]; + return $agents[array_rand($agents, 1)]; } } \ No newline at end of file diff --git a/vendor/zoujingli/think-library/src/service/QueueService.php b/vendor/zoujingli/think-library/src/service/QueueService.php index 8d5e183b2..7cf83de5a 100644 --- a/vendor/zoujingli/think-library/src/service/QueueService.php +++ b/vendor/zoujingli/think-library/src/service/QueueService.php @@ -90,7 +90,7 @@ class QueueService extends Service throw new \think\admin\Exception("Qeueu reset failed, Queue {$this->code} data cannot be empty!"); } $this->app->db->name('SystemQueue')->where(['code' => $this->code])->strict(false)->failException(true)->update([ - 'exec_pid' => '0', 'exec_time' => time() + $wait, 'status' => '1', + 'exec_pid' => 0, 'exec_time' => time() + $wait, 'status' => 1, ]); return $this->initialize($this->code); } @@ -124,7 +124,7 @@ class QueueService extends Service */ public function register($title, $command, $later = 0, $data = [], $rscript = 0, $loops = 0) { - $map = [['title', '=', $title], ['status', 'in', ['1', '2']]]; + $map = [['title', '=', $title], ['status', 'in', [1, 2]]]; if (empty($rscript) && ($queue = $this->app->db->name('SystemQueue')->where($map)->find())) { throw new \think\admin\Exception(lang('think_library_queue_exist'), 0, $queue['code']); } @@ -133,12 +133,12 @@ class QueueService extends Service 'code' => $this->code, 'title' => $title, 'command' => $command, - 'attempts' => '0', + 'attempts' => 0, 'rscript' => intval(boolval($rscript)), 'exec_data' => json_encode($data, JSON_UNESCAPED_UNICODE), 'exec_time' => $later > 0 ? time() + $later : time(), - 'enter_time' => '0', - 'outer_time' => '0', + 'enter_time' => 0, + 'outer_time' => 0, 'loops_time' => $loops, ]); $this->progress(1, '>>> 任务创建成功 <<<', 0.00); diff --git a/vendor/zoujingli/think-library/src/service/SystemService.php b/vendor/zoujingli/think-library/src/service/SystemService.php index c7f8ec681..c602a29f7 100644 --- a/vendor/zoujingli/think-library/src/service/SystemService.php +++ b/vendor/zoujingli/think-library/src/service/SystemService.php @@ -336,7 +336,7 @@ class SystemService extends Service { $data = $this->getRuntime(); $this->app->console->call('clear'); - $this->setRuntime($data['map'], $data['run']); + $this->setRuntime($data['map'], $data['run'], $data['uri']); } /** diff --git a/vendor/zoujingli/think-library/src/storage/AliossStorage.php b/vendor/zoujingli/think-library/src/storage/AliossStorage.php index 7b8b3c2a2..390612a5b 100644 --- a/vendor/zoujingli/think-library/src/storage/AliossStorage.php +++ b/vendor/zoujingli/think-library/src/storage/AliossStorage.php @@ -131,7 +131,7 @@ class AliossStorage extends Storage */ public function get($name, $safe = false) { - return self::getCurl($this->url($name, $safe)); + return static::curlGet($this->url($name, $safe)); } /** diff --git a/vendor/zoujingli/think-library/src/storage/LocalStorage.php b/vendor/zoujingli/think-library/src/storage/LocalStorage.php index 658e18f7e..68b9c33b1 100644 --- a/vendor/zoujingli/think-library/src/storage/LocalStorage.php +++ b/vendor/zoujingli/think-library/src/storage/LocalStorage.php @@ -94,7 +94,7 @@ class LocalStorage extends Storage public function get($name, $safe = false) { if (!$this->has($name, $safe)) return ''; - return self::getCurl($this->path($name, $safe)); + return static::curlGet($this->path($name, $safe)); } /** diff --git a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php index 23b7ff69f..4a4b370a6 100644 --- a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php +++ b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php @@ -101,7 +101,7 @@ class QiniuStorage extends Storage { $url = $this->url($name, $safe) . "?e=" . time(); $token = "{$this->accessKey}:{$this->safeBase64(hash_hmac('sha1', $url, $this->secretKey, true))}"; - return self::getCurl("{$url}&token={$token}"); + return static::curlGet("{$url}&token={$token}"); } /** diff --git a/vendor/zoujingli/wechat-developer/We.php b/vendor/zoujingli/wechat-developer/We.php index 26865b6f0..846476cdc 100644 --- a/vendor/zoujingli/wechat-developer/We.php +++ b/vendor/zoujingli/wechat-developer/We.php @@ -86,7 +86,7 @@ class We * 定义当前版本 * @var string */ - const VERSION = '1.2.22'; + const VERSION = '1.2.23'; /** * 静态配置 diff --git a/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php b/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php index af4337b30..403a62cc4 100644 --- a/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php +++ b/vendor/zoujingli/wechat-developer/WeChat/Contracts/BasicWeChat.php @@ -94,7 +94,7 @@ class BasicWeChat } /** - * 获取访问accessToken + * 获取访问 AccessToken * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException @@ -166,15 +166,15 @@ class BasicWeChat { try { return Tools::json2arr(Tools::get($url)); - } catch (InvalidResponseException $e) { + } catch (InvalidResponseException $exception) { if (isset($this->currentMethod['method']) && empty($this->isTry)) { - if (in_array($e->getCode(), ['40014', '40001', '41001', '42001'])) { + if (in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) { $this->delAccessToken(); $this->isTry = true; return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); } } - throw new InvalidResponseException($e->getMessage(), $e->getCode()); + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); } } @@ -190,13 +190,15 @@ class BasicWeChat protected function httpPostForJson($url, array $data, $buildToJson = true) { try { - return Tools::json2arr(Tools::post($url, $buildToJson ? Tools::arr2json($data) : $data)); - } catch (InvalidResponseException $e) { - if (!$this->isTry && in_array($e->getCode(), ['40014', '40001', '41001', '42001'])) { + $options = []; + if ($buildToJson) $options['headers'] = ['Content-Type: application/json']; + return Tools::json2arr(Tools::post($url, $buildToJson ? Tools::arr2json($data) : $data, $options)); + } catch (InvalidResponseException $exception) { + if (!$this->isTry && in_array($exception->getCode(), ['40014', '40001', '41001', '42001'])) { [$this->delAccessToken(), $this->isTry = true]; return call_user_func_array([$this, $this->currentMethod['method']], $this->currentMethod['arguments']); } - throw new InvalidResponseException($e->getMessage(), $e->getCode()); + throw new InvalidResponseException($exception->getMessage(), $exception->getCode()); } }