更新apk上传
This commit is contained in:
parent
a73822bc57
commit
b049420b79
@ -273,18 +273,17 @@ class Common extends BaseController
|
||||
return app('json')->success(['src' => tidy_url($upload->getFileInfo()->filePath)]);
|
||||
}
|
||||
|
||||
public function uploadFile()
|
||||
public function uploadApp()
|
||||
{
|
||||
$file = $this->request->file('file');
|
||||
if (!$file)
|
||||
return app('json')->fail('请上传文件');
|
||||
validate(["file|文件" => [
|
||||
'fileSize' => config('upload.filesize'),
|
||||
'fileExt' => 'apk,ipa,doc,pdf,txt',
|
||||
'fileMime' => '',
|
||||
]])->check(['file' => $file]);
|
||||
// validate(["file|文件" => [
|
||||
// 'fileSize' => config('upload.filesize'),
|
||||
// 'fileExt' => 'apk,ipa'
|
||||
// ]])->check(['file' => $file]);
|
||||
$upload = UploadService::create();
|
||||
$data = $upload->to('media')->validate([])->move('file');
|
||||
$data = $upload->to('app')->validate([])->move('file');
|
||||
if ($data === false) {
|
||||
return app('json')->fail($upload->getError());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ return [
|
||||
//上传文件大小
|
||||
'filesize' => 52428800,
|
||||
//上传文件后缀类型
|
||||
'fileExt' => ['jpg', 'jpeg', 'png', 'gif', 'pem', 'mp3', 'wma', 'wav', 'amr', 'mp4', 'key','xlsx','xls','ico'],
|
||||
'fileExt' => ['jpg', 'jpeg', 'png', 'gif', 'pem', 'mp3', 'wma', 'wav', 'amr', 'mp4', 'key', 'xlsx', 'xls', 'ico', 'apk', 'ipa'],
|
||||
//上传文件类型
|
||||
'fileMime' => ['image/jpeg', 'image/gif', 'image/png', 'text/plain', 'audio/mpeg', 'image/vnd.microsoft.icon'],
|
||||
//驱动模式
|
||||
|
@ -552,7 +552,7 @@ Route::group('api/', function () {
|
||||
})->prefix('api.article.');
|
||||
|
||||
Route::post('upload/video', 'merchant.Common/uploadVideo');
|
||||
Route::post('upload/file', 'merchant.Common/uploadFile');
|
||||
Route::post('upload/app', 'merchant.Common/uploadApp');
|
||||
Route::get('excel/download/:id', 'merchant.store.order.Order/download');
|
||||
//申请商户
|
||||
Route::post('intention/create', 'api.store.merchant.MerchantIntention/create');
|
||||
|
Loading…
x
Reference in New Issue
Block a user