Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传图片根据文档配置了,还是报错get upload server address 没有配置上传地址 #16

Open
z4117758 opened this issue Apr 14, 2023 · 0 comments

Comments

@z4117758
Copy link

// 声明编辑器实例,必须用 shallowRef
const editorRefI = shallowRef()
const editorRefII = shallowRef()

const editorConfig: Partial = { // TS 语法
MENU_CONF: { }
}
editorConfig.MENU_CONF['uploadImage'] = {
server: '/api/upload-img',
// server: '/api/upload-img-10s', // test timeout
// server: '/api/upload-img-failed', // test failed
// server: '/api/xxx', // test 404

timeout: 5 * 1000, // 5s

fieldName: 'custom-fileName',
meta: { token: 'xxx', a: 100 },
metaWithUrl: true, // join params to url
headers: { Accept: 'text/x-json' },

maxFileSize: 10 * 1024 * 1024, // 10M

base64LimitSize: 5 * 1024, // insert base64 format, if file's size less than 5kb
}
const handleCreatedI = (editor: any) => {
editor.config = editorConfig
editorRefI.value = editor
};// 记录 editor 实例,重要!
const handleCreatedII = (editor: any) => editorRefII.value = editor;// 记录 editor 实例,重要!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant