diff --git a/beike/Helpers.php b/beike/Helpers.php index d34d3d2d..fab99b18 100644 --- a/beike/Helpers.php +++ b/beike/Helpers.php @@ -747,3 +747,22 @@ function registry($key, $default = null): mixed { return \Beike\Libraries\Registry::get($key, $default); } + +/** + * Check domain ha license. + * 删除版权信息, 请先购买授权 https://beikeshop.com/vip/subscription + * + * @return bool + */ +function check_license(): bool +{ + $configLicenceCode = system_setting('base.license_code'); + $appDomain = config('app.url'); + $domain = new \Utopia\Domains\Domain($appDomain); + $registerDomain = $domain->getRegisterable(); + if (empty($registerDomain)) { + return true; + } + + return $configLicenceCode == md5(mb_substr(md5($registerDomain), 2, 8)); +} diff --git a/composer.json b/composer.json index 547a3eac..9d9b9ed9 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "tymon/jwt-auth": "^2.0", "ultrono/laravel-sitemap": "^9.1", "unisharp/doc-us": "^1.3", + "utopia-php/domains": "^1.1", "zanysoft/laravel-zip": "^2.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 57825179..84900bfc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dc9edf92dba52d6800988b3ed8a5a69c", + "content-hash": "ba15ba4e492561a63ba7811801fa71a5", "packages": [ { "name": "brick/math", @@ -7960,6 +7960,66 @@ }, "time": "2018-02-22T10:01:27+00:00" }, + { + "name": "utopia-php/domains", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/domains.git", + "reference": "1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/domains/zipball/1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73", + "reference": "1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Domains\\": "src/Domains" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + } + ], + "description": "Utopia Domains library is simple and lite library for parsing web domains. This library is aiming to be as simple and easy to learn and use.", + "keywords": [ + "domains", + "framework", + "icann", + "php", + "public suffix", + "tld", + "tld extract", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/domains/issues", + "source": "https://github.com/utopia-php/domains/tree/master" + }, + "time": "2020-02-23T07:40:02+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.4.1", diff --git a/database/seeders/ThemeSeeder.php b/database/seeders/ThemeSeeder.php index 175550dd..f0b33ed3 100644 --- a/database/seeders/ThemeSeeder.php +++ b/database/seeders/ThemeSeeder.php @@ -1175,8 +1175,8 @@ class ThemeSeeder extends Seeder ], "bottom" => [ "copyright" => [ - "en" => "