handler; } /** * 获取加密后的Token * @param string $token Token标识 * @return string */ protected function getEncryptedToken($token) { $config = \think\Config::get('token'); return hash_hmac($config['hashalgo'], $token, $config['key']); } /** * 获取过期剩余时长 * @param $expiretime * @return float|int|mixed */ protected function getExpiredIn($expiretime) { return $expiretime ? max(0, $expiretime - time()) : 365 * 86400; } }