forked from verdnatura/salix-front
12 lines
438 B
JavaScript
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}`);
|
|
}
|