This commit is contained in:
2022-03-30 19:27:04 +00:00
parent a88b086df2
commit 01651599db

View File

@@ -126,11 +126,15 @@ export default {
this.uploading = true;
this.outputText = null;
try {
let fileType = this.uploadFile.type.toLowerCase();
if (!fileType.includes("csv") && !fileType.includes("json")) {
let fileName = this.uploadFile.name.toLowerCase();
if (!fileName.includes("csv") && !fileName.includes("json")) {
window.$gz.store.commit(
"logItem",
`administration -> import unrecognized import file, name: ${this.uploadFile.name}, type: ${this.uploadFile.type}, size: ${this.uploadFile.size}`
);
throw new Error("Not supported file type, must be .csv or .json");
}
const isCSV = fileType.includes("csv");
const isCSV = fileName.includes("csv");
let dat = null;
if (isCSV) {
let res = await parseCSVFile(this.uploadFile);