20201112
This commit is contained in:
@@ -138,8 +138,8 @@ class Article extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑文章作者信息
|
||||
* @description 编辑文章作者信息
|
||||
* @title 编辑文章作者
|
||||
* @description 编辑文章作者
|
||||
* @author wangjinleichang
|
||||
* @url /master/Article/editArticleAuthor
|
||||
* @method POST
|
||||
@@ -357,6 +357,31 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑文章文件信息
|
||||
* @description 编辑文章文件信息
|
||||
* @author wangjinleichang
|
||||
* @url /master/Article/editArticleFile
|
||||
* @method POST
|
||||
*
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
* @param name:filetype type:string require:1 desc:文件类型(PDF/HTML/SUB)
|
||||
* @param name:fileURL type:string require:1 desc:文件地址
|
||||
*
|
||||
*/
|
||||
public function editArticleFile(){
|
||||
$data = $this->request->post();
|
||||
if($data['filetype']=='PDF'){
|
||||
$updata['file_pdf'] = $data['fileURL'];
|
||||
}elseif($data['filetype']=='HTML'){
|
||||
$updata['file_html'] = $data['fileURL'];
|
||||
}else{
|
||||
$updata['file_sub'] = $data['fileURL'];
|
||||
}
|
||||
$this->article_obj->where('article_id',$data['article_id'])->update($updata);
|
||||
return json(['code'=>0,'msg'=>'success']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章列表
|
||||
* @description 获取文章列表
|
||||
@@ -424,6 +449,30 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 文章图片上传
|
||||
* @description 文章图片上传
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/article_file
|
||||
* @method GET
|
||||
*
|
||||
* @param name:name type:string require:1 desc:文件域名称(articlePDF/articleHTML/articleSUB)
|
||||
* @param name:type type:string require:1 desc:pathinfo(articlePDF/articleHTML/articleSUB)
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
*/
|
||||
public function article_file($type) {
|
||||
$file = request()->file($type);
|
||||
if ($file) {
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . $type);
|
||||
if ($info) {
|
||||
return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取城市列表
|
||||
* @description 获取城市列表
|
||||
|
||||
Reference in New Issue
Block a user