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

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