Open billlv opened 1 year ago
首先很感谢作者的付出。插件很好用。 使用的问题请留意。一个是格式函数弃用,另外一个dingtalk key多了下划线代码对应不上。
private static function _sign(string $url, string $secret): string { [$s1, $s2] = explode(' ', microtime()); $timestamp = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); $data = $timestamp . "\n" . $secret; $signStr = base64_encode(hash_hmac('sha256', $data, $secret, true));
if(PHP_VERSION_ID < 82000){ $signStr = mb_convert_encoding($signStr, 'UTF-8', 'ISO-8859-1'); } else { $signStr = utf8_encode(urlencode($signStr)); } $signStr = mb_convert_encoding(urlencode($signStr), 'UTF-8', 'ISO-8859-1'); return $url . "×tamp=$timestamp&sign=$signStr"; }
感谢反馈
最新版本已发布:https://github.com/Tinywan/webman-exception/releases/tag/v1.1.6
首先很感谢作者的付出。插件很好用。 使用的问题请留意。一个是格式函数弃用,另外一个dingtalk key多了下划线代码对应不上。
class DingTalkRobotEvent
private static function _sign(string $url, string $secret): string { [$s1, $s2] = explode(' ', microtime()); $timestamp = (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); $data = $timestamp . "\n" . $secret; $signStr = base64_encode(hash_hmac('sha256', $data, $secret, true));
这部分做的兼容