|
@@ -136,7 +136,7 @@ func (this *XcxApiController) GetLoginInfor() {
|
136
|
136
|
"info": info,
|
137
|
137
|
})
|
138
|
138
|
} else {
|
139
|
|
- role, errcode := service.GetLoginInfor("18923081560")
|
|
139
|
+ _, errcode := service.GetLoginInfor("18923081560")
|
140
|
140
|
if errcode == gorm.ErrRecordNotFound {
|
141
|
141
|
role := models.XcxAdminUserRole{
|
142
|
142
|
PatientName: info.Name,
|
|
@@ -154,14 +154,13 @@ func (this *XcxApiController) GetLoginInfor() {
|
154
|
154
|
}
|
155
|
155
|
err := service.CreateXcxAdminUser(role)
|
156
|
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
|
163
|
this.ServeSuccessJSON(map[string]interface{}{
|
164
|
|
- "role": role,
|
165
|
164
|
"is_bind": true,
|
166
|
165
|
"info": info,
|
167
|
166
|
})
|