fix(mindspace): refresh published HTML after workspace sync

Keep online publication snapshots aligned when public/*.html changes, default static page binds to public access with MindSpace delivery URLs, and split browser-safe workspace helpers out of the Vite import chain.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-10 20:44:04 +08:00
parent 7f8d692d16
commit e3063ea806
12 changed files with 279 additions and 110 deletions
+6 -2
View File
@@ -143,7 +143,7 @@ export async function bindWorkspaceHtmlForPageData({
workspaceRoot,
relativePath,
title = null,
accessMode = 'password',
accessMode = 'public',
password = null,
pageDataPolicy = null,
urlSlug = null,
@@ -225,6 +225,7 @@ export async function bindWorkspaceHtmlForPageData({
policy;
}
const workspaceUrl = buildWorkspacePublicUrl(userId, normalized);
return {
pageId: page.id,
pageTitle: page.title,
@@ -233,7 +234,10 @@ export async function bindWorkspaceHtmlForPageData({
publicationAccessMode: publication.accessMode,
publicationPasswordApplied: normalizedAccessMode === 'password',
publicationUrl: publication.publicUrl,
workspaceUrl: buildWorkspacePublicUrl(userId, normalized),
workspaceUrl,
deliveryUrl: workspaceUrl,
deliveryHint:
'向用户交付静态页时优先使用 deliveryUrlMindSpace /MindSpace/<用户ID>/public/... 路径),publicationUrl 仅作补充',
policy,
};
}