mirror of
https://github.com/filegator/filegator.git
synced 2025-08-10 23:44:01 +02:00
Basic file preview
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
const api = {
|
||||
getConfig() {
|
||||
@@ -190,6 +191,13 @@ const api = {
|
||||
.catch(error => reject(error))
|
||||
})
|
||||
},
|
||||
downloadItem (params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.get('download&path='+encodeURIComponent(Base64.encode(params.path)))
|
||||
.then(res => resolve(res.data))
|
||||
.catch(error => reject(error))
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
export default api
|
||||
|
Reference in New Issue
Block a user