PHPackages                             cayu/tp-user-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. cayu/tp-user-login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

cayu/tp-user-login
==================

tp6用户统一检验登录类

0.1.6(3y ago)011Apache-2.0PHPPHP &gt;=7.2

Since Jun 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/QiuCaYu/tp-user-login)[ Packagist](https://packagist.org/packages/cayu/tp-user-login)[ RSS](/packages/cayu-tp-user-login/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

基于tp6开发的一个登录验证功能
================

[](#基于tp6开发的一个登录验证功能)

### 安装

[](#安装)

```

composer install QiuCaYu/tp-user-login

```

### 文件目录

[](#文件目录)

```
  cayu/tp-user-login
    ├── composer.json
    ├── README.md
    └── src
        ├── concern
        │   └── LoginService.php   #登录服务类
        ├── config.php 配置文件
        ├── exception
        │   └── ValidateErrorException.php  统一错误异常处理
        ├── lib
        │   └── Config.php  初始化配置类
        ├── Login.php  facade门面类
        └── model 模型
            └── User.php 用户模型

```

### 数据库设计要求

[](#数据库设计要求)

```
    用户表必须带有以下固定字段：
        account 账户名称
        password 密码
        salt 加密盐

    加密方法略

```

### tp6配置目录下生成的 tplogin.php 配置说明

[](#tp6配置目录下生成的-tploginphp-配置说明)

```
   // 请勿修改统一响应码key，可修改 code、message字段
    'response_code' => [
        '400' => [
            'code' => '400',
            'system_error_message' => '参数校验错误',
            'message' => '参数校验错误',
        ],
        '420' => [
            'code' => '420',
            'system_error_message' => '获取用户信息失败',
            'message' => '账号或密码有误',
        ],
        '421' => [
            'code' => '421',
            'system_error_message' => '校验密码错误',
            'message' => '账号或密码有误',
        ],
        '411' => [
            'code' => '411',
            'system_error_message' => '请检查文件缓存配置',
            'message' => '请检查文件缓存配置',
        ],
        '410' => [
            'code' => '410',
            'system_error_message' => '请检查文件配置',
            'message' => '请检查文件配置',
        ],
        '430' => [
            'code' => '430',
            'system_error_message' => '用户信息不存在',
            'message' => '用户信息不存在',
        ],
        '435' => [
            'code' => '435',
            'system_error_message' => '缓存用户信息有误',
            'message' => '缓存用户信息有误',
        ]
    ],
    // 配置模型、缓存定义
    'meta' => [
        // 默认读取 default 内容,新增配置可复制 default内容,修改为其他名称即可使用
        'default' => [
            'table' => '',
            // 过滤表字段，获取用户信息时，过滤用户敏感数据字段
            'filter_field' => [
                'password',
                'salt',
            ],
            'cache'=> [
                // 缓存时间
                'times' => 86400,
                // token缓存前缀定义
                'token_prefix' => 'default_user_login:',
                // 用户信息缓存前缀定义
                'user_prefix' => 'default_user_login:user:',
            ]
        ]
        // ...
    ]

```

### 使用方法

[](#使用方法)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~27 days

Total

7

Last Release

1309d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/855ad74d03e00e9c9f5079a51c00d23e6749d0c5679d3b4a59fa662a67606fc4?d=identicon)[QiuCaYu](/maintainers/QiuCaYu)

---

Top Contributors

[![QiuCaYu](https://avatars.githubusercontent.com/u/17777841?v=4)](https://github.com/QiuCaYu "QiuCaYu (3 commits)")

### Embed Badge

![Health badge](/badges/cayu-tp-user-login/health.svg)

```
[![Health](https://phpackages.com/badges/cayu-tp-user-login/health.svg)](https://phpackages.com/packages/cayu-tp-user-login)
```

###  Alternatives

[thans/tp-jwt-auth

thinkphp jwt auth composer

14889.6k6](/packages/thans-tp-jwt-auth)[casbin/think-authz

An authorization library that supports access control models like ACL, RBAC, ABAC for ThinkPHP.

27918.5k6](/packages/casbin-think-authz)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
