|
...
|
...
|
@@ -46,7 +46,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
trim($v)=>$translate_list[$k],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
return $this->response('success',Code::SUCCESS,$data);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
$old_key = [];//key值组成数据
|
|
|
|
$data = json_decode($info['data'],true);
|
|
...
|
...
|
@@ -62,7 +62,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
$this->success($data);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :获取图片列表
|
|
...
|
...
|
@@ -81,7 +81,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
$v=>$v,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
return $this->response('success',Code::SUCCESS,$data);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
$new_list = $this->getUrlImageRead($this->param['url']);
|
|
|
|
$old_list = [];
|
|
...
|
...
|
@@ -100,7 +100,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :获取语种信息
|
|
...
|
...
|
@@ -158,6 +158,21 @@ class TranslateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 翻译校对 dom
|
|
|
|
*/
|
|
|
|
public function proofreadPhpQuery($url)
|
|
|
|
{
|
|
|
|
$html = file_get_contents($url);
|
|
|
|
$dom = \phpQuery::newDocument($html);
|
|
|
|
$dom->find('.change-language')->remove();
|
|
|
|
$dom->find('script')->remove();
|
|
|
|
$dom->find('style')->remove();
|
|
|
|
$test = $dom->text();
|
|
|
|
file_put_contents($url, $test);
|
|
|
|
$this->success($test);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取Url内容
|
|
|
|
* @name :getUrlRead
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -195,7 +210,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
* @time :2023/6/12 10:52
|
|
|
|
*/
|
|
|
|
public function translateSave(){
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
if($info === false){
|
|
|
|
$param = [
|
|
...
|
...
|
@@ -211,9 +226,9 @@ class TranslateLogic extends BaseLogic |
|
|
|
$data = json_encode($this->param['data'],true);
|
|
|
|
$this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误请联系管理员');
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// $this->fail('系统错误请联系管理员');
|
|
|
|
// }
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|