修复类型问题

This commit is contained in:
北枳 2025-08-17 20:17:47 +08:00
parent ab3eecc3ea
commit ea7e336d1e
4 changed files with 13 additions and 7 deletions

View File

@ -85,7 +85,8 @@ export interface UseScriptService {
userId: string,
mode: "automatic" | "manual",
resolution: string,
language: string
language: string,
video_duration: string
) => Promise<void>;
/** 设置任何属性 */
setAnyAttribute: any;
@ -158,7 +159,8 @@ export const useScriptService = (): UseScriptService => {
userId: string,
mode: "automatic" | "manual",
resolution: string,
language: string
language: string,
video_duration: string
): Promise<void> => {
try {
setLoading(true);
@ -169,7 +171,8 @@ export const useScriptService = (): UseScriptService => {
userId,
mode as "automatic" | "manual",
resolution as "720p" | "1080p" | "4k",
language
language,
video_duration
);
setProjectId(projectData.project_id);

View File

@ -60,10 +60,10 @@ export class TextToShotAdapter {
let currentText = text;
// 按角色名称长度降序排序,避免短名称匹配到长名称的一部分
// 既要兼容 首字母大写 其余小写、还要兼容 全部大写
// 既要兼容 每个单词 首字母大写 其余小写、还要兼容 全部大写
const sortedRoles = [...roles].sort((a, b) => b.name.length - a.name.length).map(role => ({
...role,
name: role.name.charAt(0).toUpperCase() + role.name.slice(1).toLowerCase()
name: role.name.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ')
})).concat([...roles].map(role => ({
...role,
name: role.name.toUpperCase()

View File

@ -40,7 +40,8 @@ describe("ScriptService 业务逻辑测试", () => {
"user123",
"automatic",
"720p",
"en"
"en",
"10"
);
expect(createRes.project_id).toBeDefined();
projectId = createRes.project_id;

View File

@ -126,7 +126,8 @@ export class ScriptEditUseCase {
userId: string ,
mode: "automatic" | "manual" = "automatic",
resolution: "720p" | "1080p" | "4k" = "720p",
language: string
language: string,
video_duration: string
) {
try {
// 调用创建项目API
@ -136,6 +137,7 @@ export class ScriptEditUseCase {
mode,
resolution,
language,
video_duration,
});
if (!response.successful) {