fix: 修复上传文件时检查没有同步返回的bug

This commit is contained in:
Captain.B 2021-03-16 19:12:42 +08:00
parent af2dbf2994
commit e21f3c8d40
1 changed files with 3 additions and 2 deletions

View File

@ -199,7 +199,7 @@ export default {
});
},
beforeUploadFile(file) {
async beforeUploadFile(file) {
if (!this.fileValidator(file)) {
/// todo:
return false;
@ -215,7 +215,8 @@ export default {
async function f() {
return await axios.post('/performance/file/' + getCurrentProjectID() + '/getMetadataByName', {filename: file.name})
}
f().then(res => {
await f().then(res => {
let response = res.data;
if (response.data.length === 0) {
let type = file.name.substring(file.name.lastIndexOf(".") + 1);