作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -375,6 +375,8 @@ class BTemplateLogic extends BaseLogic
if($source == BTemplate::SOURCE_HOME){
$type = 'index';
$route = '';
//路由映射
RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']);
}else{
//其他界面通知更新
if($source == 2 && $source_id != 0){
... ...
... ... @@ -110,19 +110,19 @@ class CustomTemplateLogic extends BaseLogic
* @method :post
* @time :2023/10/13 14:27
*/
public function saveCommonTemplate($param){
public function saveCommonTemplate($html){
$type = $this->getType();
$templateCommonModel = new BTemplateCommon();
//获取设置的默认模版
$bSettingModel = new Setting();
$bSettingInfo = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
$templateCommonModel = new BTemplateCommon();
$info = $templateCommonModel->read(['template_id'=>$bSettingInfo['template_id'],'project_id'=>$this->user['project_id'],'type'=>$type]);
$data = [
'head_html'=>characterTruncation($param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'),
'head_css'=>characterTruncation($param['html'],'/<style id="globalsojs-header">(.*?)<\/style>/s'),
'footer_html'=>characterTruncation($param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'),
'footer_css'=>characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
'other'=>str_replace('<header','',characterTruncation($param['html'],"/<link id=\"google-fonts-link\"(.*?)<header/s")),
'head_html'=>characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s'),
'head_css'=>characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s'),
'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'),
'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
'other'=>str_replace('<header','',characterTruncation($html,"/<link id=\"google-fonts-link\"(.*?)<header/s")),
];
if($info === false){
$data['template_id'] = $bSettingInfo['template_id'];
... ...