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

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

猜你喜欢

转载自www.cnblogs.com/findumars/p/10236619.html