作者 lyh

修改脚本设置

@@ -30,8 +30,8 @@ class BlogLogic extends BaseLogic @@ -30,8 +30,8 @@ class BlogLogic extends BaseLogic
30 */ 30 */
31 public function blogSave(){ 31 public function blogSave(){
32 //拼接参数 32 //拼接参数
33 -// DB::beginTransaction();  
34 -// try { 33 + DB::beginTransaction();
  34 + try {
35 $this->param = $this->paramProcessing($this->param); 35 $this->param = $this->paramProcessing($this->param);
36 if(isset($this->param['id']) && !empty($this->param['id'])){ 36 if(isset($this->param['id']) && !empty($this->param['id'])){
37 $id = $this->param['id']; 37 $id = $this->param['id'];
@@ -48,11 +48,11 @@ class BlogLogic extends BaseLogic @@ -48,11 +48,11 @@ class BlogLogic extends BaseLogic
48 $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); 48 $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
49 $this->edit(['url'=>$route],['id'=>$id]); 49 $this->edit(['url'=>$route],['id'=>$id]);
50 } 50 }
51 -// DB::commit();  
52 -// }catch (\Exception $e){  
53 -// DB::rollBack();  
54 -// $this->fail('系统错误,请联系管理员');  
55 -// } 51 + DB::commit();
  52 + }catch (\Exception $e){
  53 + DB::rollBack();
  54 + $this->fail('系统错误,请联系管理员');
  55 + }
56 $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); 56 $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);
57 $this->curlDelRoute(['new_route'=>$route]); 57 $this->curlDelRoute(['new_route'=>$route]);
58 return $this->success(['id'=>$id]); 58 return $this->success(['id'=>$id]);
@@ -25,7 +25,7 @@ class BlogRequest extends FormRequest @@ -25,7 +25,7 @@ class BlogRequest extends FormRequest
25 { 25 {
26 return [ 26 return [
27 'name'=>'required|max:200', 27 'name'=>'required|max:200',
28 - 'seo_keywords'=>'max:1000', 28 + 'seo_keywords'=>'max:500',
29 'url'=>'required', 29 'url'=>'required',
30 ]; 30 ];
31 } 31 }