【PHP】双方接口通信校验服务
请求方 使用
ApiAuthService::buildUrl($domain, ['terminal' => 1, 'ts' => time()]);
//http://域名/adminapi/login/platformLogin?sign=F7FE8A150DEC18BE8A71C5059742C81A&terminal=1&ts=1736904841
接收方
$getParams = $this->request->get();
$validate = ApiAuthService::check($getParams);
if (!$validate) {
return $this->fail('签名验证失败');
}
<?php
namespace app\adminapi\service;
/**
* 服务
*/