From 1ad73b062577cfbc9943cd1875c86a7d58a8b773 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 15 Apr 2023 16:37:11 +0800 Subject: [PATCH] =?UTF-8?q?REVIEW=20=E7=B4=A0=E6=9D=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit abf9b50c2f9a4ceb19066b7e722336a7bff05759) --- src/views/mp/components/img.png | Bin 15404 -> 0 bytes .../{Waterfall.vue => ImageTable.vue} | 0 .../components/{Upload.vue => UploadFile.vue} | 3 -- .../mp/material/components/UploadVideo.vue | 2 - .../mp/material/components/VideoTable.vue | 2 - .../mp/material/components/VoiceTable.vue | 2 - src/views/mp/material/components/upload.ts | 16 ++++---- src/views/mp/material/index.vue | 37 +++++++----------- 8 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 src/views/mp/components/img.png rename src/views/mp/material/components/{Waterfall.vue => ImageTable.vue} (100%) rename src/views/mp/material/components/{Upload.vue => UploadFile.vue} (98%) diff --git a/src/views/mp/components/img.png b/src/views/mp/components/img.png deleted file mode 100644 index c25a6e762f3a84c5a7f05c6383de843937725fcf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15404 zcmcJ0Wn5HU_^k>ef`9@70*a!55(CmDf*>lXv@i%F-7s{gG$I`{AnnjKz(@(wF_iSs zG2|dEeGkU#i|_y5`@0|R2S0c?bM}e7*R!6r)(&_s_k@Umn&8ZtGepmxN+_H;bG94! zM~Qz9IO2MFLGR2Np^aw}VoDCLR$$JMk$%MdhAav_g4%70lJy~Z!TIz(xzUTXy9zG; z;UB~3jfUTA1-QB_Uc>A~Jz1LDpwoAun z%(ZbQ8eg43TomPC$m6M53mbGc^RQd*ox*F_iWiQc6^~!R7PIfzB`$+lLA5W0^2VKx z_epLLoqsk-0Y?vg(v%Ln(7U#`GJ1G8S`p=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sf_w+gs+*IF=D6->#3Ay1Td>s&9ZyG+JW?WBz2G>>Q@R%;40U>D#)n zHW3CTtZBE7O18i9m0sHd)B`ynR&tj&2`2xv6B+z%U4}qbv_-{7xdD9@ue9#%(>li85|m?P^R31mwp+`b}1+U z?ESYR`qB{C`?Lh8mrN+-hocSg-E~MO1{3YEXTTm$d0_|^_;rU=AcSo-nXPi&*|2E@ z>Eq5;1zCC$=y<%nJMz$FN#(QY*qU`7&17qS9rA0MekZVkm{3rfut&WcTdh;3VMvS8 z(pV)r4Of*Ms3RijYDD8_B>9(0cXzuLsr3BOV-gAh+}Q1o=3-zM@R?_i - - - diff --git a/src/views/mp/material/components/UploadVideo.vue b/src/views/mp/material/components/UploadVideo.vue index 5da7d980..816711d1 100644 --- a/src/views/mp/material/components/UploadVideo.vue +++ b/src/views/mp/material/components/UploadVideo.vue @@ -123,5 +123,3 @@ const handleUploadSuccess: UploadProps['onSuccess'] = (res: any) => { emit('uploaded') } - - diff --git a/src/views/mp/material/components/VideoTable.vue b/src/views/mp/material/components/VideoTable.vue index 3bd2fe00..81472959 100644 --- a/src/views/mp/material/components/VideoTable.vue +++ b/src/views/mp/material/components/VideoTable.vue @@ -57,5 +57,3 @@ const handleDownload = (url: string) => { window.open(url, '_blank') } - - diff --git a/src/views/mp/material/components/VoiceTable.vue b/src/views/mp/material/components/VoiceTable.vue index 44bd01da..6f37e1a0 100644 --- a/src/views/mp/material/components/VoiceTable.vue +++ b/src/views/mp/material/components/VoiceTable.vue @@ -49,5 +49,3 @@ const emit = defineEmits<{ (e: 'delete', v: number) }>() - - diff --git a/src/views/mp/material/components/upload.ts b/src/views/mp/material/components/upload.ts index 37441f5b..239665a2 100644 --- a/src/views/mp/material/components/upload.ts +++ b/src/views/mp/material/components/upload.ts @@ -1,10 +1,9 @@ import type { UploadProps, UploadRawFile } from 'element-plus' import { getAccessToken } from '@/utils/auth' - -const message = useMessage() - -const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } -const UPLOAD_URL = 'http://127.0.0.1:8000/upload/' //import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' +const message = useMessage() // 消息 +const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } // 请求头 +// const UPLOAD_URL = 'http://127.0.0.1:8000/upload/' // 上传地址 +const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传地址 enum MaterialType { Image = 'image', @@ -22,7 +21,6 @@ const beforeUpload = (rawFile: UploadRawFile, materialType: MaterialType): boole let allowTypes: string[] = [] let maxSizeMB = 0 let name = '' - switch (materialType) { case MaterialType.Image: allowTypes = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/jpg'] @@ -38,18 +36,18 @@ const beforeUpload = (rawFile: UploadRawFile, materialType: MaterialType): boole allowTypes = ['video/mp4'] maxSizeMB = 10 name = '视频' + break } - + // 格式不正确 if (!allowTypes.includes(rawFile.type)) { message.error(`上传${name}格式不对!`) return false } - + // 大小不正确 if (rawFile.size / 1024 / 1024 > maxSizeMB) { message.error(`上传${name}大小不能超过${maxSizeMB}M!`) return false } - return true } diff --git a/src/views/mp/material/index.vue b/src/views/mp/material/index.vue index 40c03968..54bf488f 100644 --- a/src/views/mp/material/index.vue +++ b/src/views/mp/material/index.vue @@ -15,14 +15,15 @@ - 支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M - - + + + 语音 - 格式支持 mp3/wma/wav/amr,文件大小不超过 2M,播放长度不超过 60s - - + @@ -70,7 +70,6 @@ > - @@ -84,21 +83,18 @@ - - -