1
This commit is contained in:
@@ -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([]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 验证参考文献是否全部通过
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user