mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-01 14:57:36 +08:00
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:
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user