Authored by zhaoyue

Merge branch 'zhaoyue-dev4' into 'master'

Zhaoyue dev4



See merge request !64
@@ -63,6 +63,7 @@ public class OpenIdController { @@ -63,6 +63,7 @@ public class OpenIdController {
63 if (user == null) {//用户,密码错误 63 if (user == null) {//用户,密码错误
64 return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.OK); 64 return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.OK);
65 } else { 65 } else {
  66 + xklMemberOpenidRespository.deleteByOpenid(openId);
66 XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findByAccountIdAndType(user.getId(), openIdType); 67 XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findByAccountIdAndType(user.getId(), openIdType);
67 if (xklMemberOpenid == null) { 68 if (xklMemberOpenid == null) {
68 xklMemberOpenid = new XklMemberOpenidEntity(); 69 xklMemberOpenid = new XklMemberOpenidEntity();
@@ -118,7 +119,7 @@ public class OpenIdController { @@ -118,7 +119,7 @@ public class OpenIdController {
118 if (!(boolean) request.getAttribute("signAspect")) 119 if (!(boolean) request.getAttribute("signAspect"))
119 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK); 120 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK);
120 121
121 - XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findByOpenidAndType(openId, openIdType); 122 + XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findOneByOpenidAndType(openId, openIdType);
122 123
123 if (xklMemberOpenid == null) { 124 if (xklMemberOpenid == null) {
124 return new ResponseEntity<>(ResultModel.error(ResultStatus.OPENID_ERROR), HttpStatus.OK); 125 return new ResponseEntity<>(ResultModel.error(ResultStatus.OPENID_ERROR), HttpStatus.OK);
@@ -90,7 +90,7 @@ public class QRCodeController { @@ -90,7 +90,7 @@ public class QRCodeController {
90 if (!(boolean) request.getAttribute("signAspect")) { 90 if (!(boolean) request.getAttribute("signAspect")) {
91 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK); 91 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK);
92 } 92 }
93 - XklMemberOpenidEntity openidEntity = xklMemberOpenidRespository.findByOpenidAndType(openId, openIdType); 93 + XklMemberOpenidEntity openidEntity = xklMemberOpenidRespository.findOneByOpenidAndType(openId, openIdType);
94 // openId 未找到 94 // openId 未找到
95 if (openidEntity == null) { 95 if (openidEntity == null) {
96 return new ResponseEntity<>(ResultModel.ok(ResultStatus.OPENID_ERROR), HttpStatus.OK); 96 return new ResponseEntity<>(ResultModel.ok(ResultStatus.OPENID_ERROR), HttpStatus.OK);
@@ -11,5 +11,8 @@ public interface XklMemberOpenidRespository extends CrudRepository<XklMemberOpen @@ -11,5 +11,8 @@ public interface XklMemberOpenidRespository extends CrudRepository<XklMemberOpen
11 11
12 public XklMemberOpenidEntity findByAccountIdAndTypeAndOpenid(long accountId, int type, String openid); 12 public XklMemberOpenidEntity findByAccountIdAndTypeAndOpenid(long accountId, int type, String openid);
13 13
14 - public XklMemberOpenidEntity findByOpenidAndType(String openid,int type); 14 + public XklMemberOpenidEntity findOneByOpenidAndType(String openid,int type);
  15 +
  16 + public void deleteByOpenid(String openid);
  17 +
15 } 18 }