File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,15 @@ func register(c *gin.Context) {
5252 Email : obj .Email ,
5353 PhoneNumber : obj .PhoneNumber ,
5454 })
55+ if err != nil {
56+ c .JSON (http .StatusOK , gin.H {
57+ "result" : gin.H {
58+ "code" : errorcode .ServerInternalNetworkError ,
59+ "msg" : err .Error (),
60+ },
61+ })
62+ return
63+ }
5564 if ret .Result .Code != errorcode .Success {
5665 c .JSON (http .StatusOK , gin.H {
5766 "result" : gin.H {
@@ -96,6 +105,15 @@ func login(c *gin.Context) {
96105 Username : obj .Username ,
97106 Password : obj .Password ,
98107 })
108+ if err != nil {
109+ c .JSON (http .StatusOK , gin.H {
110+ "result" : gin.H {
111+ "code" : errorcode .ServerInternalNetworkError ,
112+ "msg" : err .Error (),
113+ },
114+ })
115+ return
116+ }
99117 if ret .Result .Code != errorcode .Success {
100118 c .JSON (http .StatusOK , gin.H {
101119 "result" : gin.H {
You can’t perform that action at this time.
0 commit comments