Skip to content
关注公众号,获取新课通知

上传文件


控制器 app/controller/admin/SysSetting.php

php
protected $excludeValidateCheck = [
	// ... 
	'upload'
];
// 上传
   public function upload(){
   	$file = request()->file('file');
   	// 上传到本地服务器
   	$savename = \think\facade\Filesystem::putFile( 'wx', $file);
   	return showSuccess('/public/storage/'.$savename);
   }

路由 router/admin.php

php
Route::post('sysconfig/upload','admin.SysSetting/upload');