123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //文件上传格式
- export const ACCEPT_CONFIG = {
- image: [".png", ".jpg", ".jpeg"], // ".gif", ".bmp"
- client: [".exe"],
- app: [".apk"],
- audio: [".mp3", ".wav"],
- video: [".mp4", ".flv"],
- document: [".doc", ".docx", ".ppt", ".pptx", ".pdf"],
- // ".class", ".dsc",
- documentClass: [".doc", ".docx", ".ppt", ".pptx", ".pdf"],
- zipFile: [".zip", ".rar"],
- getPreview() {
- return [...this.document, ...this.image, ...this.audio, ...this.video];
- },
- getAll() {
- return [
- ...this.image,
- ...this.video,
- ...this.document,
- ...this.audio,
- ...this.documentClass,
- ...this.zipFile
- ];
- },
- getClient() {
- return [...this.client];
- },
- getApp() {
- return [...this.app];
- },
- getImg() {
- return [...this.image];
- },
- getAudio() {
- return [...this.audio];
- },
- getVideo() {
- return [...this.video];
- },
- getDocument() {
- return [...this.document];
- },
- getDocumentClass() {
- return [...this.documentClass];
- },
- getZipFile() {
- return [...this.zipFile];
- }
- };
- //定义分片大小
- export const CHUNK_SIZE = {
- chunkSize: 5 * 1024 * 1024,
- getSize() {
- return this.chunkSize;
- }
- };
- export const CONFIG_SUFFIX = {
- image: ["png", "jpg", "jpeg"], // "gif", "bmp"
- audio: ["mp3", "wav"],
- app: ["apk"],
- video: ["mp4", "flv"],
- document: ["doc", "docx", "ppt", "pptx", "pdf"],
- documentClass: ["class", "dsc", "doc", "docx", "ppt", "pptx", "pdf"],
- zipFile: ["zip", "rar"],
- getApp() {
- return [...this.app];
- },
- getImg() {
- return [...this.image];
- },
- getAudio() {
- return [...this.audio];
- },
- getVideo() {
- return [...this.video];
- },
- getDocument() {
- return [...this.document];
- },
- getDocumentClass() {
- return [...this.documentClass];
- },
- getZipFile() {
- return [...this.zipFile];
- }
- };
- //教材上传封面格式
- export const MATERIAL_IMG_SUFFIX = {
- image: ["png", "jpg", "jpeg"],
- getImg() {
- return [...this.image];
- }
- };
|