From a840a171131825f9bd507bb6ff6f61723cd244bd Mon Sep 17 00:00:00 2001 From: wangzemei Date: Thu, 18 Dec 2025 16:42:48 +0800 Subject: [PATCH] * [bug#68147] fix the creating doc issues of ai. --- module/doc/js/selectlibtype.ui.js | 6 +++--- www/js/zui3/ai.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/doc/js/selectlibtype.ui.js b/module/doc/js/selectlibtype.ui.js index 4239a9b0ae..e07b097993 100644 --- a/module/doc/js/selectlibtype.ui.js +++ b/module/doc/js/selectlibtype.ui.js @@ -125,9 +125,9 @@ window.reloadApi = function() */ window.redirectParentWindow = function(link, from, spaceID, libID, moduleID) { - if(from === 'ai' && sessionStorage.getItem('aiResult')) + if(from === 'ai' && localStorage.getItem('aiResult')) { - const aiResult = JSON.parse(sessionStorage.getItem('aiResult')); + const aiResult = JSON.parse(localStorage.getItem('aiResult')); zui.DocApp.storeNextCreatingDoc({ content: aiResult.content || '', contentType: 'markdown', @@ -135,7 +135,7 @@ window.redirectParentWindow = function(link, from, spaceID, libID, moduleID) lib: Number(libID), module: Number(moduleID), }); - sessionStorage.removeItem('aiResult'); + localStorage.removeItem('aiResult'); } openUrl(link, 'doc'); } diff --git a/www/js/zui3/ai.js b/www/js/zui3/ai.js index 4a59518225..b876fc4a4e 100644 --- a/www/js/zui3/ai.js +++ b/www/js/zui3/ai.js @@ -171,7 +171,7 @@ window.executeZentaoPrompt = async function(info, testingMode) }; diffView = h`
${info.targetFormName}
${Object.entries(result).map(entry => renderProp(entry[0], entry[1]))}
`; } - sessionStorage.setItem('aiResult', JSON.stringify(result)); + localStorage.setItem('aiResult', JSON.stringify(result)); return { view: [response.title ? h`

${response.title}

` : null, diffView, explainView],