|
...
|
...
|
@@ -64,6 +64,9 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function customTemplateSave(){
|
|
|
|
$this->param['url'] = str_replace_url($this->param['url']);
|
|
|
|
if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){
|
|
|
|
$this->fail('请先开启搜索页可视化');
|
|
|
|
}
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$id = $this->param['id'];
|
|
|
|
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
|
|
...
|
...
|
@@ -71,11 +74,11 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
if($is_upgrade == 0 || $six_read == 1) {
|
|
|
|
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
|
|
|
|
if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){
|
|
|
|
$this->fail('不允许创建'.$this->param['url']);
|
|
|
|
$this->fail('不允许创建路由为:'.$this->param['url']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->editCustomRoute($this->param['url']);
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$id]);
|
|
|
|
$this->model->edit($this->param,['id'=>$id]);
|
|
|
|
}else{
|
|
|
|
if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){
|
|
|
|
$this->fail('404页面已存在');
|
|
...
|
...
|
@@ -83,11 +86,11 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
|
|
|
|
if($route == 'news' || $route == 'product' || $route == 'blog'){
|
|
|
|
$this->fail('不允许修改路由为:'.$this->param['url']);
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
|
|
|
|
$rs = $this->model->edit(['url'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
if($rs === false){
|
|
|
|
$this->fail('保存失败,请联系管理员');
|
|
|
|
$this->model->edit(['url'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
return $this->success(['id'=>$id]);
|
|
|
|
}
|
|
...
|
...
|
@@ -399,7 +402,6 @@ class CustomTemplateLogic extends BaseLogic |
|
|
|
}else{
|
|
|
|
$this->model->edit(['html'=>$logInfo['text']],['id'=>$logInfo['source_id']]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|