作者 李宇航

合并分支 'master-lyh-edit' 到 'master'

Master lyh edit



查看合并请求 !564
... ... @@ -4,6 +4,7 @@ namespace App\Http\Controllers\File;
use App\Enums\Common\Code;
use App\Helper\Translate;
use App\Jobs\SyncImageFileJob;
use App\Models\File\ErrorFile;
use App\Models\File\File;
use App\Models\File\Image as ImageModel;
... ... @@ -146,13 +147,7 @@ class FileController
*/
public function synchronizationFile($fileName){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName;
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
$code = shell_exec($cmd);
if(200 != (int)$code){
$errorFileModel = new ErrorFile();
$errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
}
SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]);
return true;
}
... ...
... ... @@ -204,6 +204,7 @@ class ImageController extends Controller
$this->response('不支持当前格式',Code::SYSTEM_ERROR);
}
$fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
//上传到cos
if($this->upload_location == 0){
$cosService = new CosService();
... ... @@ -265,13 +266,6 @@ class ImageController extends Controller
*/
public function synchronizationImage($fileName){
SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]);
// $file_path = getImageUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0);
// $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
// $code = shell_exec($cmd);
// if(200 != (int)$code){
// $errorFileModel = new ErrorFile();
// $errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
// }
return true;
}
... ...
... ... @@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Com\UpdateLog;
use App\Models\RouteMap\RouteMap;
use App\Models\User\UserLog;
use App\Models\WebSetting\Translate as TranslateModel;
use App\Models\WebSetting\WebLanguage;
... ... @@ -284,6 +285,37 @@ class TranslateLogic extends BaseLogic
}
/**
* @remark :根据路由获取source+source_id
* @name :getRouteSource
* @author :lyh
* @method :post
* @time :2024/5/17 15:11
*/
public function getRouteSource($route){
$data = ['source'=>0,'source_id'=>0,'is_list'=>0,'is_custom'=>0];
if(strtolower($route) == 'all'){
return $this->success($data);
}
if($route == '/'){
$data['source'] = 1;
return $this->success($data);
}
$route = basename($route);
$routeModel = new RouteMap();
$routeInfo = $routeModel->read(['route'=>$route]);
if($routeInfo['source'] == RouteMap::SOURCE_PAGE){
if($routeInfo['source_id']){
$data = ['source'=>9,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
if($routeInfo['source'] == RouteMap::SOURCE_PAGE){
if($routeInfo['source_id']){
$data = ['source'=>9,'source_id'=>$routeInfo['source_id'],'is_list'=>0,'is_custom'=>0];
}
}
}
/**
* @remark :处理路由
* @name :handleRoute
* @author :lyh
... ...