fix: warmFix quasar build async function
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0c67c31537
commit
88c61c8a85
|
@ -5,18 +5,19 @@ import { exportFile } from 'quasar';
|
||||||
|
|
||||||
const { getTokenMultimedia } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
const token = getTokenMultimedia();
|
const token = getTokenMultimedia();
|
||||||
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
|
|
||||||
|
|
||||||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
||||||
|
const appUrl = await getAppUrl();
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
|
||||||
{ responseType: 'blob' }
|
{ responseType: 'blob' },
|
||||||
);
|
);
|
||||||
|
|
||||||
download(response);
|
download(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function downloadDocuware(url, params) {
|
export async function downloadDocuware(url, params) {
|
||||||
|
const appUrl = await getAppUrl();
|
||||||
const response = await axios.get(`${appUrl}/api/` + url, {
|
const response = await axios.get(`${appUrl}/api/` + url, {
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
params,
|
params,
|
||||||
|
@ -32,3 +33,7 @@ function download(response) {
|
||||||
|
|
||||||
exportFile(filename, response.data);
|
exportFile(filename, response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getAppUrl() {
|
||||||
|
return (await getUrl('', 'lilium')).replace('/#/', '');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue