Browse Source

短视频小程序BUG修复

半月无霜 4 years ago
parent
commit
8be0845173

+ 6 - 9
ymall/src/main/java/com/liangjian11/ymall/controller/common/LoginController.java

@@ -195,8 +195,12 @@ public class LoginController {
 			}};
 			}};
 			UserAccount userAccount = uaService.getAccountByCookie(id);
 			UserAccount userAccount = uaService.getAccountByCookie(id);
 			List<Doctor> doctorList = doctorMapper.selectList(wrapperD);
 			List<Doctor> doctorList = doctorMapper.selectList(wrapperD);
-			
+			userAccount.setMobile(enPhone);
+			JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(userAccount));
+			jsonObject.put("userRoles", new LinkedList<>());
+
 			if(doctorList.size()>0){
 			if(doctorList.size()>0){
+				jsonObject.put("userRoles", new LinkedList<Integer>(){{ add(1); }});
 				UpdateWrapper<UserAccount> wp = new UpdateWrapper<>();
 				UpdateWrapper<UserAccount> wp = new UpdateWrapper<>();
 				wp.setSql("mobile = null ");
 				wp.setSql("mobile = null ");
 				wp.eq("mobile", enPhone);
 				wp.eq("mobile", enPhone);
@@ -223,18 +227,11 @@ public class LoginController {
 			wrapper.eq("id::text", id);
 			wrapper.eq("id::text", id);
 			uaService.update(account, wrapper);
 			uaService.update(account, wrapper);
 			
 			
-			userAccount.setMobile(enPhone);
-			return ResultUtil.createSuccess("成功", userAccount);
+			return ResultUtil.createSuccess("绑定成功", jsonObject);
 		} catch (Exception e) {
 		} catch (Exception e) {
 			logger.error("小程序手机认证失败", e);
 			logger.error("小程序手机认证失败", e);
 			return ResultUtil.createFail("服务器繁忙,请稍后再试!");
 			return ResultUtil.createFail("服务器繁忙,请稍后再试!");
 		}
 		}
-		
-		
-		
 	}
 	}
-	
-	
-	
 
 
 }
 }