feat(short-drama-agent-front): 接入图片持续授权与视频费用审计

This commit is contained in:
GJ committed 2026-11-13 17:59:50 +08:00
1 parent 3915566994
commit 1e9ef33d1d
39 files changed
+3442 -51

No files matched your search

+3 -3
View File
@@ -1,7 +1,7 @@
import { inject, ref, type InjectionKey, type Ref } from 'vue'
import { hasInjectionContext, inject, ref, type InjectionKey, type Ref } from 'vue'
/** 项目配置沿用同一个抽屉,可直接定位生成配置或质量规则。 */
export type ProjectSettingsTab = 'generation' | 'quality'
export type ProjectSettingsTab = 'generation' | 'quality' | 'image-authorization'
/** 项目内共享的配置修订号,成功保存后通知已挂载的生成表单重新读取。 */
export const projectGenerationRevisionKey: InjectionKey<Ref<number>> = Symbol('project-generation-revision')
@@ -13,5 +13,5 @@ export const projectSettingsOpenKey: InjectionKey<(tab?: ProjectSettingsTab) =>
* @returns 当前项目的响应式配置修订号
*/
export function useProjectGenerationRevision() {
return inject(projectGenerationRevisionKey, undefined) ?? ref(0)
return (hasInjectionContext() ? inject(projectGenerationRevisionKey, undefined) : undefined) ?? ref(0)
}