作者 lyh

gx

@@ -64,14 +64,17 @@ class CustomTemplateLogic extends BaseLogic @@ -64,14 +64,17 @@ class CustomTemplateLogic extends BaseLogic
64 $this->param['html'] = characterTruncation($html,'/<main>(.*?)<\/main>/s'); 64 $this->param['html'] = characterTruncation($html,'/<main>(.*?)<\/main>/s');
65 $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s'); 65 $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
66 } 66 }
  67 + $id = $this->param['id'];
67 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 68 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
68 }else{ 69 }else{
69 $this->param['project_id'] = $this->user['project_id']; 70 $this->param['project_id'] = $this->user['project_id'];
70 - $rs = $this->model->add($this->param); 71 + $id = $this->model->addReturnId($this->param);
71 } 72 }
72 if($rs === false){ 73 if($rs === false){
73 $this->fail('error'); 74 $this->fail('error');
74 } 75 }
  76 + //路由映射
  77 + RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
75 //TODO::通知网站更新 78 //TODO::通知网站更新
76 $data = [ 79 $data = [
77 'project_id'=>$this->user['project_id'], 80 'project_id'=>$this->user['project_id'],
@@ -112,16 +112,6 @@ class CategoryLogic extends BaseLogic @@ -112,16 +112,6 @@ class CategoryLogic extends BaseLogic
112 return true; 112 return true;
113 } 113 }
114 114
115 - /**  
116 - * @remark :添加时处理分类  
117 - * @name :handleAddParam  
118 - * @author :lyh  
119 - * @method :post  
120 - * @time :2023/8/21 18:34  
121 - */  
122 - public function handleAddParam(){  
123 -  
124 - }  
125 115
126 /** 116 /**
127 * @remark :删除 117 * @remark :删除
@@ -25,6 +25,7 @@ class RouteMap extends Base @@ -25,6 +25,7 @@ class RouteMap extends Base
25 const SOURCE_PRODUCT_CATE = 'product_category'; 25 const SOURCE_PRODUCT_CATE = 'product_category';
26 const SOURCE_PRODUCT_KEYWORD = 'product_keyword'; 26 const SOURCE_PRODUCT_KEYWORD = 'product_keyword';
27 const SOURCE_PAGE = 'page'; //单页面 27 const SOURCE_PAGE = 'page'; //单页面
  28 + const SOURCE_INDEX = 'index'; //单页面
28 const SOURCE_BLOG = 'blog'; 29 const SOURCE_BLOG = 'blog';
29 const SOURCE_BLOG_CATE = 'blog_category'; 30 const SOURCE_BLOG_CATE = 'blog_category';
30 const SOURCE_NEWS = 'news'; 31 const SOURCE_NEWS = 'news';