fix: not reload for batch add & delete failed imsi length < 15

This commit is contained in:
zhangsz
2025-04-15 16:07:50 +08:00
parent 09b6eb7350
commit e1edf203c9
5 changed files with 123 additions and 67 deletions

View File

@@ -192,7 +192,10 @@ func (s *IMSUserController) Adds(c *gin.Context) {
c.JSON(200, result.ErrMsg(err.Error()))
return
}
// 命令ok时
if strings.Contains(data, "ok") {
s.imsUserService.LoadData(neId, body.IMSI, num)
}
c.JSON(200, result.OkData(data))
}
@@ -206,7 +209,7 @@ func (s *IMSUserController) Edit(c *gin.Context) {
var body model.IMSUser
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil || len(body.IMSI) < model.IMSI_MAX_LENGTH {
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.Tag == model.TAG_VoLTE) {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -246,7 +249,7 @@ func (s *IMSUserController) Remove(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neId := c.Param("neId")
imsi := c.Param("imsi")
if neId == "" || len(imsi) < model.IMSI_MAX_LENGTH {
if neId == "" || imsi == "" {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -297,7 +300,7 @@ func (s *IMSUserController) Removes(c *gin.Context) {
neId := c.Param("neId")
imsi := c.Param("imsi")
num := c.Param("num")
if neId == "" || len(imsi) < model.IMSI_MAX_LENGTH || num == "" {
if neId == "" || imsi == "" || num == "" {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}