Upload.php 577 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\Admin\controller;
  3. class Upload
  4. {
  5. public $post="";
  6. public $userinfo="";
  7. public function __construct()
  8. {
  9. $post=request()->post();
  10. $this->post=$post;
  11. }
  12. public function index(){
  13. $files = request()->file('img');
  14. $list="";
  15. if($files!=""){
  16. $list=UploadImg($files);
  17. }
  18. //var_dump($list);
  19. if(is_array($list)&&!empty($list)){
  20. return app_show(0,"上传成功",$list);
  21. }else{
  22. return error_show(1004,"上传失败");
  23. }
  24. }
  25. }