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" => "
  - Chengdu Guangda Network Technology © 2023
", - "zh_cn" => "
  - 成都光大网络科技 © 2023
" + "en" => "
Chengdu Guangda Network Technology © 2023
", + "zh_cn" => "
成都光大网络科技 © 2023
" ], "image" => "catalog/demo/banner/pay_icons.png" ] diff --git a/resources/beike/admin/views/pages/setting.blade.php b/resources/beike/admin/views/pages/setting.blade.php index 5f0314e3..d938b3e6 100644 --- a/resources/beike/admin/views/pages/setting.blade.php +++ b/resources/beike/admin/views/pages/setting.blade.php @@ -44,6 +44,7 @@ + @hook('admin.setting.general.after') diff --git a/resources/lang/en/admin/setting.php b/resources/lang/en/admin/setting.php index d0a7398e..96d3218e 100644 --- a/resources/lang/en/admin/setting.php +++ b/resources/lang/en/admin/setting.php @@ -75,4 +75,5 @@ return [ 'please_select' => 'Please select', 'multi_filter_helper' => 'Please select the attributes that need to be displayed in the filter area of the product list at the front desk, if left blank, all will be displayed', 'filter_attribute' => 'Attribute Filter', + 'license_code' => 'License Code', ]; diff --git a/resources/lang/zh_cn/admin/setting.php b/resources/lang/zh_cn/admin/setting.php index 13cd51ad..ea6a77f8 100644 --- a/resources/lang/zh_cn/admin/setting.php +++ b/resources/lang/zh_cn/admin/setting.php @@ -74,4 +74,5 @@ return [ 'please_select' => '请添加', 'multi_filter_helper' => '请选择需要在前台商品列表筛选区域显示的属性,留空则显示全部', 'filter_attribute' => '属性筛选', + 'license_code' => '授权码', ]; diff --git a/themes/default/cart/cart.blade.php b/themes/default/cart/cart.blade.php index 930125ce..5bc0b083 100644 --- a/themes/default/cart/cart.blade.php +++ b/themes/default/cart/cart.blade.php @@ -89,7 +89,9 @@
  • {{ __('shop/carts.selected') }}@{{ total_quantity }}
  • {{ __('shop/carts.product_total') }}@{{ amount_format }}
  • + @hookwrapper('cart.confirm') + @endhookwrapper
  • diff --git a/themes/default/checkout.blade.php b/themes/default/checkout.blade.php index 7298e507..1dcc9106 100644 --- a/themes/default/checkout.blade.php +++ b/themes/default/checkout.blade.php @@ -117,7 +117,9 @@ @endforeach
    + @hookwrapper('checkout.confirm') + @endhookwrapper
    @hook('checkout.total.footer') diff --git a/themes/default/layout/footer.blade.php b/themes/default/layout/footer.blade.php index 9290ca45..beda5ec0 100644 --- a/themes/default/layout/footer.blade.php +++ b/themes/default/layout/footer.blade.php @@ -85,7 +85,10 @@
    - Powered By BeikeShop  + + @if(!check_license()) + Powered By BeikeShop -  + @endif {!! $footer_content['bottom']['copyright'][$locale] ?? '' !!}
    diff --git a/themes/default/layout/master.blade.php b/themes/default/layout/master.blade.php index 2a46d482..1601ca59 100644 --- a/themes/default/layout/master.blade.php +++ b/themes/default/layout/master.blade.php @@ -5,7 +5,7 @@ - @yield('title', system_setting('base.meta_title', 'BeikeShop开源好用的跨境电商系统 - BeikeShop官网') . ' Powered By BeikeShop') + @yield('title', system_setting('base.meta_title', 'BeikeShop开源好用的跨境电商系统 - BeikeShop官网'))