mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:46:00 +00:00
fix(vditor): file collection is not empty
This commit is contained in:
parent
674093e84c
commit
97d9136230
@ -18,7 +18,7 @@ export const Edit = withDynamicSchemaProps((props) => {
|
||||
const { wrapSSR, hashId, componentCls: containerClassName } = useStyle();
|
||||
|
||||
useEffect(() => {
|
||||
const uploadFileCollection = fileCollection ?? 'attachments';
|
||||
const uploadFileCollection = fileCollection || 'attachments';
|
||||
const toolbarConfig = toolbar ?? defaultToolbar;
|
||||
const vditor = new Vditor(containerRef.current, {
|
||||
value: value ?? '',
|
||||
@ -51,7 +51,7 @@ export const Edit = withDynamicSchemaProps((props) => {
|
||||
onChange(value);
|
||||
},
|
||||
upload: {
|
||||
url: app.getApiUrl(`${uploadFileCollection ?? 'attachments'}:create`),
|
||||
url: app.getApiUrl(`${uploadFileCollection}:create`),
|
||||
headers: apiClient.getHeaders(),
|
||||
multiple: false,
|
||||
fieldName: 'file',
|
||||
|
@ -16,7 +16,7 @@ export class PluginFieldMarkdownVditorClient extends Plugin {
|
||||
getCDN() {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// 开发模式下使用远程 cdn
|
||||
return 'https://cdn.jsdelivr.net/npm/vditor@3.10.4';
|
||||
return 'https://unpkg.com/vditor@3.10.4';
|
||||
}
|
||||
// 生产环境,使用本地链接,支持内网
|
||||
// 需要支持子目录,比如应用部署在 /xxx/ 目录下
|
||||
|
Loading…
Reference in New Issue
Block a user