This commit is contained in:
wangjinlei
2024-12-03 17:08:40 +08:00
parent 79de1c784a
commit 5bd2e2e024
7 changed files with 96 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ use app\api\controller\Base;
use think\Db;
use think\Queue;
use think\Validate;
use PhpOffice\PhpWord\IOFactory;
/**
* @title 文章接口
@@ -1905,6 +1906,38 @@ class Article extends Base
return json(['code' => 0]);
}
/**分解文章的图片和表格
* @return void
*/
public function markArticleImgTab(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where("article_id",$data['article_id'])->find();
$files = $this->article_file_obj->where("article_id",$data['article_id'])->where("type_name","manuscirpt")->where("state",0)->order("ctme desc")->limit(1)->select();
if(isset($files[0])){
$file = $files[0]['file_url'];
}
$dir = ROOT_PATH."public/articleImage/".$article_info['accept_sn'];
if (!is_dir($dir)) {
mkdir($dir, 0777, true);
}
$url = $this->ts_base_url."api/typeset/markImages";
$program['url'] = "https://submission.tmrjournals.com/public/".$files;
$program['sn'] = $article_info['accept_sn'];
$res = object_to_array(json_decode(myPost($url, $program)));
$file_runs = $res['list'];
return jsonSuccess($file_runs);
}
/**
* 编辑添加审稿实例(临时开启,为了补充审稿实例不够)
*/