|
@@ -20,6 +20,7 @@ class FileUploadService extends Service
|
|
'xls'
|
|
'xls'
|
|
];
|
|
];
|
|
const tmp_dir = 'kq';
|
|
const tmp_dir = 'kq';
|
|
|
|
+ const tmp_dir_1 = 'upload_occ';
|
|
const string = '/image/';
|
|
const string = '/image/';
|
|
const string_1 = '/api/uploadFiles/';
|
|
const string_1 = '/api/uploadFiles/';
|
|
const string2 = 'qyadmin|';
|
|
const string2 = 'qyadmin|';
|
|
@@ -70,7 +71,7 @@ class FileUploadService extends Service
|
|
$file_name = date("Ymd").time().rand(1000,9999);
|
|
$file_name = date("Ymd").time().rand(1000,9999);
|
|
$filename = $file_name.'.' . $ext;
|
|
$filename = $file_name.'.' . $ext;
|
|
|
|
|
|
- $dir = self::tmp_dir . '/' . $date . '/' . $filename;
|
|
|
|
|
|
+ $dir = self::tmp_dir_1 . '/' . $date . '/' . $filename;
|
|
Storage::disk('public')->put($dir, file_get_contents($realPath));
|
|
Storage::disk('public')->put($dir, file_get_contents($realPath));
|
|
|
|
|
|
return [true, self::string_1 . self::string2 . $filename];
|
|
return [true, self::string_1 . self::string2 . $filename];
|
|
@@ -124,7 +125,7 @@ class FileUploadService extends Service
|
|
$timestamp = substr($filename, 0, 8); // 截取前八位数字
|
|
$timestamp = substr($filename, 0, 8); // 截取前八位数字
|
|
$date = \DateTime::createFromFormat('Ymd', $timestamp);
|
|
$date = \DateTime::createFromFormat('Ymd', $timestamp);
|
|
$date = $date->format('Y-m-d');
|
|
$date = $date->format('Y-m-d');
|
|
- $dir = FileUploadService::tmp_dir . '/' . $date . '/' . $filename;
|
|
|
|
|
|
+ $dir = FileUploadService::tmp_dir_1 . '/' . $date . '/' . $filename;
|
|
$realPath = storage_path() . "/app/public/" . $dir;
|
|
$realPath = storage_path() . "/app/public/" . $dir;
|
|
$savePath = self::string3 . $date . '/' . $filename;
|
|
$savePath = self::string3 . $date . '/' . $filename;
|
|
list($status,$msg) = (new OssService())->uploadFile($realPath,$savePath);
|
|
list($status,$msg) = (new OssService())->uploadFile($realPath,$savePath);
|