diff --git a/application/admin/controller/api/Update.php b/application/admin/controller/api/Update.php index bafad5c76..eae199199 100644 --- a/application/admin/controller/api/Update.php +++ b/application/admin/controller/api/Update.php @@ -26,10 +26,15 @@ use library\Controller; class Update extends Controller { /** - * 基础URL地址 - * @var string + * 访问权限 */ - protected $baseUri = 'https://demo.thinkadmin.top'; + protected function initialize() + { + $domain = $this->app->request->host(true); + $isDemo = is_numeric(stripos($domain, 'thinkadmin.top')); + $isLocal = in_array($domain, ['127.0.0.1', 'localhost']); + if (!$isLocal && !$isDemo) $this->error('只允许访问本地或官方代码!'); + } /** * 获取文件列表 diff --git a/composer.json b/composer.json index 240019021..615ffb807 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "endroid/qr-code": "^1.9", "topthink/framework": "5.1.*", "zoujingli/ip2region": "^1.0", - "zoujingli/think-library": "5.1.*-dev", + "zoujingli/think-library": "5.1.x-dev", "zoujingli/weopen-developer": "dev-master" }, "repositories": {