Basic file preview

This commit is contained in:
Milos Stojanovic
2020-02-20 14:03:51 +01:00
parent 37dbc2b76b
commit b8f7d000fb
6 changed files with 107 additions and 10 deletions

View File

@@ -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