正在显示
1 个修改的文件
包含
3 行增加
和
7 行删除
| @@ -63,7 +63,6 @@ class CustomTemplateLogic extends BaseLogic | @@ -63,7 +63,6 @@ class CustomTemplateLogic extends BaseLogic | ||
| 63 | * @time :2023/6/29 16:21 | 63 | * @time :2023/6/29 16:21 |
| 64 | */ | 64 | */ |
| 65 | public function customTemplateSave(){ | 65 | public function customTemplateSave(){ |
| 66 | - try { | ||
| 67 | $this->param['url'] = str_replace_url($this->param['url']); | 66 | $this->param['url'] = str_replace_url($this->param['url']); |
| 68 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 67 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 69 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $this->param['id'], $this->user['project_id']); | 68 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $this->param['id'], $this->user['project_id']); |
| @@ -79,9 +78,6 @@ class CustomTemplateLogic extends BaseLogic | @@ -79,9 +78,6 @@ class CustomTemplateLogic extends BaseLogic | ||
| 79 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); | 78 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); |
| 80 | $this->model->edit(['url'=>$route],['id'=>$id]); | 79 | $this->model->edit(['url'=>$route],['id'=>$id]); |
| 81 | } | 80 | } |
| 82 | - }catch (\Exception $e){ | ||
| 83 | - $this->fail('保存失败,请联系管理员'); | ||
| 84 | - } | ||
| 85 | return $this->success(); | 81 | return $this->success(); |
| 86 | } | 82 | } |
| 87 | 83 | ||
| @@ -208,13 +204,13 @@ class CustomTemplateLogic extends BaseLogic | @@ -208,13 +204,13 @@ class CustomTemplateLogic extends BaseLogic | ||
| 208 | */ | 204 | */ |
| 209 | public function editCustomRoute($route){ | 205 | public function editCustomRoute($route){ |
| 210 | $info = $this->model->read(['id'=>$this->param['id']]); | 206 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 211 | - if($info['url'] == $this->model::NOT_FOUND_PAGE_URL && $route['url'] != '404'){ | 207 | + if($info['url'] == $this->model::NOT_FOUND_PAGE_URL){ |
| 208 | + if($route != '404'){ | ||
| 212 | $this->fail('404页面链接不可修改'); | 209 | $this->fail('404页面链接不可修改'); |
| 213 | } | 210 | } |
| 214 | - if($info['url'] != $route){ | 211 | + } |
| 215 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); | 212 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); |
| 216 | $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); | 213 | $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); |
| 217 | - } | ||
| 218 | return true; | 214 | return true; |
| 219 | } | 215 | } |
| 220 | 216 |
-
请 注册 或 登录 后发表评论