123333
This commit is contained in:
@@ -13,12 +13,20 @@ public class YunxinManager {
|
||||
@Autowired
|
||||
private YunxinProperties yunxinProperties;
|
||||
|
||||
public boolean checkNotify(String body,String curTime){
|
||||
public boolean checkNotify(String body,String curTime, String checkSum,String md5){
|
||||
try {
|
||||
String appSecret = yunxinProperties.getAppSecret();
|
||||
String verifyMD5 = CheckSumBuilder.getMD5(body);
|
||||
if(md5 == null || !md5.equals(verifyMD5)){
|
||||
log.error("云信回调校验异常,md5 不相等");
|
||||
return false;
|
||||
}
|
||||
String verifyChecksum = CheckSumBuilder.getCheckSum(appSecret, verifyMD5, curTime);
|
||||
return verifyMD5 != null && verifyMD5.equals(verifyChecksum);
|
||||
if(checkSum == null || !checkSum.equals(verifyChecksum)){
|
||||
log.error("云信回调校验异常,checkSum 不相等");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.info("检查云信回调数据失败",e);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user