feat: 接入形态图库与 Seedream 生图操作

展示已有主图、候选图和失败记录,支持单图及批量生成、主图选择。
补充正式 ID 校验、费用确认、图片加载占位和回归测试。
依赖后端 eac8dc3 的项目形态图库只读接口。
This commit is contained in:
GouJ
2026-08-28 15:16:25 +08:00
parent bae69c3c62
commit 47443c0efe
26 changed files with 1338 additions and 25 deletions
@@ -155,7 +155,10 @@ function exportResult(kind: 'spec' | 'prompt') {
后端未返回参考图或缺失记录
</p>
<p v-if="references.missing.length" class="mt-3 text-xs text-muted">
先在后端补齐对应形态的图片再刷新本页暂不包含主体图生成
在形态图库补齐图片或设置主图再刷新本镜头参考图
<RouterLink :to="`/projects/${projectId}/subject-images`" class="text-button ml-2"
>前往形态图片</RouterLink
>
</p>
</template>
</section>
+2 -16
View File
@@ -110,19 +110,5 @@ export function directionLabel(value: string, field?: string): string {
return labels[value] ?? value
}
/** 只开放 http(s) 与同源 /storage 路径,拦截模型/数据中的 javascript 或协议相对 URL。 */
export function referenceImageUrl(value: string): string | null {
const raw = value.trim()
try {
if (raw.startsWith('/storage/') && !raw.includes('\\')) {
const api = import.meta.env.VITE_API_BASE_URL || '/api'
const origin = /^https?:\/\//i.test(api) ? new URL(api).origin : window.location.origin
const url = new URL(raw, origin)
return url.pathname.startsWith('/storage/') ? url.href : null
}
const url = new URL(raw)
return ['http:', 'https:'].includes(url.protocol) ? url.href : null
} catch {
return null
}
}
/** 保留已有导出路径;图库与分镜共用同一套图片地址校验。 */
export { referenceImageUrl } from '../../lib/assets'