feat: 实现分镜视频功能和提示词优化功能
主要功能: 1. 分镜视频创作功能 - 支持文生图生成分镜图 - 支持直接上传分镜图生成视频 - 两步式流程:生成分镜图 -> 生成视频 - 完整的任务管理和状态轮询 2. 提示词优化功能 - 为所有创作页面添加一键优化按钮 - 支持三种优化类型:文生视频、图生视频、分镜视频 - 使用GPT-4o-mini进行智能优化 - 完善的错误处理和用户体验 技术改进: - 使用@Async和@Transactional优化异步处理 - 增强错误处理和超时控制 - 改进前端状态管理和用户体验 - 添加完整的代码审查文档
This commit is contained in:
@@ -387,6 +387,7 @@ import {
|
||||
Delete,
|
||||
Refresh
|
||||
} from '@element-plus/icons-vue'
|
||||
import cleanupApi from '@/api/cleanup'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -507,18 +508,9 @@ const getAuthHeaders = () => {
|
||||
const refreshStats = async () => {
|
||||
loadingStats.value = true
|
||||
try {
|
||||
const response = await fetch('http://localhost:8080/api/cleanup/cleanup-stats', {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...getAuthHeaders()
|
||||
}
|
||||
})
|
||||
if (response.ok) {
|
||||
cleanupStats.value = await response.json()
|
||||
ElMessage.success('统计信息刷新成功')
|
||||
} else {
|
||||
ElMessage.error('获取统计信息失败')
|
||||
}
|
||||
const response = await cleanupApi.getCleanupStats()
|
||||
cleanupStats.value = response.data
|
||||
ElMessage.success('统计信息刷新成功')
|
||||
} catch (error) {
|
||||
console.error('获取统计信息失败:', error)
|
||||
ElMessage.error('获取统计信息失败')
|
||||
@@ -530,23 +522,11 @@ const refreshStats = async () => {
|
||||
const performFullCleanup = async () => {
|
||||
loadingCleanup.value = true
|
||||
try {
|
||||
const response = await fetch('http://localhost:8080/api/cleanup/full-cleanup', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...getAuthHeaders()
|
||||
}
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
const result = await response.json()
|
||||
ElMessage.success('完整清理执行成功')
|
||||
console.log('清理结果:', result)
|
||||
// 刷新统计信息
|
||||
await refreshStats()
|
||||
} else {
|
||||
ElMessage.error('执行完整清理失败')
|
||||
}
|
||||
const response = await cleanupApi.performFullCleanup()
|
||||
ElMessage.success('完整清理执行成功')
|
||||
console.log('清理结果:', response.data)
|
||||
// 刷新统计信息
|
||||
await refreshStats()
|
||||
} catch (error) {
|
||||
console.error('执行完整清理失败:', error)
|
||||
ElMessage.error('执行完整清理失败')
|
||||
@@ -566,6 +546,27 @@ const performUserCleanup = async () => {
|
||||
const valid = await userCleanupFormRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
loadingUserCleanup.value = true
|
||||
try {
|
||||
const response = await cleanupApi.cleanupUserTasks(userCleanupForm.username)
|
||||
ElMessage.success('用户任务清理成功')
|
||||
console.log('清理结果:', response.data)
|
||||
// 刷新统计信息
|
||||
await refreshStats()
|
||||
// 关闭对话框
|
||||
handleCloseUserCleanupDialog()
|
||||
} catch (error) {
|
||||
console.error('清理用户任务失败:', error)
|
||||
ElMessage.error('清理用户任务失败')
|
||||
} finally {
|
||||
loadingUserCleanup.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const performUserCleanup_old = async () => {
|
||||
const valid = await userCleanupFormRef.value.validate()
|
||||
if (!valid) return
|
||||
|
||||
loadingUserCleanup.value = true
|
||||
try {
|
||||
const response = await fetch(`/api/cleanup/user-tasks/${userCleanupForm.username}`, {
|
||||
|
||||
Reference in New Issue
Block a user