mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
【程序目录】修复阿里云短信问题
This commit is contained in:
parent
e5ecb82ccd
commit
bc836edad1
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user