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 原厂授权产品入口已禁用');
}
/**