正在显示
1 个修改的文件
包含
6 行增加
和
3 行删除
| @@ -67,7 +67,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -67,7 +67,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 67 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 67 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 68 | $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']); |
| 69 | $this->editCustomRoute($this->param['url']); | 69 | $this->editCustomRoute($this->param['url']); |
| 70 | - $this->model->edit($this->param,['id'=>$this->param['id']]); | 70 | + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 71 | }else{ | 71 | }else{ |
| 72 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ | 72 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ |
| 73 | $this->fail('404页面已存在'); | 73 | $this->fail('404页面已存在'); |
| @@ -76,7 +76,10 @@ class CustomTemplateLogic extends BaseLogic | @@ -76,7 +76,10 @@ class CustomTemplateLogic extends BaseLogic | ||
| 76 | $id = $this->model->addReturnId($this->param); | 76 | $id = $this->model->addReturnId($this->param); |
| 77 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); | 77 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); |
| 78 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); | 78 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); |
| 79 | - $this->model->edit(['url'=>$route],['id'=>$id]); | 79 | + $rs = $this->model->edit(['url'=>$route],['id'=>$id]); |
| 80 | + } | ||
| 81 | + if($rs === false){ | ||
| 82 | + $this->fail('保存失败,请联系管理员'); | ||
| 80 | } | 83 | } |
| 81 | return $this->success(); | 84 | return $this->success(); |
| 82 | } | 85 | } |
| @@ -206,7 +209,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -206,7 +209,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 206 | $info = $this->model->read(['id'=>$this->param['id']]); | 209 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 207 | if($info['url'] == $this->model::NOT_FOUND_PAGE_URL){ | 210 | if($info['url'] == $this->model::NOT_FOUND_PAGE_URL){ |
| 208 | if($route != '404'){ | 211 | if($route != '404'){ |
| 209 | - $this->fail('404页面链接不可修改'); | 212 | + $this->fail('不可删除, 只可以修改tdk'); |
| 210 | } | 213 | } |
| 211 | } | 214 | } |
| 212 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); | 215 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); |
-
请 注册 或 登录 后发表评论