作者 lyh

变更数据

@@ -12,6 +12,7 @@ use App\Services\CosService; @@ -12,6 +12,7 @@ use App\Services\CosService;
12 use Illuminate\Http\Exceptions\HttpResponseException; 12 use Illuminate\Http\Exceptions\HttpResponseException;
13 use Illuminate\Http\JsonResponse; 13 use Illuminate\Http\JsonResponse;
14 use Illuminate\Support\Facades\Cache; 14 use Illuminate\Support\Facades\Cache;
  15 +use function RingCentral\Psr7\str;
15 16
16 class FileController 17 class FileController
17 { 18 {
@@ -366,6 +367,9 @@ class FileController @@ -366,6 +367,9 @@ class FileController
366 //A端上传 367 //A端上传
367 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){ 368 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
368 $this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m'); 369 $this->path = $this->uploads['path_a'].'/'.$this->file_type[$this->param['refer']].'/'.date('Y-m');
  370 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  371 + $this->path = $this->path.'/'.$this->cache['project_id'];
  372 + }
369 }else{ 373 }else{
370 //B端上传,upload_method 为 1时 强制上传到本地 374 //B端上传,upload_method 为 1时 强制上传到本地
371 if(!isset($this->param['upload_method'])) { 375 if(!isset($this->param['upload_method'])) {
@@ -258,11 +258,7 @@ class ImageController extends Controller @@ -258,11 +258,7 @@ class ImageController extends Controller
258 */ 258 */
259 public function onlyName($enName,$project_id){ 259 public function onlyName($enName,$project_id){
260 $imageModel = new ImageModel(); 260 $imageModel = new ImageModel();
261 - if(empty($project_id)){  
262 - $info = $imageModel->read(['en_name' => $enName]);  
263 - }else{  
264 $info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]); 261 $info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
265 - }  
266 if($info !== false){ 262 if($info !== false){
267 return true; 263 return true;
268 } 264 }
@@ -290,6 +286,9 @@ class ImageController extends Controller @@ -290,6 +286,9 @@ class ImageController extends Controller
290 * @time :2023/7/19 16:38 286 * @time :2023/7/19 16:38
291 */ 287 */
292 public function saveMysql(&$imageModel,$size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){ 288 public function saveMysql(&$imageModel,$size,$image_type,$fileName,$hash,$is_cos = 0,$mime = '', $name=''){
  289 + if(strpos($mime, 'image') !== false){
  290 +
  291 + }
293 $data = [ 292 $data = [
294 'path' => $this->path.'/'.$fileName, 293 'path' => $this->path.'/'.$fileName,
295 'created_at' => date('Y-m-d H:i:s',time()), 294 'created_at' => date('Y-m-d H:i:s',time()),
@@ -514,6 +513,9 @@ class ImageController extends Controller @@ -514,6 +513,9 @@ class ImageController extends Controller
514 //A端上传 513 //A端上传
515 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){ 514 if(isset($this->param['refer_type']) && $this->param['refer_type'] == 1){
516 $this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m'); 515 $this->path = $this->uploads['path_a'].'/'.$this->image_type[$this->param['refer']].'/'.date('Y-m');
  516 + if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
  517 + $this->path = $this->path.'/'.$this->cache['project_id'];
  518 + }
517 }else{ 519 }else{
518 //TODO::设置上传文件大小(B端上传) 520 //TODO::设置上传文件大小(B端上传)
519 $max = config('upload.default_b_image')['size']['max']; 521 $max = config('upload.default_b_image')['size']['max'];