作者 lyh

gx

@@ -110,7 +110,7 @@ class FileController @@ -110,7 +110,7 @@ class FileController
110 * @time :2023/6/17 16:32 110 * @time :2023/6/17 16:32
111 */ 111 */
112 public function single(&$files){ 112 public function single(&$files){
113 - $hash = hash_file('md5', $files->getPathname()); 113 + $hash = hash_file('sha256', $files->getPathname());
114 $name = $files->getClientOriginalName(); 114 $name = $files->getClientOriginalName();
115 //查看文件是否存在 115 //查看文件是否存在
116 $fileModel = new File(); 116 $fileModel = new File();
@@ -277,7 +277,7 @@ class FileController @@ -277,7 +277,7 @@ class FileController
277 foreach ($files as $file) { 277 foreach ($files as $file) {
278 $fileModel = new File(); 278 $fileModel = new File();
279 $name = $file->getClientOriginalName(); 279 $name = $file->getClientOriginalName();
280 - $hash = hash_file('md5', $file->getPathname()); 280 + $hash = hash_file('sha256', $file->getPathname());
281 $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0,'is_cos'=>(($this->upload_location == 0) ? 1 : 0)]; 281 $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0,'is_cos'=>(($this->upload_location == 0) ? 1 : 0)];
282 if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){ 282 if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
283 $param['project_id'] = $this->cache['project_id']; 283 $param['project_id'] = $this->cache['project_id'];
@@ -184,7 +184,7 @@ class ImageController extends Controller @@ -184,7 +184,7 @@ class ImageController extends Controller
184 * @time :2023/6/17 16:30 184 * @time :2023/6/17 16:30
185 */ 185 */
186 public function single(&$files){ 186 public function single(&$files){
187 - $hash = hash_file('md5', $files->getPathname()); 187 + $hash = hash_file('sha256', $files->getPathname());
188 $name = $files->getClientOriginalName(); 188 $name = $files->getClientOriginalName();
189 //查看文件是否存在 189 //查看文件是否存在
190 $imageModel = new ImageModel(); 190 $imageModel = new ImageModel();
@@ -326,7 +326,7 @@ class ImageController extends Controller @@ -326,7 +326,7 @@ class ImageController extends Controller
326 $data = []; 326 $data = [];
327 foreach ($files as $file) { 327 foreach ($files as $file) {
328 $imageModel = new ImageModel(); 328 $imageModel = new ImageModel();
329 - $hash = hash_file('md5', $file->getPathname()); 329 + $hash = hash_file('sha256', $file->getPathname());
330 $name = $file->getClientOriginalName(); 330 $name = $file->getClientOriginalName();
331 //查看图片是否已上传 331 //查看图片是否已上传
332 $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0,'is_cos'=>(($this->upload_location == 0) ? 1 : 0)]; 332 $param = ['hash'=>$hash,'refer'=>$this->param['refer'] ?? 0,'is_cos'=>(($this->upload_location == 0) ? 1 : 0)];