diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php index 0320eaefe..ea8378bf2 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php @@ -88,9 +88,10 @@ class SystemNotification extends AuthController ['mark', ''], ['sms_id', ''], ]); + if ($data['mark'] == 'verify_code') $data['type'] = 'is_sms'; if (!$data['id']) return app('json')->fail(100100); if ($this->services->saveData($data)) { - CacheService::delete('NOTCE_'. $data['mark']); + CacheService::delete('NOTCE_' . $data['mark']); return app('json')->success(100001); } else { return app('json')->fail(100007); @@ -106,8 +107,8 @@ class SystemNotification extends AuthController { if ($type == '' || $status == '' || $id == 0) return app('json')->fail(100100); $this->services->update($id, [$type => $status]); - $res = $this->services->getOneNotce(['id'=>$id]); - CacheService::delete('NOTCE_'.$res->mark); + $res = $this->services->getOneNotce(['id' => $id]); + CacheService::delete('NOTCE_' . $res->mark); return app('json')->success(100014); } } diff --git a/crmeb/app/api/controller/v1/PublicController.php b/crmeb/app/api/controller/v1/PublicController.php index f19e9e5c0..ad0e1c459 100644 --- a/crmeb/app/api/controller/v1/PublicController.php +++ b/crmeb/app/api/controller/v1/PublicController.php @@ -300,7 +300,10 @@ class PublicController ['image', ''], ['code', ''], ], true); - if (!preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl) || !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl)) { + if ($imageUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $imageUrl)) { + return app('json')->success(['code' => false, 'image' => false]); + } + if ($codeUrl !== '' && !preg_match('/.*(\.png|\.jpg|\.jpeg|\.gif)$/', $codeUrl)) { return app('json')->success(['code' => false, 'image' => false]); } try { diff --git a/crmeb/app/services/message/SystemNotificationServices.php b/crmeb/app/services/message/SystemNotificationServices.php index 3721a6ca5..0aaabe299 100644 --- a/crmeb/app/services/message/SystemNotificationServices.php +++ b/crmeb/app/services/message/SystemNotificationServices.php @@ -106,20 +106,7 @@ class SystemNotificationServices extends BaseServices $info['content'] = $info['system_text'] ?? ''; break; case 'is_sms': - $snsCacheName = 'sms_template_list'; - $smsTem = []; - if (Cache::has($snsCacheName)) { - $smsTem = Cache::get($snsCacheName); - } else { - $list = $ServeServices->sms()->temps(1, 30, 0); - if (isset($list['data']) && $list['data']) { - foreach ($list['data'] as $item) { - $smsTem[$item['temp_id']] = $item['content']; - } - } - if ($smsTem) Cache::set($snsCacheName, $smsTem, 172800); - } - $info['content'] = $smsTem[$info['sms_id']] ?? ''; + $info['content'] = $info['sms_text']; break; case 'is_wechat': $wechat = $TemplateMessageServices->getOne(['id' => $info['wechat_id'], 'type' => 1]);