合并分支 'master-lyh-edit' 到 'master'
Master lyh edit 查看合并请求 !564
正在显示
3 个修改的文件
包含
35 行增加
和
14 行删除
| @@ -4,6 +4,7 @@ namespace App\Http\Controllers\File; | @@ -4,6 +4,7 @@ namespace App\Http\Controllers\File; | ||
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Helper\Translate; | 6 | use App\Helper\Translate; |
| 7 | +use App\Jobs\SyncImageFileJob; | ||
| 7 | use App\Models\File\ErrorFile; | 8 | use App\Models\File\ErrorFile; |
| 8 | use App\Models\File\File; | 9 | use App\Models\File\File; |
| 9 | use App\Models\File\Image as ImageModel; | 10 | use App\Models\File\Image as ImageModel; |
| @@ -146,13 +147,7 @@ class FileController | @@ -146,13 +147,7 @@ class FileController | ||
| 146 | */ | 147 | */ |
| 147 | public function synchronizationFile($fileName){ | 148 | public function synchronizationFile($fileName){ |
| 148 | //同步到大文件 | 149 | //同步到大文件 |
| 149 | - $file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName; | ||
| 150 | - $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; | ||
| 151 | - $code = shell_exec($cmd); | ||
| 152 | - if(200 != (int)$code){ | ||
| 153 | - $errorFileModel = new ErrorFile(); | ||
| 154 | - $errorFileModel->add(['path'=>$this->path.'/'.$fileName]); | ||
| 155 | - } | 150 | + SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]); |
| 156 | return true; | 151 | return true; |
| 157 | } | 152 | } |
| 158 | 153 |
| @@ -204,6 +204,7 @@ class ImageController extends Controller | @@ -204,6 +204,7 @@ class ImageController extends Controller | ||
| 204 | $this->response('不支持当前格式',Code::SYSTEM_ERROR); | 204 | $this->response('不支持当前格式',Code::SYSTEM_ERROR); |
| 205 | } | 205 | } |
| 206 | $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0); | 206 | $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0); |
| 207 | + | ||
| 207 | //上传到cos | 208 | //上传到cos |
| 208 | if($this->upload_location == 0){ | 209 | if($this->upload_location == 0){ |
| 209 | $cosService = new CosService(); | 210 | $cosService = new CosService(); |
| @@ -265,13 +266,6 @@ class ImageController extends Controller | @@ -265,13 +266,6 @@ class ImageController extends Controller | ||
| 265 | */ | 266 | */ |
| 266 | public function synchronizationImage($fileName){ | 267 | public function synchronizationImage($fileName){ |
| 267 | SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]); | 268 | SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]); |
| 268 | -// $file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0); | ||
| 269 | -// $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; | ||
| 270 | -// $code = shell_exec($cmd); | ||
| 271 | -// if(200 != (int)$code){ | ||
| 272 | -// $errorFileModel = new ErrorFile(); | ||
| 273 | -// $errorFileModel->add(['path'=>$this->path.'/'.$fileName]); | ||
| 274 | -// } | ||
| 275 | return true; | 269 | return true; |
| 276 | } | 270 | } |
| 277 | 271 |
| @@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\Setting; | @@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\Setting; | ||
| 11 | 11 | ||
| 12 | use App\Http\Logic\Bside\BaseLogic; | 12 | use App\Http\Logic\Bside\BaseLogic; |
| 13 | use App\Models\Com\UpdateLog; | 13 | use App\Models\Com\UpdateLog; |
| 14 | +use App\Models\RouteMap\RouteMap; | ||
| 14 | use App\Models\User\UserLog; | 15 | use App\Models\User\UserLog; |
| 15 | use App\Models\WebSetting\Translate as TranslateModel; | 16 | use App\Models\WebSetting\Translate as TranslateModel; |
| 16 | use App\Models\WebSetting\WebLanguage; | 17 | use App\Models\WebSetting\WebLanguage; |
| @@ -284,6 +285,37 @@ class TranslateLogic extends BaseLogic | @@ -284,6 +285,37 @@ class TranslateLogic extends BaseLogic | ||
| 284 | } | 285 | } |
| 285 | 286 | ||
| 286 | /** | 287 | /** |
| 288 | + * @remark :根据路由获取source+source_id | ||
| 289 | + * @name :getRouteSource | ||
| 290 | + * @author :lyh | ||
| 291 | + * @method :post | ||
| 292 | + * @time :2024/5/17 15:11 | ||
| 293 | + */ | ||
| 294 | + public function getRouteSource($route){ | ||
| 295 | + $data = ['source'=>0,'source_id'=>0,'is_list'=>0,'is_custom'=>0]; | ||
| 296 | + if(strtolower($route) == 'all'){ | ||
| 297 | + return $this->success($data); | ||
| 298 | + } | ||
| 299 | + if($route == '/'){ | ||
| 300 | + $data['source'] = 1; | ||
| 301 | + return $this->success($data); | ||
| 302 | + } | ||
| 303 | + $route = basename($route); | ||
| 304 | + $routeModel = new RouteMap(); | ||
| 305 | + $routeInfo = $routeModel->read(['route'=>$route]); | ||
| 306 | + if($routeInfo['source'] == RouteMap::SOURCE_PAGE){ | ||
| 307 | + if($routeInfo['source_id']){ | ||
| 308 | + $data = ['source'=>9,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0]; | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + if($routeInfo['source'] == RouteMap::SOURCE_PAGE){ | ||
| 312 | + if($routeInfo['source_id']){ | ||
| 313 | + $data = ['source'=>9,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0]; | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + /** | ||
| 287 | * @remark :处理路由 | 319 | * @remark :处理路由 |
| 288 | * @name :handleRoute | 320 | * @name :handleRoute |
| 289 | * @author :lyh | 321 | * @author :lyh |
-
请 注册 或 登录 后发表评论