From 03ec96c7f9087bd52946de1bc7c495be424aa47a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 15 Aug 2016 11:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Brequest=E7=B1=BB=E7=9A=84toke?= =?UTF-8?q?n=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 9112beed..da3194fa 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1409,13 +1409,13 @@ class Request * 生成请求令牌 * @access public * @param string $name 令牌名称 - * @param string $type 令牌生成类型 + * @param string|array $type 令牌生成方法 * @return string */ public function token($name = '__token__', $type = 'md5') { $type = is_callable($type) ? $type : 'md5'; - $token = $type($_SERVER['REQUEST_TIME_FLOAT']); + $token = call_user_func($type, $_SERVER['REQUEST_TIME_FLOAT']); Session::set($name, $token); return $token;