download file in the correct format

This commit is contained in:
supertiger1234 2020-01-31 10:22:47 +00:00
parent 02f677a170
commit d3013fa1e9

View file

@ -286,7 +286,7 @@ export default {
const filetypes = /jpeg|jpg|gif|png/;
const extname = filetypes.test(path.extname(file.fileName).toLowerCase());
if (!extname) return undefined;
return config.domain + "/media/" + file.fileID;
return config.domain + "/media/" + file.fileID + "/" + file.fileName;
},
getFile() {
if (!this.$props.files || this.$props.files.length === 0)
@ -296,7 +296,7 @@ export default {
const filetypes = /jpeg|jpg|gif|png/;
const extname = filetypes.test(path.extname(file.fileName).toLowerCase());
if (extname) return undefined;
file.url = config.domain + "/files/" + file.fileID;
file.url = config.domain + "/files/" + file.fileID + "/" + file.fileName;
return file;
},
getDate() {