[change] importer

This commit is contained in:
Max 2022-11-17 10:02:50 +08:00
parent db341092b2
commit 67e4581f11

View file

@ -59,10 +59,11 @@ func Open(name string) from.Source {
ext := strings.ToLower(strings.TrimPrefix(filepath.Ext(name), ".")) ext := strings.ToLower(strings.TrimPrefix(filepath.Ext(name), "."))
switch ext { switch ext {
case "xlsx": case "xlsx":
fullpath := name // fullpath := name
if !strings.HasPrefix(fullpath, "/") { fullpath := filepath.Join(xfs.Stor.Root, name)
fullpath = filepath.Join(xfs.Stor.Root, name) // if !strings.HasPrefix(fullpath, "/") {
} // fullpath = filepath.Join(xfs.Stor.Root, name)
// }
return xlsx.Open(fullpath) return xlsx.Open(fullpath)
} }
exception.New("暂不支持: %s 文件导入", 400, ext).Throw() exception.New("暂不支持: %s 文件导入", 400, ext).Throw()