johnny1991 2017-11-02 10:20:53 3771次浏览 0条评论 1 0 0
public function actionIndex() {
    $signature = Yii::$app->getRequest()->get('signature');
    $nonce = Yii::$app->getRequest()->get('nonce');
    $timestamp = Yii::$app->getRequest()->get('timestamp');
    Yii::info(Yii::$app->getRequest()->get(), 'log-info');
    $token = 'xxxxxxxxxxxx'; // 你自己的token
    $arr = [$token, $timestamp, $nonce];
    sort($arr);
    $hashCode = sha1(implode($arr));
    Yii::info($hashCode, 'log-info');

    if ($hashCode == $signature) {
        return Yii::$app->getRequest()->get('echostr');
    }

    return false;
}
    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册