$this->appId, 'time' => time(), 'nonceStr' => StringHelper::random(32), 'mobile' => '15888888888', ], $this->appSecret); return [ 'url' => Yii::$app->request->hostInfo . '/api/sign-secret-key?' . $paraStr, 'method' => 'post', 'explain' => '请用post请求该链接进行测试带签名验证' ]; } /** * 校验签名是否正确 * * @return bool * @throws \yii\web\UnprocessableEntityHttpException */ public function actionCreate() { return EncryptionHelper::decodeUrlParam(Yii::$app->request->get(), $this->appSecret); } }