feat: 调整保存路径到public
							parent
							
								
									4a7c0dc4b7
								
							
						
					
					
						commit
						25a5c10bae
					
				| 
						 | 
				
			
			@ -14,7 +14,7 @@ class Image extends File
 | 
			
		|||
    public static function resize($src)
 | 
			
		||||
    {
 | 
			
		||||
        $max = 1920;
 | 
			
		||||
        $realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src,'/');
 | 
			
		||||
        $realPath = app()->getRootPath() . 'public/' . ltrim($src,'/');
 | 
			
		||||
        if(is_file($realPath)){
 | 
			
		||||
            $img = TImage::open($realPath);
 | 
			
		||||
            list($img_w,$img_h) = $img->size();
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ class Image extends File
 | 
			
		|||
        $rootPath = app()->getRootPath();
 | 
			
		||||
        if(!empty($src)){
 | 
			
		||||
            $system = System::getSystem();
 | 
			
		||||
            $realPath = $rootPath . 'wwwroot/' . ltrim($src, '/');
 | 
			
		||||
            $realPath = $rootPath . 'public/' . ltrim($src, '/');
 | 
			
		||||
            if(is_file($realPath)){
 | 
			
		||||
                if($system['is_mark']){
 | 
			
		||||
                    $mark = $rootPath . ltrim($system['mark_img'], '/');
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ class Image extends File
 | 
			
		|||
    public static function delImg($src)
 | 
			
		||||
    {
 | 
			
		||||
        if(!empty(trim($src))){
 | 
			
		||||
            $realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src, '/');
 | 
			
		||||
            $realPath = app()->getRootPath() . 'public/' . ltrim($src, '/');
 | 
			
		||||
            if (file_exists($realPath)) {
 | 
			
		||||
                $info = pathinfo($realPath);
 | 
			
		||||
                $source = $info['dirname'] . DIRECTORY_SEPARATOR . $info['filename'] . '*.' . $info['extension'];
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +100,7 @@ class Image extends File
 | 
			
		|||
            return '';
 | 
			
		||||
        }
 | 
			
		||||
        $rootPath = app()->getRootPath();
 | 
			
		||||
        $realPath = $rootPath . 'wwwroot/' . ltrim($src, '/');
 | 
			
		||||
        $realPath = $rootPath . 'public/' . ltrim($src, '/');
 | 
			
		||||
        $realPath = str_replace('\\', '/', $realPath);
 | 
			
		||||
        if(!file_exists($realPath)){
 | 
			
		||||
            return '';
 | 
			
		||||
| 
						 | 
				
			
			@ -120,7 +120,7 @@ class Image extends File
 | 
			
		|||
            return $src;
 | 
			
		||||
        }
 | 
			
		||||
        $thumbName = $info['dirname']. DIRECTORY_SEPARATOR .$info['filename'].'_'.$width.'_'.$height.'.'.$info['extension'];
 | 
			
		||||
        $realThumbName = $rootPath . 'wwwroot/' . ltrim($thumbName, '/');
 | 
			
		||||
        $realThumbName = $rootPath . 'public/' . ltrim($thumbName, '/');
 | 
			
		||||
        $realThumbName = str_replace('\\', '/', $realThumbName);
 | 
			
		||||
        if(!file_exists($realThumbName)){
 | 
			
		||||
            $image = TImage::open($realPath);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@ return [
 | 
			
		|||
            // 磁盘类型
 | 
			
		||||
            'type' => 'local',
 | 
			
		||||
            // 磁盘路径
 | 
			
		||||
            'root' => app()->getRootPath() . 'wwwroot/storage',
 | 
			
		||||
            'root' => app()->getRootPath() . 'public/storage',
 | 
			
		||||
            // 磁盘路径对应的外部URL路径
 | 
			
		||||
            'url'        => '/storage',
 | 
			
		||||
            // 可见性
 | 
			
		||||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ return [
 | 
			
		|||
            // 磁盘类型
 | 
			
		||||
            'type'       => 'local',
 | 
			
		||||
            // 磁盘路径
 | 
			
		||||
            'root'       => app()->getRootPath() . 'wwwroot/storage/videos',
 | 
			
		||||
            'root'       => app()->getRootPath() . 'public/storage/videos',
 | 
			
		||||
            // 磁盘路径对应的外部URL路径
 | 
			
		||||
            'url'        => '/storage/videos',
 | 
			
		||||
            // 可见性
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +31,7 @@ return [
 | 
			
		|||
            // 磁盘类型
 | 
			
		||||
            'type'       => 'local',
 | 
			
		||||
            // 磁盘路径
 | 
			
		||||
            'root'       => app()->getRootPath() . 'wwwroot/storage/backup',
 | 
			
		||||
            'root'       => app()->getRootPath() . 'public/storage/backup',
 | 
			
		||||
            // 磁盘路径对应的外部URL路径
 | 
			
		||||
            'url'        => '/storage/backup',
 | 
			
		||||
            // 可见性
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue