|
...
|
...
|
@@ -256,10 +256,12 @@ class TranslateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$this->param['data'] = $data;
|
|
|
|
}
|
|
|
|
// try {
|
|
|
|
//解析路由
|
|
|
|
$sendData = $this->handleRoute($this->param['url']);
|
|
|
|
try {
|
|
|
|
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
|
|
|
|
if($info === false){
|
|
|
|
$sourceInfo = $this->getRouteSource($this->param['url']);
|
|
|
|
$sourceInfo = $this->getRouteSource($sendData['new_route']);
|
|
|
|
$param = [
|
|
|
|
'type'=>$this->param['type'],
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
...
|
...
|
@@ -282,10 +284,10 @@ class TranslateLogic extends BaseLogic |
|
|
|
//写日志
|
|
|
|
$userLogModel = new UserLog();
|
|
|
|
$userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// $this->fail('系统错误请联系管理员');
|
|
|
|
// }
|
|
|
|
$this->handleRoute($this->param['url']);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误请联系管理员');
|
|
|
|
}
|
|
|
|
$this->sendMessage($sendData);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -308,6 +310,9 @@ class TranslateLogic extends BaseLogic |
|
|
|
$route = basename($route);
|
|
|
|
$routeModel = new RouteMap();
|
|
|
|
$routeInfo = $routeModel->read(['route'=>$route]);
|
|
|
|
if($routeInfo === false){
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
return $this->resultData($routeInfo,$data);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -415,6 +420,17 @@ class TranslateLogic extends BaseLogic |
|
|
|
$data['new_route'] = $route;
|
|
|
|
$data['lang'] = $lang;
|
|
|
|
$data['project_id']= $this->user['project_id'];
|
|
|
|
$this->curlDelRoute($data);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :发送通知
|
|
|
|
* @name :send
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/5/21 11:13
|
|
|
|
*/
|
|
|
|
public function sendMessage($data){
|
|
|
|
return $this->curlDelRoute($data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|