XMLWAN 3 lat temu
rodzic
commit
fe5fad57cb

+ 5 - 7
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go Wyświetl plik

@@ -102,24 +102,22 @@ func (this *XcxApiController) GetUserRegister() {
102 102
 					"msg":     "绑定失败",
103 103
 				})
104 104
 			}
105
-			mobilePatient, _ := service.GetMobilePatient(id_card_no)
106 105
 			this.ServeSuccessJSON(map[string]interface{}{
107
-				"role":          role,
108
-				"mobilePatient": mobilePatient,
106
+				"role": role,
109 107
 			})
110 108
 
111 109
 		} else if errcode == gorm.ErrRecordNotFound {
112
-
110
+			mobilePatient, _ := service.GetMobilePatient(id_card_no)
113 111
 			this.ServeSuccessJSON(map[string]interface{}{
114
-				"is_bind": false,
112
+				"is_bind": true,
113
+				"patient": mobilePatient,
115 114
 			})
116 115
 		}
117 116
 
118 117
 		fmt.Println("roler", role)
119
-	} else if errcodes == nil {
118
+	} else if errcodes == gorm.ErrRecordNotFound {
120 119
 		this.ServeSuccessJSON(map[string]interface{}{
121 120
 			"is_bind": false,
122
-			"patient": patient,
123 121
 		})
124 122
 	}
125 123