This commit is contained in:
wangjinlei
2022-09-06 10:31:26 +08:00
parent cbcd329ff9
commit ea2355c4d8
122 changed files with 14911 additions and 0 deletions

View File

@@ -289,6 +289,36 @@ class Typeset extends Controller
}
public function up_pdf_file(){
$file = request()->file('pdf');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'pdf');
if ($info) {
return json(['code' => 0, 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* 更新pdf文件
*/
public function updateArticlePdfFile(){
$data = $this->request->post();
$rule = new Validate([
'article_id'=>'require',
'pdf'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$this->article_obj->where('article_id',$data['article_id'])->update(['pdf_url'=>$data['pdf']]);
return jsonSuccess([]);
}
/**
* 验证参考文献是否全部通过
*/