更新获取相似角色的接口路径,修改为调用新的搜索和推荐接口。同时,移除不必要的调试代码,优化角色编辑用例的代码结构,提升可读性。

This commit is contained in:
海龙 2025-08-12 22:04:54 +08:00
parent b6bb65eddb
commit 60c7d11101
4 changed files with 52 additions and 58 deletions

View File

@ -902,7 +902,7 @@ export const getSimilarCharacters = async (request: {
/** 总数量 */ /** 总数量 */
total_count: number; total_count: number;
}>> => { }>> => {
return post("/character/get_similar_characters", request); return post("/character/search_and_recommend", request);
}; };
/** /**

View File

@ -346,7 +346,6 @@ export const useShotService = (): UseShotService => {
// 上传到七牛云 // 上传到七牛云
const imageUrl = await uploadToQiniu(file, token); const imageUrl = await uploadToQiniu(file, token);
console.log('imageUrl', imageUrl);
// 调用用例中的识别角色方法 // 调用用例中的识别角色方法
if (vidoEditUseCase) { if (vidoEditUseCase) {
try { try {

View File

@ -88,13 +88,6 @@ export class RoleEditUseCase {
}); });
} }
/**
*
* @description RoleEntity数组
* @param {RoleResponse[]} projectRoleData -
* @returns {RoleEntity[]}
* @throws {Error}
*/
/** /**
* *
* @description RoleEntity数组 * @description RoleEntity数组

View File

@ -74,39 +74,41 @@ export function HomePage2() {
// 处理创建项目 // 处理创建项目
const handleCreateProject = async () => { const handleCreateProject = async () => {
if (isCreating) return; // console.log('isCreating', isCreating);
try {
setIsCreating(true);
router.push(`/create`); router.push(`/create`);
return; // if (isCreating) return;
// 使用默认值 // try {
const projectType = ProjectTypeEnum.SCRIPT_TO_VIDEO; // setIsCreating(true);
// router.push(`/create`);
// return;
// 构建项目数据并调用API // // 使用默认值
const projectData: CreateScriptProjectRequest = { // const projectType = ProjectTypeEnum.SCRIPT_TO_VIDEO;
title: "script default", // 默认剧本名称
project_type: projectType,
mode: ModeEnum.MANUAL === 'manual' ? 1 : 2, // 1 表示手动模式2 表示自动模式
resolution: 1080 // 1080p 分辨率
};
const projectResponse = await createScriptProject(projectData); // // 构建项目数据并调用API
// const projectData: CreateScriptProjectRequest = {
// title: "script default", // 默认剧本名称
// project_type: projectType,
// mode: ModeEnum.MANUAL === 'manual' ? 1 : 2, // 1 表示手动模式2 表示自动模式
// resolution: 1080 // 1080p 分辨率
// };
if (projectResponse.code === 0 && projectResponse.data.id) { // const projectResponse = await createScriptProject(projectData);
const projectId = projectResponse.data.id;
setCreatedProjectId(projectId); // if (projectResponse.code === 0 && projectResponse.data.id) {
// projectId 作为参数传递给 create 页面 // const projectId = projectResponse.data.id;
router.push(`/create?projectId=${projectId}`); // setCreatedProjectId(projectId);
} else { // // projectId 作为参数传递给 create 页面
alert(`创建项目失败: ${projectResponse.message}`); // router.push(`/create?projectId=${projectId}`);
} // } else {
} catch (error) { // alert(`创建项目失败: ${projectResponse.message}`);
alert("创建项目时发生错误,请稍后重试"); // }
} finally { // } catch (error) {
setIsCreating(false); // alert("创建项目时发生错误,请稍后重试");
} // } finally {
// setIsCreating(false);
// }
}; };
// 处理工具切换 // 处理工具切换