Browse Source

体积小

XMLWAN 3 years ago
parent
commit
368e33ffd9
1 changed files with 6 additions and 7 deletions
  1. 6 7
      controllers/xcx_mobile_api_controller.go/xcx_api_controller.go

+ 6 - 7
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

136
 			"info":    info,
136
 			"info":    info,
137
 		})
137
 		})
138
 	} else {
138
 	} else {
139
-		role, errcode := service.GetLoginInfor("18923081560")
139
+		_, errcode := service.GetLoginInfor("18923081560")
140
 		if errcode == gorm.ErrRecordNotFound {
140
 		if errcode == gorm.ErrRecordNotFound {
141
 			role := models.XcxAdminUserRole{
141
 			role := models.XcxAdminUserRole{
142
 				PatientName: info.Name,
142
 				PatientName: info.Name,
154
 			}
154
 			}
155
 			err := service.CreateXcxAdminUser(role)
155
 			err := service.CreateXcxAdminUser(role)
156
 			fmt.Println(err)
156
 			fmt.Println(err)
157
+		} else {
158
+			this.ServeSuccessJSON(map[string]interface{}{
159
+				"is_bind": true,
160
+				"info":    info,
161
+			})
157
 		}
162
 		}
158
-		if err == nil {
159
-			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
160
-			return
161
-		}
162
-
163
 		this.ServeSuccessJSON(map[string]interface{}{
163
 		this.ServeSuccessJSON(map[string]interface{}{
164
-			"role":    role,
165
 			"is_bind": true,
164
 			"is_bind": true,
166
 			"info":    info,
165
 			"info":    info,
167
 		})
166
 		})