合并主分支素材库多选更新
合入素材库多选操作与批量导出更新 保留画布生成配方分支改动并解决冲突
This commit is contained in:
@@ -101,6 +101,15 @@ export function shouldResolveAssetReadUrl(source: string | null | undefined) {
|
||||
);
|
||||
}
|
||||
|
||||
export function hasReadableAssetSource(
|
||||
source: string | null | undefined,
|
||||
objectKey?: string | null,
|
||||
) {
|
||||
return Boolean(
|
||||
source?.trim() || objectKey?.trim().replace(/^\/+/u, ''),
|
||||
);
|
||||
}
|
||||
|
||||
function normalizeLegacyPublicPath(value: string) {
|
||||
return `/${value.trim().replace(/^\/+/u, '')}`;
|
||||
}
|
||||
@@ -513,11 +522,11 @@ export async function readAssetBytes(
|
||||
options: AssetReadBytesOptions = {},
|
||||
) {
|
||||
const value = source?.trim() ?? '';
|
||||
if (!value) {
|
||||
const objectKey = options.objectKey?.trim().replace(/^\/+/u, '') ?? '';
|
||||
if (!hasReadableAssetSource(value, objectKey)) {
|
||||
throw new Error('资源路径不能为空');
|
||||
}
|
||||
|
||||
const objectKey = options.objectKey?.trim().replace(/^\/+/u, '') ?? '';
|
||||
const legacyPath = isGeneratedLegacyPath(value)
|
||||
? value
|
||||
: resolveGeneratedLegacyPathFromUrl(value);
|
||||
|
||||
Reference in New Issue
Block a user