|
@@ -88,16 +88,21 @@ public class GzptUserInfoServiceImpl extends ServiceImpl<GzptUserInfoMapper, Gzp
|
|
|
public Response bindGzptUserOpenid(GzptUserInfoBindDTO userInfoBindDTO) {
|
|
|
|
|
|
GzptUserLoginDTO userLoginDto = new GzptUserLoginDTO();
|
|
|
- String passMd5 = MD5Utils.MD5Encode(userInfoBindDTO.getPassword());
|
|
|
- userInfoBindDTO.setPassword(passMd5);
|
|
|
BeanUtils.copyProperties(userInfoBindDTO,userLoginDto);
|
|
|
+ int userInfoExist = mapper.getUserInfoCountByOpenid(userInfoBindDTO.getOpenid()); //微信是否已绑定
|
|
|
+
|
|
|
+ if(userInfoExist>0) {
|
|
|
+ Response response = new Response(50004,"该微信已绑定过学员,请解绑后再次绑定。");
|
|
|
+ return response;
|
|
|
+ }
|
|
|
+
|
|
|
GzptUserInfo gzptUserInfo = mapper.getUserByLoginCodeAndPw(userLoginDto); //查询帐号是否绑定过
|
|
|
if(gzptUserInfo!=null) {
|
|
|
if(!StringUtils.isEmpty(gzptUserInfo.getOpenId())) {
|
|
|
Response response = new Response(50002,"该学员账号已绑定微信,请解绑后再次绑定。");
|
|
|
return response;
|
|
|
}
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
Response response = new Response(50003,"用户不存在或用户密码错误");
|
|
|
return response;
|
|
|
}
|
|
@@ -116,8 +121,6 @@ public class GzptUserInfoServiceImpl extends ServiceImpl<GzptUserInfoMapper, Gzp
|
|
|
public Response unBindGzptUserOpenid(GzptUserLoginDTO userLoginDTO) {
|
|
|
|
|
|
GzptUserInfoBindDTO userInfoBindDTO = new GzptUserInfoBindDTO();
|
|
|
- String passMd5 = MD5Utils.MD5Encode(userLoginDTO.getPassword());
|
|
|
- userLoginDTO.setPassword(passMd5);
|
|
|
BeanUtils.copyProperties(userLoginDTO,userInfoBindDTO);
|
|
|
GzptUserInfo gzptUserInfo = mapper.getUserByLoginCodeAndPw(userLoginDTO); //查询帐号是否绑定过
|
|
|
if(gzptUserInfo==null) {
|