salix-front/src/composables/downloadFile.js

12 lines
387 B
JavaScript

import { useSession } from 'src/composables/useSession';
import { getUrl } from './getUrl';
const {getTokenMultimedia} = useSession();
const token = getTokenMultimedia();
export async function downloadFile(dmsId) {
let appUrl = await getUrl('', 'lilium');
appUrl = appUrl.replace('/#/', '');
window.open(`${appUrl}/api/dms/${dmsId}/downloadFile?access_token=${token}`);
}