|
@@ -96,9 +96,28 @@ class System extends BaseController
|
|
|
* @param int $id
|
|
|
* @return \think\Response
|
|
|
*/
|
|
|
- public function read($id)
|
|
|
+ public function upload()
|
|
|
{
|
|
|
- //
|
|
|
+ $post =$this->request->post();
|
|
|
+ $token = isset($post['token']) ? trim($post['token']) : "";
|
|
|
+ if($token==""){
|
|
|
+ return error_show(101,'token不能为空');
|
|
|
+ }
|
|
|
+ $effetc = VerifyTokens($token);
|
|
|
+ if(!empty($effetc) && $effetc['code']!=0){
|
|
|
+ return error_show($effetc['code'],$effetc['message']);
|
|
|
+ }
|
|
|
+ $files = $this->request->file('image');
|
|
|
+ $list="";
|
|
|
+ if($files!=""){
|
|
|
+ $list=UploadImg($files);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(is_array($list)&&!empty($list)){
|
|
|
+ return app_show(0, "上传成功!",$list);
|
|
|
+ }else{
|
|
|
+ return error_show(1005, "上传失败!".$list);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|