Skip to content

系统接口token使用jwt进行身份验证

服务类文件位置:tmcore/services/JwtTokenService.php

/**
* 创建 jwt_token
*/
public static function createToken(int $id, string $type, int $exp, array $params = [], bool $is_multipoint = true)

/**
* 验证 jwt_token
*/
public static function parseToken(string $token, bool $is_expire_extension = false)

/**
* 解密 jwt_token
*/
public static function decodeToken(string $token)

/**
* 清理 jwt_token
*/
public static function clearToken(int $id, string $type, ?string $token = '')

/**
* jwt_token 过期检验
*/
public static function expireTokenCheck(int $id, string $type, string $token)

/**
* 续期 jwt_token
*/
public static function extensionToken(int $id, string $type, string $token, int $exp)

Released under the Apache-2.0 License.