unigui验证微信服务器的有效性

时间:2019-01-08 00:13:03   收藏:0   阅读:187

UNIGUI验证微信服务器的有效性:

////////////////////////////////////////////

//UniGUIServerModuleHTTPCommand

//公众平台验证服务器地址的有效性

////////////////////////////////////////////

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(

  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;

  var Handled: Boolean);

begin

    if CheckSignature(ARequestInfo) then//微信验证服务器地址的有效性

    begin

      if ARequestInfo.Params.Values[‘echostr‘]<>‘‘ then

      begin

        Handled := true;

        AResponseInfo.CharSet := ‘UTF-8‘;

        AResponseInfo.ContentType := ‘UTF-8‘;

        AResponseInfo.ContentText :=ARequestInfo.Params.Values[‘echostr‘];//签名比较成功后返回echostr的内容就可以。

      end;

    end;

 end;

 

https://www.cnblogs.com/qiufeng2014/p/6920535.html

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!