作者 lyh

gx

@@ -258,12 +258,12 @@ class TranslateLogic extends BaseLogic @@ -258,12 +258,12 @@ class TranslateLogic extends BaseLogic
258 } 258 }
259 //解析路由 259 //解析路由
260 $sendData = $this->handleRoute($this->param['url']); 260 $sendData = $this->handleRoute($this->param['url']);
261 -// try { 261 + try {
262 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]); 262 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
263 if($info === false){ 263 if($info === false){
264 $sourceInfo = $this->getRouteSource($sendData['new_route']); 264 $sourceInfo = $this->getRouteSource($sendData['new_route']);
265 $param = [ 265 $param = [
266 - 'type'=>$this->param['type'], 266 + 'type'=>$this->param['type'] ?? 1,
267 'project_id'=>$this->user['project_id'], 267 'project_id'=>$this->user['project_id'],
268 'url'=>str_replace_url($this->param['url']), 268 'url'=>str_replace_url($this->param['url']),
269 'language_id'=>$this->param['language_id'], 269 'language_id'=>$this->param['language_id'],
@@ -284,9 +284,9 @@ class TranslateLogic extends BaseLogic @@ -284,9 +284,9 @@ class TranslateLogic extends BaseLogic
284 //写日志 284 //写日志
285 $userLogModel = new UserLog(); 285 $userLogModel = new UserLog();
286 $userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]); 286 $userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
287 -// }catch (\Exception $e){  
288 -// $this->fail('系统错误请联系管理员');  
289 -// } 287 + }catch (\Exception $e){
  288 + $this->fail('系统错误请联系管理员');
  289 + }
290 $this->sendMessage($sendData); 290 $this->sendMessage($sendData);
291 return $this->success(); 291 return $this->success();
292 } 292 }