Closed lexdubyna closed 5 years ago
Hi.
Yes, there is such a problem. Images are connected as follows:
v-bind:src="image url"
How will free time I will think what can be done ..
If you need to separate, maybe you can use file manager without token authorization.. you can use pre-compiled version - see laravel-filemanager
May I suggest using https://www.npmjs.com/package/vue-auth-image ?
I can't get it running using published compiled and minimized js and css files. <div id="fm"></div>
is empty and there are no errors in the console.
May I suggest using https://www.npmjs.com/package/vue-auth-image ?
I already read a little, and saw such packages. The approach is clear, I can do this. But!!! There are still audio and video files with streaming. The player is used - Plyr and there I did not find anything that will allow to transmit the headers ..
I will study the question, but I'm not sure that I will do it ..
I can't get it running using published compiled and minimized js and css files.
<div id="fm"></div>
is empty and there are no errors in the console.
Have you published the files?
php artisan vendor:publish --tag=fm-assets
in file-manager.php config add middleware - "web" (+ your middleware for auth)
'middleware' => ['web'],
view file example:
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Laravel</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
<link rel="stylesheet" href="{{ asset('vendor/file-manager/css/file-manager.css') }}">
</head>
<body>
<div style="height: 600px;">
<div id="fm"></div>
</div>
<script src="{{ asset('vendor/file-manager/js/file-manager.js') }}"></script>
</body>
</html>
I did php artisan vendor:publish --tag=fm-assets
.
The thing is that I'm using Laravel on a separate server as an API and my front-end app is Vue SPA (again on a separate server). I was trying to include all the scripts and styles from Laravel server in <head>
when I initialize the component (using created
hook) that uses file manager (with <div id="fm"></div>
inside) but it doesn't seem to work.
Anyway, thank you for such a great tool! Even with the current functionality I am still going to use it)
I hame the same problem in Vue SPA. Images not show. Redirect to login route.
Can you test a new version of LFM? I added some functionality for view thumbnails and image preview if using "Authorization" header
Hello! I am trying to use your awesome file manager but I ran into two problems. The first one: Images are not shown due to lack of authorization header. I can upload and delete images but the images themselves are not shown. Error in console -
Cross-Origin Read Blocking (CORB) blocked cross-origin response http://api-a2key/file-manager/thumbnails?disk=images&path=logo.png with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
This is because the server's answer is{"error":"Unauthorized"}
as I use middleware on the server. When I try the same file-manager's link in Postman with headerAuthorization: Bearer 'token is here'
I see the image needed. As I can see this header is not used for images src requests in my Vue app. When I remove the middleware - everything is shown correctly.My app config:
I tried to add
headers: {'Authorization': 'Bearer ...'}
to config, but that didn't help.The second: can I initialize and use file manager in a separate component? There are a lot of dynamic imports in my app and I would like not to include file-manager in app.js as there are client and admin pages.