作者 lyh

gx

@@ -263,6 +263,58 @@ class TranslateLogic extends BaseLogic @@ -263,6 +263,58 @@ class TranslateLogic extends BaseLogic
263 // }catch (\Exception $e){ 263 // }catch (\Exception $e){
264 // $this->fail('系统错误请联系管理员'); 264 // $this->fail('系统错误请联系管理员');
265 // } 265 // }
  266 + $this->handleRoute($this->param['url']);
266 return $this->success(); 267 return $this->success();
267 } 268 }
  269 +
  270 + /**
  271 + * @remark :处理路由
  272 + * @name :handleRoute
  273 + * @author :lyh
  274 + * @method :post
  275 + * @time :2024/1/18 17:25
  276 + */
  277 + public function handleRoute($url){
  278 + $lang = $languageInfo = $this->getLanguage($this->param['language_id'])['short'];
  279 + $url = str_replace_url($url);
  280 + $arr = explode('/',trim($url,'/'));
  281 + $num = count($arr);
  282 + $page = 0;
  283 + if($num == 1){
  284 + $route = $arr[0];
  285 + }
  286 + if($num == 2){
  287 + if(ctype_digit($arr[1])){//是数字的情况
  288 + $page = $arr[1];
  289 + $route = $arr[0];
  290 + }else{
  291 + $route = $arr[1];
  292 + }
  293 + }
  294 + if($num == 3){
  295 + if(ctype_digit($arr[2])){//是数字的情况
  296 + $page = $arr[2];
  297 + $route = $arr[0];
  298 + }else{
  299 + if($arr[2] == 'page'){
  300 + $route = $arr[1];
  301 + }else{
  302 + $route = $arr[0];
  303 + }
  304 + }
  305 + }
  306 + if($num == 4){
  307 + if(ctype_digit($arr[3])){//是数字的情况
  308 + $page = $arr[3];
  309 + $route = $arr[1];
  310 + }
  311 + }
  312 + if($page != 0){
  313 + $data['page'] = $page;
  314 + }
  315 + $data['new_route'] = $route;
  316 + $data['lang'] = $lang;
  317 + $data['project_id']= $this->user['project_id'];
  318 + $this->curlDelRoute($data);
  319 + }
268 } 320 }