0
0
Fork 0
salix-front-mindshore-fork2/src/composables/downloadFile.js

12 lines
438 B
JavaScript

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