PHPackages                             mongdch/mon-ucenter - 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. mongdch/mon-ucenter

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

mongdch/mon-ucenter
===================

The user center sdk

1.0.1(3y ago)016MITPHPPHP &gt;=7.0.0

Since Sep 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/MonGDCH/mon-ucenter)[ Packagist](https://packagist.org/packages/mongdch/mon-ucenter)[ Docs](http://gdmon.com/)[ RSS](/packages/mongdch-mon-ucenter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

mon-ucenter
===========

[](#mon-ucenter)

基于`mongdch/mon-orm`的用户中心SDK

### 使用

[](#使用)

1. 导入`database/database.sql`数据库文件，创建相关表
2. 定义初始化配置

```
$config = [
    // 模型对应表名
    'table' => [
        // 用户模型
        'user' => 'user',
        // 用户实名验证模型
        'user_realname_auth' => 'user_realname_auth',
        // 第三方开放平台账户模型
        'user_open_account' => 'user_open_account',
        // 用户登录记录模型
        'user_login_log' => 'user_login_log'
    ],
    // 数据库配置
    'database' => [
        // 数据库类型，只支持mysql
        'type'          => 'mysql',
        // 服务器地址
        'host'          => '127.0.0.1',
        // 数据库名
        'database'      => 'test',
        // 用户名
        'username'      => 'root',
        // 密码
        'password'      => 'root',
        // 端口
        'port'          => '3306',
        // 数据库连接参数
        'params'        => [],
        // 数据库编码默认采用utf8
        'charset'       => 'utf8mb4',
        // 返回结果集类型
        'result_type'   => PDO::FETCH_ASSOC,
        // 是否开启读写分离
        'rw_separate'   => false,
        // 查询数据库连接配置，二维数组随机获取节点覆盖默认配置信息
        'read'          => [],
        // 写入数据库连接配置，同上，开启事务后，读取不会调用查询数据库配置
        'write'         => []
    ],
    // 添加用户或者修改基本信息时，判断唯一的数据字段，键为字段名，值为中文描述
    'unique_field'          => [
        'email'     => '邮箱',
        'moble'     => '手机号',
        'username'  => '用户名'
    ],
    // 用于加密生成推荐码的数值
    'inviter_code'          => 651423,
    // 推荐码最高记录层级，0则全部记录
    'inviter_level_limit'   => 3,
    // 新增用户时，如未输入密码，默认的密码
    'default_password'      => '123456',
    // 注册时，是否强制要求填入邀请码(参数名：code)
    'force_invite_code'     => false,
    // 注册用户默认status状态
    'register_user_status'  => 1,
    // 默认用户头像
    'default_avatar'        => '',
    // 登录失败次数限制
    'login_faild'           => [
        // 账号登录失败次数
        'account_error_limit'   => 5,
        // IP登录失败次数
        'ip_error_limit'        => 8,
        // 间隔时间多少分钟
        'login_gap'             => 5,
    ]
];

// 定义配置，运行初始化
\mon\ucenter\UCenter::instance()->init($config);
```

3. 调用相关模型API接口

```
// example

$loginInfo = [];
\mon\ucenter\UCenter::instance()->user()->login($loginInfo);
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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 ~53 days

Total

2

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f72e67ce10f7cfef428bc70ce1ec7411eb16bae10edc2cc5277b765284a46c39?d=identicon)[MonGDCH](/maintainers/MonGDCH)

---

Top Contributors

[![monton-gif](https://avatars.githubusercontent.com/u/53856623?v=4)](https://github.com/monton-gif "monton-gif (9 commits)")

---

Tags

ucentermonuser center

### Embed Badge

![Health badge](/badges/mongdch-mon-ucenter/health.svg)

```
[![Health](https://phpackages.com/badges/mongdch-mon-ucenter/health.svg)](https://phpackages.com/packages/mongdch-mon-ucenter)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

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