|
...
|
...
|
@@ -238,8 +238,7 @@ class NewsLogic extends BaseLogic |
|
|
|
foreach ($imageSources as $src) {
|
|
|
|
if (preg_match('/^data:image\/(png|jpg|jpeg|gif);base64,/', $src, $match)) {
|
|
|
|
$imageType = $match[1]; // Image type (png, jpg, etc.)
|
|
|
|
$base64Data = preg_replace('/^data:image\/(png|jpg|jpeg|gif);base64,/', '', $src);
|
|
|
|
$imageUrl = $this->manager_uploads($base64Data,$imageType);
|
|
|
|
$imageUrl = $this->manager_uploads($src,$imageType);
|
|
|
|
$updatedSources[$imageUrl] = $src;
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -257,9 +256,6 @@ class NewsLogic extends BaseLogic |
|
|
|
$path = $this->uploads['path_b'].'/'.($this->user['project_id'] ?? 1618).'/image_news/'.date('Y-m');
|
|
|
|
$cosService = new CosService();
|
|
|
|
$fileName = md5(uniqid() . '_' . time() . '.' . ($this->user['project_id'] ?? 1618).rand(1,10000)) . '.' .$type;
|
|
|
|
if($this->user['project_id'] == 1618){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($files, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}
|
|
|
|
return getImageUrl($cosService->uploadFile($files,$path,$fileName));
|
|
|
|
}
|
|
|
|
/**
|
...
|
...
|
|