fix: UDM导入文件后缀
This commit is contained in:
@@ -519,8 +519,15 @@ func (s *UdmUserApi) UdmAuthUserImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取文件名
|
||||||
|
_, fileHeader, err := r.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
ctx.JSON(w, 200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("OMC_AUTH_USER_IMPORT_%s_%d.csv", neId, time.Now().UnixMilli())
|
fileName := fmt.Sprintf("OMC_AUTH_USER_IMPORT_%s_%s", neId, fileHeader.Filename)
|
||||||
filePath := fmt.Sprintf("%s/upload/mml/%s", conf.Get("ne.omcdir"), fileName)
|
filePath := fmt.Sprintf("%s/upload/mml/%s", conf.Get("ne.omcdir"), fileName)
|
||||||
dstPath := conf.Get("mml.upload").(string)
|
dstPath := conf.Get("mml.upload").(string)
|
||||||
// 输出保存文件
|
// 输出保存文件
|
||||||
@@ -1037,8 +1044,15 @@ func (s *UdmUserApi) UdmSubUserImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取文件名
|
||||||
|
_, fileHeader, err := r.FormFile("file")
|
||||||
|
if err != nil {
|
||||||
|
ctx.JSON(w, 200, result.ErrMsg(err.Error()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 文件名
|
// 文件名
|
||||||
fileName := fmt.Sprintf("OMC_SUB_USER_IMPORT_%s_%d.csv", neId, time.Now().UnixMilli())
|
fileName := fmt.Sprintf("OMC_SUB_USER_IMPORT_%s_%s", neId, fileHeader.Filename)
|
||||||
filePath := fmt.Sprintf("%s/upload/mml/%s", conf.Get("ne.omcdir"), fileName)
|
filePath := fmt.Sprintf("%s/upload/mml/%s", conf.Get("ne.omcdir"), fileName)
|
||||||
dstPath := conf.Get("mml.upload").(string)
|
dstPath := conf.Get("mml.upload").(string)
|
||||||
// 输出保存文件
|
// 输出保存文件
|
||||||
|
|||||||
Reference in New Issue
Block a user