forked from wangeditor-team/wangEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.ts
59 lines (43 loc) · 1.17 KB
/
image.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* @description 图片相关的配置
* @author wangfupeng
*/
import { EMPTY_FN } from '../utils/const'
export type UploadImageHooksType = {
before?: Function
success?: Function
fail?: Function
error?: Function
timeout?: Function
customInsert?: Function
}
export default {
// 显示“插入网络图片”
showLinkImg: true,
// 插入图片成功之后的回调函数
linkImgCallback: EMPTY_FN,
// 服务端地址
uploadImgServer: '',
// 使用 base64 存储图片
uploadImgShowBase64: false,
// 上传图片的最大体积,默认 5M
uploadImgMaxSize: 5 * 1024 * 1024,
// 一次最多上传多少个图片
uploadImgMaxLength: 100,
// 自定义上传图片的名称
uploadFileName: '',
// 上传图片自定义参数
uploadImgParams: {},
// 自定义参数拼接到 url 中
uploadImgParamsWithUrl: false,
// 上传图片自定义 header
uploadImgHeaders: {},
// 钩子函数
uploadImgHooks: {},
// 上传图片超时时间 ms
uploadImgTimeout: 10 * 1000,
// 跨域带 cookie
withCredentials: false,
// 自定义上传
customUploadImg: null,
}