Commit 79ef0be5 by wangzhihui

fixed

1 parent c0a88d6a
...@@ -227,7 +227,14 @@ export default { ...@@ -227,7 +227,14 @@ export default {
const data = event.srcElement.files const data = event.srcElement.files
console.log(data[0], data[0].type) console.log(data[0], data[0].type)
if (!/mp3|aac|m4a/i.test(data[0].type)) { if (!data[0] || !data[0].type) {
this.$message.error(`请上传mp3、aac、m4a的录音格式!`)
this.$refs.fileUpload.value = ""
return
}
const allowedTypes = /audio\/mpeg|aac|m4a/i
if (!allowedTypes.test(data[0].type)) {
this.$message.error(`请上传mp3、aac、m4a的录音格式!`) this.$message.error(`请上传mp3、aac、m4a的录音格式!`)
this.$refs.fileUpload.value = "" this.$refs.fileUpload.value = ""
return return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!