120) { return ['code' => 0, 'msg' => '签名已失效']; } //比对签名 $clientSign = $data['sign']; $serverSign = self::makeSign($data,$appKey); if ($clientSign == $serverSign) { return ['code' => 1, 'msg' => '验证通过']; } else { return ['code' => 0, 'msg' => '签名校验失败']; } } //生成url字符串 private static function toUrlParams($values): string { $buff = ""; foreach ($values as $k => $v) { if ($k != "sign" && !is_array($v)) { $buff .= $k . "=" . $v . "&"; } } return trim($buff, "&"); } }