refactor(privacy-phone): 将隐私手机配置从数据库迁移至环境变量
修改 PrivacyPhoneServices 从读取数据库配置改为读取 .env 环境变量,提升配置灵活性与安全性。 更新 SQL 迁移文件,移除向系统配置表插入配置的语句,并添加配置方式说明。
This commit is contained in:
@@ -34,7 +34,7 @@ class PrivacyPhoneServices extends BaseServices
|
||||
*/
|
||||
public function getAppKey(): string
|
||||
{
|
||||
return sys_config('privacy_phone_appkey', '');
|
||||
return env('PRIVACY_PHONE.APPKEY', '');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ class PrivacyPhoneServices extends BaseServices
|
||||
*/
|
||||
public function getAppSecret(): string
|
||||
{
|
||||
return sys_config('privacy_phone_appsecret', '');
|
||||
return env('PRIVACY_PHONE.APPSECRET', '');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ class PrivacyPhoneServices extends BaseServices
|
||||
*/
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return (bool)sys_config('privacy_phone_status', 0);
|
||||
return (bool)env('PRIVACY_PHONE.ENABLE', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user