<?php
namespace app\admin\controller;

use think\facade\Filesystem;

class Upload extends AdminController{

    // 上传
    public function index($type){
        $image = request()->file('image');
        $savename = Filesystem::disk('public')->putFile( 'temps/qrcode', $image);
        return $this->responseSuccess($savename);
    }

    // 删除
    public function destroy(){
        $urls = request()->post('file');
        removeFile(getFilePath($urls,1));
        return $this->responseSuccess();
    }
}
