完善生图5.0的功能
This commit is contained in:
1 parent
88a4268d40
commit
678d213f40
31 files changed
+3281
-107
No files matched your search
@@ -2,10 +2,20 @@ export function assetPreviewUrl(asset: { id: string }) {
|
||||
return `/api/assets/${encodeURIComponent(asset.id)}/download?inline=1`;
|
||||
}
|
||||
|
||||
// Binary reads stay on the application origin so browser fetch/canvas callers
|
||||
// do not follow a private-OSS preview redirect and require bucket CORS access.
|
||||
export function assetContentUrl(asset: { id: string }) {
|
||||
return `/api/assets/${encodeURIComponent(asset.id)}/download`;
|
||||
}
|
||||
|
||||
export function materialPreviewUrl(material: { id?: string; url: string }) {
|
||||
return material.id ? assetPreviewUrl({ id: material.id }) : material.url;
|
||||
}
|
||||
|
||||
export function materialContentUrl(material: { id?: string; url: string }) {
|
||||
return material.id ? assetContentUrl({ id: material.id }) : material.url;
|
||||
}
|
||||
|
||||
export function storedAssetPreviewUrl(url: string | undefined, assets: Array<{ id: string; url: string }>) {
|
||||
if (!url) return "";
|
||||
const asset = assets.find((item) => item.url === url);
|
||||
|
||||
Reference in new issue
Block a user