chore: update pom.xml Lombok config and deploy settings
- Update Maven compiler plugin to support Lombok annotation processing - Add deploy.conf for automated deployment - Update backend models and controllers - Update frontend pages and API
This commit is contained in:
@@ -568,80 +568,26 @@ export default {
|
||||
if (this._publishing) return
|
||||
this._publishing = true
|
||||
|
||||
uni.showLoading({
|
||||
title: this.enableAIVideo ? '正在创建视频任务...' : '发布中...'
|
||||
});
|
||||
|
||||
uni.showLoading({ title: '发布中...' });
|
||||
|
||||
try {
|
||||
const imageUrls = this.selectedImages;
|
||||
|
||||
// 如果开启了AI视频生成,创建视频任务
|
||||
let videoTaskId = '';
|
||||
if (this.enableAIVideo) {
|
||||
try {
|
||||
// 构建视频生成提示词
|
||||
const mealLabel = this.mealTypes.find(m => m.value === this.selectedMealType)?.label || '饮食';
|
||||
const videoPrompt = this.remark || `健康${mealLabel}打卡`;
|
||||
|
||||
const taskParams = {
|
||||
uid: String(this.uid || ''),
|
||||
prompt: videoPrompt,
|
||||
image_urls: imageUrls,
|
||||
remove_watermark: true
|
||||
};
|
||||
|
||||
let videoTaskRes;
|
||||
if (imageUrls.length > 0) {
|
||||
// 图生视频:使用第一张图片作为参考图
|
||||
videoTaskRes = await api.createImageToVideoTask({
|
||||
...taskParams,
|
||||
imageUrl: imageUrls[0]
|
||||
});
|
||||
} else {
|
||||
// 文生视频
|
||||
videoTaskRes = await api.createTextToVideoTask(taskParams);
|
||||
}
|
||||
|
||||
if (videoTaskRes && videoTaskRes.code === 200 && videoTaskRes.data) {
|
||||
videoTaskId = videoTaskRes.data;
|
||||
console.log('视频生成任务已提交,taskId:', videoTaskId);
|
||||
} else {
|
||||
console.warn('视频任务创建返回异常:', videoTaskRes);
|
||||
}
|
||||
} catch (videoError) {
|
||||
console.error('创建视频任务失败:', videoError);
|
||||
// 视频任务失败不阻断打卡提交,只提示
|
||||
uni.showToast({
|
||||
title: '视频任务创建失败,打卡将继续提交',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
// 等待toast显示
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
}
|
||||
}
|
||||
|
||||
// 更新loading提示
|
||||
uni.showLoading({ title: '提交打卡中...' });
|
||||
|
||||
// 提交打卡
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
const result = await submitCheckin({
|
||||
mealType: this.selectedMealType,
|
||||
date: today,
|
||||
photosJson: JSON.stringify(imageUrls),
|
||||
notes: this.remark,
|
||||
taskId: videoTaskId,
|
||||
enableAIVideo: this.enableAIVideo,
|
||||
enableAIAnalysis: false
|
||||
});
|
||||
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
// 显示成功提示
|
||||
|
||||
const points = result.data?.points || 0;
|
||||
const successMsg = videoTaskId
|
||||
? `打卡成功!视频生成中...`
|
||||
const taskId = result.data?.taskId;
|
||||
const successMsg = (this.enableAIVideo && taskId)
|
||||
? '打卡成功!视频生成中...'
|
||||
: `打卡成功!获得${points}积分`;
|
||||
uni.showToast({
|
||||
title: successMsg,
|
||||
|
||||
Reference in New Issue
Block a user