six-shop/auth

认证模块

Maintainers

Details

gitee.com/sixdec-1/auth.git

Installs: 29

Dependents: 0

Suggesters: 0

Security: 0

Type:sixshop-extension

v0.1.6 2025-09-03 15:08 UTC

This package is auto-updated.

Last update: 2025-09-06 07:24:59 UTC


README

Auth 模块是 SixShop 的权限管理模块,用于管理用户、角色、权限等。

接口

AuthInterface 生成token和验证token

interface AuthInterface
{
    /**
     * 用户ID生成token
     */
    public function generateToken(string $userId): string;

    /**
     * 验证token是否有效,并返回用户ID
     */
    public function verifyToken(string $jwt): string;

    /**
     * 刷新token,返回新的token
     */
    public function refreshToken(string $jwt): string;

    /**
     * 注销token
     */
    public function revokeToken(string $jwt): void;
    
    /**
     * 获取用户类型
     */
    public function getUserType(): UserTypeEnum;
}

HOOKS

  1. token_verify: token验证触发
  2. token_revoke: token注销触发