Authored by zhaoyue

Merge branch 'zhaoyue-dev4' into 'master'

Zhaoyue dev4



See merge request !64
... ... @@ -63,6 +63,7 @@ public class OpenIdController {
if (user == null) {//用户,密码错误
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.OK);
} else {
xklMemberOpenidRespository.deleteByOpenid(openId);
XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findByAccountIdAndType(user.getId(), openIdType);
if (xklMemberOpenid == null) {
xklMemberOpenid = new XklMemberOpenidEntity();
... ... @@ -118,7 +119,7 @@ public class OpenIdController {
if (!(boolean) request.getAttribute("signAspect"))
return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK);
XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findByOpenidAndType(openId, openIdType);
XklMemberOpenidEntity xklMemberOpenid = xklMemberOpenidRespository.findOneByOpenidAndType(openId, openIdType);
if (xklMemberOpenid == null) {
return new ResponseEntity<>(ResultModel.error(ResultStatus.OPENID_ERROR), HttpStatus.OK);
... ...
... ... @@ -90,7 +90,7 @@ public class QRCodeController {
if (!(boolean) request.getAttribute("signAspect")) {
return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK);
}
XklMemberOpenidEntity openidEntity = xklMemberOpenidRespository.findByOpenidAndType(openId, openIdType);
XklMemberOpenidEntity openidEntity = xklMemberOpenidRespository.findOneByOpenidAndType(openId, openIdType);
// openId 未找到
if (openidEntity == null) {
return new ResponseEntity<>(ResultModel.ok(ResultStatus.OPENID_ERROR), HttpStatus.OK);
... ...
... ... @@ -11,5 +11,8 @@ public interface XklMemberOpenidRespository extends CrudRepository<XklMemberOpen
public XklMemberOpenidEntity findByAccountIdAndTypeAndOpenid(long accountId, int type, String openid);
public XklMemberOpenidEntity findByOpenidAndType(String openid,int type);
public XklMemberOpenidEntity findOneByOpenidAndType(String openid,int type);
public void deleteByOpenid(String openid);
}
... ...