This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user