fix(plugin-block-markdown): update vditor path for client-v2 (#9440)

* fix(plugin-block-markdown): update vditor path for client-v2

* fix: markdown plugin assets url bug

---------

Co-authored-by: PiEgg <marksz@teamsz.xyz>
This commit is contained in:
Zeke Zhang
2026-05-12 10:51:17 +08:00
committed by GitHub
parent 0e28f0087e
commit 9d815be424
2 changed files with 4 additions and 1 deletions
@@ -338,6 +338,7 @@ export class Gateway extends EventEmitter {
private getV2RuntimeConfig() {
return {
__nocobase_public_path__: this.getV2PublicPath(),
__webpack_public_path__: process.env.CDN_BASE_URL ? `${process.env.CDN_BASE_URL.replace(/\/+$/, '')}/` : '',
__nocobase_api_base_url__: process.env.API_BASE_URL || process.env.API_BASE_PATH,
__nocobase_api_client_storage_prefix__: process.env.API_CLIENT_STORAGE_PREFIX,
__nocobase_api_client_storage_type__: process.env.API_CLIENT_STORAGE_TYPE,
@@ -20,7 +20,9 @@ export class PluginBlockMarkdownClient extends Plugin {
getCDN() {
if (process.env.NODE_ENV === 'production') {
return this.app.getPublicPath() + 'static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor';
// @ts-ignore 这里需要同时兼容有 CDN_BASE_URL 和没有 CDN_BASE_URL 的情况
const base = window['__webpack_public_path__'] || this.app.getPublicPath().replace(/\/v2\/?$/, '/');
return `${base}static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor`;
}
return `https://cdn.jsdelivr.net/npm/vditor@3.11.2`;
}