|
@@ -398,6 +398,7 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
@@ -398,6 +398,7 @@ func (controller *SuMoneyController) ImportExchangeList () { |
398
|
operator, _ := controller.GetInt64("operator")
|
398
|
operator, _ := controller.GetInt64("operator")
|
399
|
file, h, _ := controller.GetFile("file") //获取上传的文件
|
399
|
file, h, _ := controller.GetFile("file") //获取上传的文件
|
400
|
ext := path.Ext(h.Filename)
|
400
|
ext := path.Ext(h.Filename)
|
|
|
401
|
+ // 文件后缀名校验
|
401
|
AllowExtMap := map[string]bool{
|
402
|
AllowExtMap := map[string]bool{
|
402
|
".xlsx":true,
|
403
|
".xlsx":true,
|
403
|
}
|
404
|
}
|
|
@@ -410,7 +411,7 @@ func (controller *SuMoneyController) ImportExchangeList () { |
|
@@ -410,7 +411,7 @@ func (controller *SuMoneyController) ImportExchangeList () { |
410
|
fmt.Println(err)
|
411
|
fmt.Println(err)
|
411
|
return
|
412
|
return
|
412
|
}
|
413
|
}
|
413
|
- // TODO 增加非空校验,导入失败原因返回
|
414
|
+ // 记录非空校验
|
414
|
var response utils.JsonResponse
|
415
|
var response utils.JsonResponse
|
415
|
dataList := make([]interface{}, 0)
|
416
|
dataList := make([]interface{}, 0)
|
416
|
rows, _ := xlsx.GetRows("Sheet1")
|
417
|
rows, _ := xlsx.GetRows("Sheet1")
|