Authored by zhaoyue

Fix openid problem

... ... @@ -73,6 +73,7 @@ public class OpenIdController {
} else {//已经存在
xklMemberOpenid.setOpenid(openId);
}
xklMemberOpenidRespository.deleteByOpenid(openId);
xklMemberOpenidRespository.save(xklMemberOpenid);
}
return new ResponseEntity<>(ResultModel.ok(ResultStatus.OPENID_BIND_SUCCESS), HttpStatus.OK);
... ... @@ -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);
}
... ...