This commit is contained in:
@@ -126,11 +126,15 @@ export default {
|
|||||||
this.uploading = true;
|
this.uploading = true;
|
||||||
this.outputText = null;
|
this.outputText = null;
|
||||||
try {
|
try {
|
||||||
let fileType = this.uploadFile.type.toLowerCase();
|
let fileName = this.uploadFile.name.toLowerCase();
|
||||||
if (!fileType.includes("csv") && !fileType.includes("json")) {
|
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");
|
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;
|
let dat = null;
|
||||||
if (isCSV) {
|
if (isCSV) {
|
||||||
let res = await parseCSVFile(this.uploadFile);
|
let res = await parseCSVFile(this.uploadFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user