Procházet zdrojové kódy

Merge branch 'master' of http://git.daboryhost.com:10880/youhk/youhk_test_repository

hokky před 1 měsícem
rodič
revize
fbaabc7336

+ 2 - 2
resources/views/front/dabory/myapp/popup/popup-form1/form-a/member-seller-edit-form.blade.php

@@ -284,11 +284,11 @@
                         }
                     }
 
-
                     let formData = new FormData();
                     formData.append('_token', $('meta[name="csrf-token"]').attr('content'))
                     formData.append('file', file);
                     formData.append('media', JSON.stringify(media));
+                    // formData.append('type', 'member');
 
                     $.ajax({
                         url: "/file-upload",
@@ -297,7 +297,7 @@
                         processData: false,
                         contentType: false,
                         success: function(data) {
-                            // console.log('upload succes : ', data);
+                            console.log('upload succes : ', data);
                             PopupPopupForm1FormAMemberSellerEditForm.callback_success(original_file_path)
 
                         },

+ 10 - 3
routes/web.php

@@ -382,6 +382,7 @@ Route::middleware('check.gate.token')->group(function () {
 
 
     Route::post('/brand-image-file-list', function (Request $request) {
+        $theme = env('DBR_THEME');
         $filePath = daboryPath("themes/" . env('DBR_THEME') . "/pro/resources/assets/brand-images");
         $files = \File::allFiles($filePath);
 
@@ -527,11 +528,17 @@ Route::middleware('check.gate.token')->group(function () {
         if (!$request->hasFile('file')) {
             return response('error', 500);
         }
-
+        // $type = $request->input('type');
         $media = json_decode(request('media'), true);
-
         $file = $request->file('file');
-        $file->storeAs($media['path'], $media['name'], ['disk' => getDisk()]);
+
+        // if (isset($type) && !empty($type)) {
+        //     $path = $media['path'] ?? 'default/path'; // 기본 경로 설정
+        //     $filePath = \Storage::disk(getDisk())->put($path, $file);
+        //     // return $filePath;
+        //     return response($filePath, 201);
+        // }
+        // $file->storeAs($media['path'], $media['name'], ['disk' => getDisk()]);
 
         $bdPage = [];
         if ($media['type'] == 'image') {