diff --git a/src/modules/network_element/controller/udm_auth.go b/src/modules/network_element/controller/udm_auth.go index a3e55965..d1acc52e 100644 --- a/src/modules/network_element/controller/udm_auth.go +++ b/src/modules/network_element/controller/udm_auth.go @@ -76,7 +76,7 @@ func (s *UDMAuthController) Info(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -134,7 +134,7 @@ func (s *UDMAuthController) Add(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -177,7 +177,7 @@ func (s *UDMAuthController) Adds(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -219,7 +219,7 @@ func (s *UDMAuthController) Edit(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -268,7 +268,7 @@ func (s *UDMAuthController) Remove(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -305,7 +305,7 @@ func (s *UDMAuthController) Removes(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -414,7 +414,7 @@ func (s *UDMAuthController) Import(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } diff --git a/src/modules/network_element/controller/udm_sub.go b/src/modules/network_element/controller/udm_sub.go index dce70634..df738622 100644 --- a/src/modules/network_element/controller/udm_sub.go +++ b/src/modules/network_element/controller/udm_sub.go @@ -77,7 +77,7 @@ func (s *UDMSubController) Info(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -158,7 +158,7 @@ func (s *UDMSubController) Add(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -206,7 +206,7 @@ func (s *UDMSubController) Adds(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -253,7 +253,7 @@ func (s *UDMSubController) Edit(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -344,7 +344,7 @@ func (s *UDMSubController) Remove(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -381,7 +381,7 @@ func (s *UDMSubController) Removes(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } @@ -492,7 +492,7 @@ func (s *UDMSubController) Import(c *gin.Context) { // 查询网元获取IP neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId) if neInfo.NeId != neId || neInfo.IP == "" { - c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo"))) + c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo"))) return } diff --git a/src/modules/network_element/service/udm_auth.impl.go b/src/modules/network_element/service/udm_auth.impl.go index 7d6cd519..ed7cc4ab 100644 --- a/src/modules/network_element/service/udm_auth.impl.go +++ b/src/modules/network_element/service/udm_auth.impl.go @@ -40,10 +40,8 @@ func (r *UDMAuthImpl) authDataByRedis(imsi, neID string) []model.UDMAuth { continue } - status := "0" - if _, ok := m["auth_success"]; ok { - status = "1" - } + status := "1" // 默认给1 + amf := "" if v, ok := m["amf"]; ok { amf = strings.Replace(v, "\r\n", "", 1)