salix-front/src/composables/downloadFile.js

12 lines
387 B
JavaScript
Raw Normal View History

2023-10-31 07:56:51 +00:00
import { useSession } from 'src/composables/useSession';
import { getUrl } from './getUrl';
const {getTokenMultimedia} = useSession();
const token = getTokenMultimedia();
2023-10-31 07:56:51 +00:00
export async function downloadFile(dmsId) {
let appUrl = await getUrl('', 'lilium');
appUrl = appUrl.replace('/#/', '');
window.open(`${appUrl}/api/dms/${dmsId}/downloadFile?access_token=${token}`);
}