作者 赵彬吉
@@ -433,8 +433,8 @@ class ProductController extends BaseController @@ -433,8 +433,8 @@ class ProductController extends BaseController
433 * @time :2023/7/29 14:59 433 * @time :2023/7/29 14:59
434 */ 434 */
435 public function copyProduct(ProductLogic $logic){ 435 public function copyProduct(ProductLogic $logic){
436 - $rs = $logic->setCopyProduct();  
437 - $this->response('success',Code::SUCCESS,$rs); 436 + $data = $logic->setCopyProduct();
  437 + $this->response('success',Code::SUCCESS,$data);
438 } 438 }
439 439
440 /** 440 /**
@@ -134,8 +134,8 @@ class ProjectLogic extends BaseLogic @@ -134,8 +134,8 @@ class ProjectLogic extends BaseLogic
134 * @time :2023/8/30 11:57 134 * @time :2023/8/30 11:57
135 */ 135 */
136 public function projectSave(){ 136 public function projectSave(){
137 -// DB::beginTransaction();  
138 -// try { 137 + DB::beginTransaction();
  138 + try {
139 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 139 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
140 if($this->param['type'] == Project::TYPE_SEVEN){ 140 if($this->param['type'] == Project::TYPE_SEVEN){
141 //错误单直接返回,单独处理 141 //错误单直接返回,单独处理
@@ -158,11 +158,11 @@ class ProjectLogic extends BaseLogic @@ -158,11 +158,11 @@ class ProjectLogic extends BaseLogic
158 //创建站点 158 //创建站点
159 (new SyncService())->projectAcceptAddress($this->param['id']); 159 (new SyncService())->projectAcceptAddress($this->param['id']);
160 } 160 }
161 -// DB::commit();  
162 -// }catch (\Exception $e){  
163 -// DB::rollBack();  
164 -// $this->fail('保存失败,请联系管理员');  
165 -// } 161 + DB::commit();
  162 + }catch (\Exception $e){
  163 + DB::rollBack();
  164 + $this->fail('保存失败,请联系管理员');
  165 + }
166 return $this->success(); 166 return $this->success();
167 } 167 }
168 168
@@ -229,7 +229,6 @@ class ProjectLogic extends BaseLogic @@ -229,7 +229,6 @@ class ProjectLogic extends BaseLogic
229 } 229 }
230 $param['upload_config'] = json_encode($param['upload_config'] ?? []); 230 $param['upload_config'] = json_encode($param['upload_config'] ?? []);
231 $param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []); 231 $param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []);
232 - unset($param['web_traffic_config']);  
233 $this->model->edit($param,['id'=>$param['id']]); 232 $this->model->edit($param,['id'=>$param['id']]);
234 Common::del_user_cache($this->model->getTable(),$param['id']); 233 Common::del_user_cache($this->model->getTable(),$param['id']);
235 return $this->success(); 234 return $this->success();
@@ -50,7 +50,7 @@ class BlogLogic extends BaseLogic @@ -50,7 +50,7 @@ class BlogLogic extends BaseLogic
50 DB::commit(); 50 DB::commit();
51 }catch (\Exception $e){ 51 }catch (\Exception $e){
52 DB::rollBack(); 52 DB::rollBack();
53 - $this->fail('error'); 53 + $this->fail('系统错误,请联系管理员');
54 } 54 }
55 $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); 55 $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);
56 $this->curlDelRoute(['new_route'=>$route]); 56 $this->curlDelRoute(['new_route'=>$route]);
@@ -47,7 +47,6 @@ class ProductLogic extends BaseLogic @@ -47,7 +47,6 @@ class ProductLogic extends BaseLogic
47 $this->param = $this->handleSaveParam($this->param); 47 $this->param = $this->handleSaveParam($this->param);
48 try { 48 try {
49 if(isset($this->param['id']) && !empty($this->param['id'])){ 49 if(isset($this->param['id']) && !empty($this->param['id'])){
50 -  
51 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 50 $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
52 $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 51 $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
53 if($is_upgrade == 0 || $six_read == 1){ 52 if($is_upgrade == 0 || $six_read == 1){
@@ -442,7 +441,7 @@ class ProductLogic extends BaseLogic @@ -442,7 +441,7 @@ class ProductLogic extends BaseLogic
442 $this->model->edit(['route'=>$route],['id'=>$save_id]); 441 $this->model->edit(['route'=>$route],['id'=>$save_id]);
443 //同步可视化装修数据 442 //同步可视化装修数据
444 $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); 443 $this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
445 - return $this->success(); 444 + return $this->success(['id'=>$save_id]);
446 } 445 }
447 446
448 /** 447 /**
@@ -19,11 +19,6 @@ class Project extends Base @@ -19,11 +19,6 @@ class Project extends Base
19 public static $projectLocationDangerous = 1; //危险项目 19 public static $projectLocationDangerous = 1; //危险项目
20 public static $storageTypeZero = 0; //默认腾讯压缩存储桶 20 public static $storageTypeZero = 0; //默认腾讯压缩存储桶
21 public static $storageTypeOne = 1; //非压缩存储桶 21 public static $storageTypeOne = 1; //非压缩存储桶
22 -  
23 - public static $storageTypeZeroFileFix = "ecdn6.globalso.com"; //非压缩存储桶  
24 - public static $storageTypeOneFileFix = "ecdn6-nc.globalso.com"; //压缩存储桶  
25 - public static $projectLocationDangerousFileFix = "globalso-v6.s3.us-west-2.amazonaws.com"; //危险项目存储桶  
26 -  
27 //项目标识集合 22 //项目标识集合
28 public static $blockItems = "blockitems"; //html循环项父级标识 23 public static $blockItems = "blockitems"; //html循环项父级标识
29 public static $blockAttrItems = "[blockitems]"; //html循环项父级属性标识 24 public static $blockAttrItems = "[blockitems]"; //html循环项父级属性标识
@@ -335,6 +330,14 @@ class Project extends Base @@ -335,6 +330,14 @@ class Project extends Base
335 return $value; 330 return $value;
336 } 331 }
337 332
  333 + public function getWebTrafficConfigAttribute($value)
  334 + {
  335 + if($value){
  336 + $value = Arr::s2a($value);
  337 + }
  338 + return $value;
  339 + }
  340 +
338 /** 341 /**
339 * 根据域名获取项目信息 342 * 根据域名获取项目信息
340 * @author zbj 343 * @author zbj
@@ -872,19 +872,21 @@ class CreatePageService{ @@ -872,19 +872,21 @@ class CreatePageService{
872 { 872 {
873 $projectLocation = $project->project_location; 873 $projectLocation = $project->project_location;
874 $storageType = $project->storage_type; 874 $storageType = $project->storage_type;
  875 + $cos = config('filesystems.disks.cos');
875 if ($projectLocation == Project::$projectLocationZero){ 876 if ($projectLocation == Project::$projectLocationZero){
876 //普通项目 877 //普通项目
877 if ($storageType == Project::$storageTypeZero){ 878 if ($storageType == Project::$storageTypeZero){
878 //压缩项目 879 //压缩项目
879 - $html = str_replace(Project::$storageTypeOneFileFix,Project::$storageTypeZeroFileFix,$html); 880 + $html = str_replace($cos['cdn1'],$cos['cdn'],$html);
880 }else{ 881 }else{
881 //非压缩项目 882 //非压缩项目
882 - $html = str_replace(Project::$storageTypeZeroFileFix,Project::$storageTypeOneFileFix,$html); 883 + $html = str_replace($cos['cdn'],$cos['cdn1'],$html);
883 } 884 }
884 }else{ 885 }else{
  886 + $s3 = config('filesystems.disks.s3');
885 //危险项目 887 //危险项目
886 - $html = str_replace(Project::$storageTypeOneFileFix,Project::$projectLocationDangerousFileFix,$html);  
887 - $html = str_replace(Project::$storageTypeZeroFileFix,Project::$projectLocationDangerousFileFix,$html); 888 + $html = str_replace($cos['cdn1'],$s3['cdn'],$html);
  889 + $html = str_replace($cos['cdn'],$s3['cdn'],$html);
888 } 890 }
889 return $html; 891 return $html;
890 } 892 }