From 844bd2c00b417982ba504d0e2fef8a605ad8c808 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期四, 09 七月 2020 17:04:29 +0800 Subject: [PATCH] add ret msg and fix plateNos is nil --- controllers/restriction.go | 2 +- service/userService.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/restriction.go b/controllers/restriction.go index bfa6110..37ede7b 100644 --- a/controllers/restriction.go +++ b/controllers/restriction.go @@ -32,7 +32,7 @@ } else { resp.Success= false resp.Status= http.StatusBadRequest - resp.Data= nil + resp.Data= "鏁版嵁璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯" } c.Data["json"] = resp c.ServeJSON() diff --git a/service/userService.go b/service/userService.go index b93ba6c..f3a7337 100644 --- a/service/userService.go +++ b/service/userService.go @@ -39,7 +39,7 @@ } } else { //鐢ㄦ埛宸插瓨鍦� var userCar models.UserCar - var plateNos []string + var plateNos = make([]string, 0) all, e := userCar.GetByUserId(tmpUser.Id) if e == nil && all != nil { for _,up := range all { -- Gitblit v1.8.0