修改细节

This commit is contained in:
davy 2025-07-23 15:22:33 +08:00
parent 063c5dd568
commit cb550b6be0

View File

@ -123,10 +123,19 @@
/** 编辑模板 */ /** 编辑模板 */
const editTemplate = async (item: Item) => { const editTemplate = async (item: Item) => {
try { try {
const res = await getEditorToken({ templateId: item.uuid, purpose: 'edit' }); // IDiduuid
const templateId = item.uuid || item.id;
console.log('[editTemplate] 模板数据:', item, '使用templateId:', templateId);
if (!templateId) {
EleMessage.error('模板ID缺失无法编辑');
return;
}
const res = await getEditorToken({ templateId: templateId, purpose: 'edit' });
console.log('[editTemplate] getEditorToken返回:', res); console.log('[editTemplate] getEditorToken返回:', res);
if (res && res.fastPosterUrl && res.editorToken) { if (res && res.fastPosterUrl && res.editorToken) {
const url = `${res.fastPosterUrl}?editorToken=${res.editorToken}`; const url = `${res.fastPosterUrl}?editorToken=${res.editorToken}&templateId=${templateId}`;
console.log('[editTemplate] 跳转URL:', url); console.log('[editTemplate] 跳转URL:', url);
window.location.href = url; window.location.href = url;
} else { } else {