/// <summary> /// 服务器接入验证 /// </summary> /// <returns></returns> public static StrResp CheckServerValid(WXChatConfig appConfig, string signature, string timestamp, string nonce, string echostr) { var checkSignRes = WXChatHelper.CheckSignature(appConfig.Token, signature, timestamp, nonce, string.Empty); var resultRes = new StrResp().WithResp(checkSignRes);// checkSignRes.ConvertToResult<string>(); resultRes.data = resultRes.IsSuccess() ? echostr : string.Empty; return(resultRes); }
/// <summary> /// 服务器接入验证 /// </summary> /// <returns></returns> public static StrResp CheckServerValid(WechatMsgConfig appConfig, WechatRequestPara reqBody) { var checkSignRes = WechatChatHelper.CheckSignature(appConfig.Token, reqBody.signature, reqBody.timestamp, reqBody.nonce, string.Empty); var resultRes = new StrResp().WithResp(checkSignRes); resultRes.data = resultRes.IsSuccess() ? reqBody.echostr : string.Empty; return(resultRes); }