Browse Source

体积小

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

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

94
 		if errcode == gorm.ErrRecordNotFound {
94
 		if errcode == gorm.ErrRecordNotFound {
95
 			err := service.CreateXcxAdminUser(role)
95
 			err := service.CreateXcxAdminUser(role)
96
 			if err == nil {
96
 			if err == nil {
97
-				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
98
-				return
97
+				mobilePatient, _ := service.GetMobilePatient(id_card_no)
98
+				this.ServeSuccessJSON(map[string]interface{}{
99
+					"role":    role,
100
+					"is_bind": true,
101
+					"patient": mobilePatient,
102
+				})
99
 			} else {
103
 			} else {
100
 				this.ServeSuccessJSON(map[string]interface{}{
104
 				this.ServeSuccessJSON(map[string]interface{}{
101
 					"is_bind": false,
105
 					"is_bind": false,
102
 					"msg":     "绑定失败",
106
 					"msg":     "绑定失败",
103
 				})
107
 				})
104
 			}
108
 			}
105
-			this.ServeSuccessJSON(map[string]interface{}{
106
-				"role": role,
107
-			})
108
-
109
 		} else if errcode == nil {
109
 		} else if errcode == nil {
110
 			mobilePatient, _ := service.GetMobilePatient(id_card_no)
110
 			mobilePatient, _ := service.GetMobilePatient(id_card_no)
111
 			this.ServeSuccessJSON(map[string]interface{}{
111
 			this.ServeSuccessJSON(map[string]interface{}{