2022-09-04 08:34:39 -05:00
|
|
|
import { AssetCountByTimeGroupResponseDto } from '@api';
|
2022-08-24 10:21:41 +07:00
|
|
|
let _basePath = '/api';
|
|
|
|
|
|
|
|
|
|
export function getFileUrl(aid: string, did: string, isThumb?: boolean, isWeb?: boolean) {
|
2022-09-04 08:34:39 -05:00
|
|
|
const urlObj = new URL(`${window.location.origin}${_basePath}/asset/file`);
|
2022-08-24 10:21:41 +07:00
|
|
|
|
2022-09-04 08:34:39 -05:00
|
|
|
urlObj.searchParams.append('aid', aid);
|
|
|
|
|
urlObj.searchParams.append('did', did);
|
|
|
|
|
if (isThumb !== undefined && isThumb !== null)
|
|
|
|
|
urlObj.searchParams.append('isThumb', `${isThumb}`);
|
|
|
|
|
if (isWeb !== undefined && isWeb !== null) urlObj.searchParams.append('isWeb', `${isWeb}`);
|
|
|
|
|
|
|
|
|
|
return urlObj.href;
|
2022-08-24 10:21:41 +07:00
|
|
|
}
|