Commit 7f070d45a9732f9c73bfb74d895491954048728d
1 parent
730c5544
add file accepts
Showing
2 changed files
with
7 additions
and
3 deletions
src/html/index.html
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | <el-input v-model.trim="form.name" :maxlength="50" placeholder="请输入联系人姓名"></el-input> |
| 63 | 63 | </el-form-item> |
| 64 | 64 | <el-form-item :label="labels.audioFile" class="diy-flex-100" prop="audioFile"> |
| 65 | - <el-upload class="upload-demo" :action="uploadUrl" :auto-upload="false" :file-list="fileList" accept=".mp3" | |
| 65 | + <el-upload class="upload-demo" :action="uploadUrl" :auto-upload="false" :file-list="fileList" accept=".mp3, .flac, .ogg, .wav" | |
| 66 | 66 | @change="getMp3" :on-exceed="exceed" :before-remove="handleRemove" :disabled="btnDisabled" :show-file-list="false"> |
| 67 | 67 | <el-button size="small" type="primary" :disabled="btnDisabled" class="diy-button width-190 bg-blue">选择文件</el-button> |
| 68 | 68 | <span class="diy-danger">{{msgText}}</span> | ... | ... |
src/js/audios.js
| ... | ... | @@ -357,8 +357,8 @@ const Audio = { |
| 357 | 357 | .then((res) => { |
| 358 | 358 | if (res.data) { |
| 359 | 359 | setTimeout(() => { |
| 360 | - console.log("jump"); | |
| 361 | - // window.location.replace("./success.html"); | |
| 360 | + // console.log("jump"); | |
| 361 | + window.location.replace("./success.html"); | |
| 362 | 362 | }, 1000); |
| 363 | 363 | } else { |
| 364 | 364 | setTimeout(() => { |
| ... | ... | @@ -369,6 +369,10 @@ const Audio = { |
| 369 | 369 | }) |
| 370 | 370 | .catch((error) => { |
| 371 | 371 | console.log(error); |
| 372 | + setTimeout(() => { | |
| 373 | + // console.log("jump"); | |
| 374 | + window.location.replace("./failed.html"); | |
| 375 | + }, 1000); | |
| 372 | 376 | }) |
| 373 | 377 | .finally(() => { |
| 374 | 378 | this.btnDisabled = false; | ... | ... |