正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
| @@ -63,11 +63,14 @@ class CustomTemplateLogic extends BaseLogic | @@ -63,11 +63,14 @@ class CustomTemplateLogic extends BaseLogic | ||
| 63 | try { | 63 | try { |
| 64 | $this->param['url'] = str_replace_url($this->param['url']); | 64 | $this->param['url'] = str_replace_url($this->param['url']); |
| 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 66 | - $id = $this->editCustomRoute($this->param['id'],$this->param['url']); | 66 | + $id = $this->param['id']; |
| 67 | + $this->param['url'] = $this->editCustomRoute($this->param['url']); | ||
| 67 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 68 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 68 | }else{ | 69 | }else{ |
| 69 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ | 70 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ |
| 70 | $this->fail('404页面已存在'); | 71 | $this->fail('404页面已存在'); |
| 72 | + }else{ | ||
| 73 | + $this->param['url'] = $this->param['url'].'-tag'; | ||
| 71 | } | 74 | } |
| 72 | $this->param['project_id'] = $this->user['project_id']; | 75 | $this->param['project_id'] = $this->user['project_id']; |
| 73 | $id = $this->model->addReturnId($this->param); | 76 | $id = $this->model->addReturnId($this->param); |
| @@ -166,7 +169,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -166,7 +169,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 166 | * @method :post | 169 | * @method :post |
| 167 | * @time :2023/9/7 10:02 | 170 | * @time :2023/9/7 10:02 |
| 168 | */ | 171 | */ |
| 169 | - public function editCustomRoute($id,$route){ | 172 | + public function editCustomRoute($route){ |
| 170 | $info = $this->model->read(['id'=>$this->param['id']]); | 173 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 171 | if($info['url'] == $this->model::NOT_FOUND_PAGE_URL && $route['url'] != '404'){ | 174 | if($info['url'] == $this->model::NOT_FOUND_PAGE_URL && $route['url'] != '404'){ |
| 172 | $this->fail('404页面链接不可修改'); | 175 | $this->fail('404页面链接不可修改'); |
| @@ -178,8 +181,12 @@ class CustomTemplateLogic extends BaseLogic | @@ -178,8 +181,12 @@ class CustomTemplateLogic extends BaseLogic | ||
| 178 | 'route'=>$info['url'], | 181 | 'route'=>$info['url'], |
| 179 | ]; | 182 | ]; |
| 180 | $this->setRouteDeleteSave($data); | 183 | $this->setRouteDeleteSave($data); |
| 184 | + //"字符串以\"-product\"结尾" | ||
| 185 | + if (!endsWith($route, "-tag")) { | ||
| 186 | + $route = $route."-tag"; | ||
| 187 | + } | ||
| 181 | } | 188 | } |
| 182 | - return $id; | 189 | + return $route; |
| 183 | } | 190 | } |
| 184 | 191 | ||
| 185 | /** | 192 | /** |
-
请 注册 或 登录 后发表评论