fix: udm用户异步导入
This commit is contained in:
@@ -591,12 +591,12 @@ func (s *UdmUserApi) UdmAuthUserImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
if strings.HasSuffix(fileHeader.Filename, ".csv") {
|
if strings.HasSuffix(fileHeader.Filename, ".csv") {
|
||||||
data := file.ReadCSVFile(localPath)
|
data := file.ReadCSVFile(localPath)
|
||||||
neId = "-"
|
neId = "-"
|
||||||
s.authUser.InsertCSV(neId, data)
|
go s.authUser.InsertCSV(neId, data)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(fileHeader.Filename, ".txt") {
|
if strings.HasSuffix(fileHeader.Filename, ".txt") {
|
||||||
data := file.ReadTxtFile(localPath)
|
data := file.ReadTxtFile(localPath)
|
||||||
neId = "-"
|
neId = "-"
|
||||||
s.authUser.InsertTxt(neId, data)
|
go s.authUser.InsertTxt(neId, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.JSON(w, 200, result.OkData(data))
|
ctx.JSON(w, 200, result.OkData(data))
|
||||||
@@ -1180,12 +1180,12 @@ func (s *UdmUserApi) UdmSubUserImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
if strings.HasSuffix(fileHeader.Filename, ".csv") {
|
if strings.HasSuffix(fileHeader.Filename, ".csv") {
|
||||||
data := file.ReadCSVFile(localPath)
|
data := file.ReadCSVFile(localPath)
|
||||||
neId = "-"
|
neId = "-"
|
||||||
s.subUser.InsertCSV(neId, data)
|
go s.subUser.InsertCSV(neId, data)
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(fileHeader.Filename, ".txt") {
|
if strings.HasSuffix(fileHeader.Filename, ".txt") {
|
||||||
data := file.ReadTxtFile(localPath)
|
data := file.ReadTxtFile(localPath)
|
||||||
neId = "-"
|
neId = "-"
|
||||||
s.subUser.InsertTxt(neId, data)
|
go s.subUser.InsertTxt(neId, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.JSON(w, 200, result.OkData(data))
|
ctx.JSON(w, 200, result.OkData(data))
|
||||||
|
|||||||
Reference in New Issue
Block a user