作者 lyh

gx

@@ -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