From cb550b6be0406452ceef2855ac0a1c19df99aebf Mon Sep 17 00:00:00 2001 From: davy Date: Wed, 23 Jul 2025 15:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/template/beer/index.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/views/template/beer/index.vue b/src/views/template/beer/index.vue index 1c3fe66..9e6325a 100644 --- a/src/views/template/beer/index.vue +++ b/src/views/template/beer/index.vue @@ -123,10 +123,19 @@ /** 编辑模板 */ const editTemplate = async (item: Item) => { try { - const res = await getEditorToken({ templateId: item.uuid, purpose: 'edit' }); + // 确保传递正确的模板ID,支持id和uuid字段 + 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); 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); window.location.href = url; } else {