正在显示
3 个修改的文件
包含
36 行增加
和
9 行删除
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Setting; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Setting; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Http\Logic\Bside\Setting\TranslateLogic; | 14 | use App\Http\Logic\Bside\Setting\TranslateLogic; |
| 15 | +use App\Models\Project\Project; | ||
| 15 | use App\Models\RouteMap\RouteMap; | 16 | use App\Models\RouteMap\RouteMap; |
| 16 | use App\Models\WebSetting\WebLanguage; | 17 | use App\Models\WebSetting\WebLanguage; |
| 17 | 18 | ||
| @@ -94,16 +95,40 @@ class TranslateController extends BaseController | @@ -94,16 +95,40 @@ class TranslateController extends BaseController | ||
| 94 | $routeMapModel = new RouteMap(); | 95 | $routeMapModel = new RouteMap(); |
| 95 | $list = $routeMapModel->list(); | 96 | $list = $routeMapModel->list(); |
| 96 | foreach ($list as $k => $v){ | 97 | foreach ($list as $k => $v){ |
| 97 | - if(!empty($v['path'])){ | ||
| 98 | - if($v['path'] == 'blog'){ | ||
| 99 | - $v['path'] = $v['path'].'s'; | 98 | + //查看项目是5.0还是6.0 |
| 99 | + if($this->user['is_upgrade'] == Project::IS_UPGRADE_TRUE){//升级项目 | ||
| 100 | + if(!empty($v['path'])){ | ||
| 101 | + if($v['path'] == 'blog'){ | ||
| 102 | + $v['path'] = $v['path'].'s'; | ||
| 103 | + } | ||
| 104 | + $route = $v['path'].'/'.$v['route']; | ||
| 105 | + }else{ | ||
| 106 | + if($v['route'] == 'index'){ | ||
| 107 | + $v['route'] = ''; | ||
| 108 | + } | ||
| 109 | + $route = $v['route']; | ||
| 100 | } | 110 | } |
| 101 | - $route = $v['path'].'/'.$v['route']; | ||
| 102 | }else{ | 111 | }else{ |
| 103 | - $route = $v['route']; | 112 | + if(!empty($v['path'])){ |
| 113 | + if($v['path'] == 'blog'){ | ||
| 114 | + $v['path'] = $v['path'].'s'; | ||
| 115 | + }elseif ($v['path'] == RouteMap::PATH_NEWS_CATE){ | ||
| 116 | + $routeMapModel->edit(['path'=>''],['id'=>$v['id']]); | ||
| 117 | + $v['path'] = ''; | ||
| 118 | + }elseif ($v['path'] == RouteMap::PATH_NEWS_CATE){ | ||
| 119 | + $routeMapModel->edit(['path'=>''],['id'=>$v['id']]); | ||
| 120 | + $v['path'] = ''; | ||
| 121 | + } | ||
| 122 | + $route = $v['path'].'/'.$v['route']; | ||
| 123 | + }else{ | ||
| 124 | + if($v['route'] == 'index'){ | ||
| 125 | + $v['route'] = ''; | ||
| 126 | + } | ||
| 127 | + $route = $v['route']; | ||
| 128 | + } | ||
| 104 | } | 129 | } |
| 105 | - $data[] = $this->user['domain'].$route; | ||
| 106 | } | 130 | } |
| 131 | + $data[] = $this->user['domain'].$route; | ||
| 107 | $this->response('success',Code::SUCCESS,$data); | 132 | $this->response('success',Code::SUCCESS,$data); |
| 108 | } | 133 | } |
| 109 | } | 134 | } |
| @@ -35,7 +35,7 @@ class TranslateLogic extends BaseLogic | @@ -35,7 +35,7 @@ class TranslateLogic extends BaseLogic | ||
| 35 | */ | 35 | */ |
| 36 | public function getTranslateList(){ | 36 | public function getTranslateList(){ |
| 37 | $languageInfo = $this->getLanguage($this->param['language_id']); | 37 | $languageInfo = $this->getLanguage($this->param['language_id']); |
| 38 | - $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 38 | + $info = $this->model->read(['url'=>str_replace_url($this->param['url']),'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 39 | //获取当前URl的所有文本内容 | 39 | //获取当前URl的所有文本内容 |
| 40 | $new_key = $this->getUrlRead($this->param['url']); | 40 | $new_key = $this->getUrlRead($this->param['url']); |
| 41 | if($info === false){ | 41 | if($info === false){ |
| @@ -64,6 +64,7 @@ class TranslateLogic extends BaseLogic | @@ -64,6 +64,7 @@ class TranslateLogic extends BaseLogic | ||
| 64 | } | 64 | } |
| 65 | $this->success($data); | 65 | $this->success($data); |
| 66 | } | 66 | } |
| 67 | + | ||
| 67 | /** | 68 | /** |
| 68 | * @remark :获取图片列表 | 69 | * @remark :获取图片列表 |
| 69 | * @name :imageList | 70 | * @name :imageList |
| @@ -72,7 +73,7 @@ class TranslateLogic extends BaseLogic | @@ -72,7 +73,7 @@ class TranslateLogic extends BaseLogic | ||
| 72 | * @time :2023/11/23 17:29 | 73 | * @time :2023/11/23 17:29 |
| 73 | */ | 74 | */ |
| 74 | public function getTranslateImageList(){ | 75 | public function getTranslateImageList(){ |
| 75 | - $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); | 76 | + $info = $this->model->read(['url'=>str_replace_url($this->param['url']),'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); |
| 76 | $data = []; | 77 | $data = []; |
| 77 | if($info === false){ | 78 | if($info === false){ |
| 78 | $new_list = $this->getUrlImageRead($this->param['url']); | 79 | $new_list = $this->getUrlImageRead($this->param['url']); |
| @@ -213,7 +214,7 @@ class TranslateLogic extends BaseLogic | @@ -213,7 +214,7 @@ class TranslateLogic extends BaseLogic | ||
| 213 | $param = [ | 214 | $param = [ |
| 214 | 'type'=>1, | 215 | 'type'=>1, |
| 215 | 'project_id'=>$this->user['project_id'], | 216 | 'project_id'=>$this->user['project_id'], |
| 216 | - 'url'=>$this->param['url'], | 217 | + 'url'=>str_replace_url($this->param['url']), |
| 217 | 'language_id'=>$this->param['language_id'], | 218 | 'language_id'=>$this->param['language_id'], |
| 218 | 'alias'=>$this->param['alias'], | 219 | 'alias'=>$this->param['alias'], |
| 219 | ]; | 220 | ]; |
| @@ -201,6 +201,7 @@ class UserLoginLogic | @@ -201,6 +201,7 @@ class UserLoginLogic | ||
| 201 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? | 201 | $info['domain'] = (!empty($project['deploy_optimize']['domain']) ? |
| 202 | ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); | 202 | ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? '')); |
| 203 | $info['is_customized'] = $project['is_customized']; | 203 | $info['is_customized'] = $project['is_customized']; |
| 204 | + $info['is_upgrade'] = $project['is_upgrade']; | ||
| 204 | $info['is_upload_manage'] = $project['is_upload_manage']; | 205 | $info['is_upload_manage'] = $project['is_upload_manage']; |
| 205 | $info['is_show_blog'] = $project['is_show_blog']; | 206 | $info['is_show_blog'] = $project['is_show_blog']; |
| 206 | $info['upload_config'] = $project['upload_config']; | 207 | $info['upload_config'] = $project['upload_config']; |
-
请 注册 或 登录 后发表评论