refactor(license): replace copyright endpoints with local system metadata

Made-with: Cursor
This commit is contained in:
apple
2026-04-29 17:16:59 +08:00
parent 06ed25ad4d
commit f89f33c50c
5 changed files with 127 additions and 52 deletions

View File

@@ -7,9 +7,9 @@ namespace app\controller\admin;
use app\services\agent\DivisionApplyServices;
use app\services\agent\PromoterApplyServices;
use app\services\system\LocalCopyrightService;
use app\services\order\StoreOrderRefundServices;
use app\services\other\CityAreaServices;
use app\services\system\SystemAuthServices;
use app\services\order\StoreOrderServices;
use app\services\product\product\StoreProductServices;
use app\services\product\product\StoreProductReplyServices;
@@ -48,7 +48,11 @@ class Common extends AuthController
*/
public function check_auth()
{
return $this->success('ok');
return $this->success('ok', [
'edition' => 'custom',
'license_source' => 'self-owned',
'crm_pro_authorized' => false,
]);
}
/**
@@ -56,14 +60,7 @@ class Common extends AuthController
*/
public function auth()
{
return $this->success([
'status' => 1,
'authCode' => 'AUTHORIZED',
'auth_code' => 'AUTHORIZED',
'day' => 999,
'auth' => true,
'copyright' => true,
]);
return $this->success(app()->make(LocalCopyrightService::class)->getSystemLicenseInfo());
}
/**
@@ -72,7 +69,7 @@ class Common extends AuthController
*/
public function crmeb_copyright(): Response
{
return $this->success('查询成功');
return $this->success(app()->make(LocalCopyrightService::class)->getCopyright());
}
/**
@@ -84,10 +81,7 @@ class Common extends AuthController
$copyright = $this->request->post('copyright');
$copyrightImg = $this->request->post('copyright_img');
try {
$this->__qsG71NREI01vix2OkjH($copyright, $copyrightImg);
} catch (\Throwable $e) {
}
app()->make(LocalCopyrightService::class)->saveCopyright((string)$copyright, (string)$copyrightImg);
return $this->success('保存成功');
}
@@ -98,23 +92,46 @@ class Common extends AuthController
*/
public function getCopyright(): Response
{
try {
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
} catch (\Throwable $e) {
$copyright = ['copyrightContext' => '', 'copyrightImage' => ''];
}
$copyright['version'] = get_crmeb_version();
return $this->success($copyright);
return $this->success(app()->make(LocalCopyrightService::class)->getCopyright());
}
/**
* 申请授权
* @param SystemAuthServices $services
* @return Response
*/
public function auth_apply(SystemAuthServices $services): Response
public function auth_apply(): Response
{
return $this->success("申请授权成功!");
return $this->fail('CRMEB 原厂授权申请入口已禁用,请使用本项目自有版权配置');
}
public function crmeb_verify(): Response
{
return $this->fail('CRMEB 原厂授权验证码入口已禁用');
}
public function crmeb_login(): Response
{
return $this->fail('CRMEB 原厂授权登录入口已禁用');
}
public function crmeb_order(): Response
{
return $this->fail('CRMEB 原厂授权订单入口已禁用');
}
public function crmeb_order_info($orderId = null): Response
{
return $this->fail('CRMEB 原厂授权订单入口已禁用');
}
public function crmeb_pay(): Response
{
return $this->fail('CRMEB 原厂授权支付入口已禁用');
}
public function crmeb_product(): Response
{
return $this->fail('CRMEB 原厂授权产品入口已禁用');
}
/**

View File

@@ -5,7 +5,8 @@
namespace app\controller\api\v1;
use crmeb\basic\BaseController;
use app\common\controller\AppBaseController;
use app\services\system\LocalCopyrightService;
/**
* Class Common
@@ -14,7 +15,7 @@ use crmeb\basic\BaseController;
* @date 2022/11/8
* @package app\controller\api\v1
*/
class Common extends BaseController
class Common extends AppBaseController
{
/**
* 获取版权
@@ -22,16 +23,8 @@ class Common extends BaseController
*/
public function getCopyright()
{
try {
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
} catch (\Throwable $e) {
$copyright = [
'copyrightContext' => '',
'copyrightImage' => '',
];
}
$copyright = app()->make(LocalCopyrightService::class)->getCopyright();
$copyright['record_No'] = sys_config('record_No');
$copyright['version'] = get_crmeb_version();
$copyright['routine_contact_type'] = sys_config('routine_contact_type');
$copyright['site_name'] = sys_config('site_name', '');
$copyright['site_logo'] = sys_config('wap_login_logo', '');
@@ -50,16 +43,8 @@ class Common extends BaseController
*/
public function getLogo()
{
try {
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
} catch (\Throwable $e) {
$copyright = [
'copyrightContext' => '',
'copyrightImage' => '',
];
}
$copyright = app()->make(LocalCopyrightService::class)->getCopyright();
$copyright['record_No'] = sys_config('record_No');
$copyright['version'] = get_crmeb_version();
$logo = sys_config('wap_login_logo');
if (strstr($logo, 'http') === false && $logo) $logo = sys_config('site_url') . $logo;
$copyright['site_name'] = sys_config('site_name');

View File

@@ -9,6 +9,7 @@ use app\services\order\StoreOrderRefundServices;
use app\services\order\StoreOrderServices;
use app\services\other\CityAreaServices;
use app\services\order\supplier\SupplierOrderServices;
use app\services\system\LocalCopyrightService;
use app\services\supplier\SystemSupplierServices;
use app\services\system\SystemMenusServices;
use think\db\exception\DataNotFoundException;
@@ -253,12 +254,6 @@ class Common extends AuthController
*/
public function getCopyright()
{
try {
$copyright = $this->__z6uxyJQ4xYa5ee1mx5();
} catch (\Throwable $e) {
$copyright = ['copyrightContext' => '', 'copyrightImage' => ''];
}
$copyright['version'] = get_crmeb_version();
return $this->success($copyright);
return $this->success(app()->make(LocalCopyrightService::class)->getCopyright());
}
}