From 706110423ab5c7804d5d95597e3e5a4dcfce01ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Sat, 26 Nov 2022 17:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A8=8B=E5=BA=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=E6=9C=BA=E5=99=A8=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E7=BF=BB=E8=AF=91=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/system/lang/LangCodeServices.php | 3 +++ crmeb/public/install/crmeb.sql | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crmeb/app/services/system/lang/LangCodeServices.php b/crmeb/app/services/system/lang/LangCodeServices.php index 3fa84008a..9144b2d8c 100644 --- a/crmeb/app/services/system/lang/LangCodeServices.php +++ b/crmeb/app/services/system/lang/LangCodeServices.php @@ -149,6 +149,9 @@ class LangCodeServices extends BaseServices */ public function langCodeTranslate(string $text = ''): array { + if (sys_config('hs_accesskey') == '' || sys_config('hs_secretkey') == '') { + throw new AdminException('请先配置火山翻译key'); + } $translator = Translate::getInstance(); $translator->setAccessKey(sys_config('hs_accesskey')); $translator->setSecretKey(sys_config('hs_secretkey')); diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index a73042f28..981feaa19 100644 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33202,8 +33202,8 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (415, 'pay_weixin_key_v3', 'text', 'input', 4, '', 1, '', 100, 0, '\"\"', 'V3支付Key', 'V3支付秘钥', 0, 1), (416, 'reward_money', 'text', 'number', 105, '', 1, '', 0, 0, '\"0\"', '赠送余额(元)', '新用户奖励金额,必须大于等于0,0为不赠送', 0, 1), (417, 'reward_integral', 'text', 'number', 105, '', 1, '', 0, 0, '\"0\"', '赠送积分', '新用户奖励积分,必须大于等于0,0为不赠送', 0, 1), -(418, 'hs_accesskey', 'text', 'input', 106, '', 1, '', 0, 0, '\"\"', '火山翻译AccessKey', '机器翻译仅支持火山翻译', 1, 1), -(419, 'hs_secretkey', 'text', 'input', 106, '', 1, '', 0, 0, '\"\"', '火山翻译SecretKey', '机器翻译仅支持火山翻译', 0, 1); +(418, 'hs_accesskey', 'text', 'input', 106, '', 1, '', 0, 0, '\"AKLTMzkzZTEzNjg3OTg2NDViM2IwNmFlYzhmNzE4MmI4YmI\"', '火山翻译AccessKey', '机器翻译仅支持火山翻译', 1, 1), +(419, 'hs_secretkey', 'text', 'input', 106, '', 1, '', 0, 0, '\"TVRneU16STFOVFV4WVRkbE5ERTJaV0pqWm1aaU1UaGlNVFppWldZeE1HUQ==\"', '火山翻译SecretKey', '机器翻译仅支持火山翻译', 0, 1); -- -------------------------------------------------------- --