|
@@ -256,10 +256,12 @@ class TranslateLogic extends BaseLogic |
|
@@ -256,10 +256,12 @@ class TranslateLogic extends BaseLogic |
|
256
|
}
|
256
|
}
|
|
257
|
$this->param['data'] = $data;
|
257
|
$this->param['data'] = $data;
|
|
258
|
}
|
258
|
}
|
|
259
|
-// try {
|
259
|
+ //解析路由
|
|
|
|
260
|
+ $sendData = $this->handleRoute($this->param['url']);
|
|
|
|
261
|
+ try {
|
|
260
|
$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']]);
|
|
261
|
if($info === false){
|
263
|
if($info === false){
|
|
262
|
- $sourceInfo = $this->getRouteSource($this->param['url']);
|
264
|
+ $sourceInfo = $this->getRouteSource($sendData['new_route']);
|
|
263
|
$param = [
|
265
|
$param = [
|
|
264
|
'type'=>$this->param['type'],
|
266
|
'type'=>$this->param['type'],
|
|
265
|
'project_id'=>$this->user['project_id'],
|
267
|
'project_id'=>$this->user['project_id'],
|
|
@@ -282,10 +284,10 @@ class TranslateLogic extends BaseLogic |
|
@@ -282,10 +284,10 @@ class TranslateLogic extends BaseLogic |
|
282
|
//写日志
|
284
|
//写日志
|
|
283
|
$userLogModel = new UserLog();
|
285
|
$userLogModel = new UserLog();
|
|
284
|
$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']]);
|
|
285
|
-// }catch (\Exception $e){
|
|
|
|
286
|
-// $this->fail('系统错误请联系管理员');
|
|
|
|
287
|
-// }
|
|
|
|
288
|
- $this->handleRoute($this->param['url']);
|
287
|
+ }catch (\Exception $e){
|
|
|
|
288
|
+ $this->fail('系统错误请联系管理员');
|
|
|
|
289
|
+ }
|
|
|
|
290
|
+ $this->sendMessage($sendData);
|
|
289
|
return $this->success();
|
291
|
return $this->success();
|
|
290
|
}
|
292
|
}
|
|
291
|
|
293
|
|
|
@@ -308,6 +310,9 @@ class TranslateLogic extends BaseLogic |
|
@@ -308,6 +310,9 @@ class TranslateLogic extends BaseLogic |
|
308
|
$route = basename($route);
|
310
|
$route = basename($route);
|
|
309
|
$routeModel = new RouteMap();
|
311
|
$routeModel = new RouteMap();
|
|
310
|
$routeInfo = $routeModel->read(['route'=>$route]);
|
312
|
$routeInfo = $routeModel->read(['route'=>$route]);
|
|
|
|
313
|
+ if($routeInfo === false){
|
|
|
|
314
|
+ return $data;
|
|
|
|
315
|
+ }
|
|
311
|
return $this->resultData($routeInfo,$data);
|
316
|
return $this->resultData($routeInfo,$data);
|
|
312
|
}
|
317
|
}
|
|
313
|
|
318
|
|
|
@@ -415,6 +420,17 @@ class TranslateLogic extends BaseLogic |
|
@@ -415,6 +420,17 @@ class TranslateLogic extends BaseLogic |
|
415
|
$data['new_route'] = $route;
|
420
|
$data['new_route'] = $route;
|
|
416
|
$data['lang'] = $lang;
|
421
|
$data['lang'] = $lang;
|
|
417
|
$data['project_id']= $this->user['project_id'];
|
422
|
$data['project_id']= $this->user['project_id'];
|
|
418
|
- $this->curlDelRoute($data);
|
423
|
+ return $this->success($data);
|
|
|
|
424
|
+ }
|
|
|
|
425
|
+
|
|
|
|
426
|
+ /**
|
|
|
|
427
|
+ * @remark :发送通知
|
|
|
|
428
|
+ * @name :send
|
|
|
|
429
|
+ * @author :lyh
|
|
|
|
430
|
+ * @method :post
|
|
|
|
431
|
+ * @time :2024/5/21 11:13
|
|
|
|
432
|
+ */
|
|
|
|
433
|
+ public function sendMessage($data){
|
|
|
|
434
|
+ return $this->curlDelRoute($data);
|
|
419
|
}
|
435
|
}
|
|
420
|
} |
436
|
} |