Commit 07e8dea8 by lixinming

no message

parent 6fe23631
...@@ -31,7 +31,8 @@ export function getDefPwd(phone:string) { ...@@ -31,7 +31,8 @@ export function getDefPwd(phone:string) {
export function getFileType(fileName) { export function getFileType(fileName) {
let fileType = 0; let fileType = 0;
fileName.forEach(info => { fileName.forEach(info => {
let type = info.split("_")[1]; let repList = info.split(".");
let type = repList[repList.length-1];
if (!type) throw new BizError(ERRORENUM.文件不存在, `文件名 ${info}`); if (!type) throw new BizError(ERRORENUM.文件不存在, `文件名 ${info}`);
let typeNum = 0; let typeNum = 0;
switch(type) { switch(type) {
...@@ -43,8 +44,8 @@ export function getFileType(fileName) { ...@@ -43,8 +44,8 @@ export function getFileType(fileName) {
}; };
if (typeNum) { if (typeNum) {
if (!fileType) fileType = typeNum; if (!fileType) fileType = typeNum;
else if (fileType != typeNum) fileType = FILETYPE.多类型 else if (fileType != typeNum) fileType = FILETYPE.多类型;
} }
}); });
return fileType return fileType;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment