# 用户模块 **Repository Path**: my_module/user ## Basic Information - **Project Name**: 用户模块 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-05 - **Last Updated**: 2026-04-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # user - 用户模块 myphp 项目的用户体系扩展模块。支持多方式登录(账号密码/手机验证码/微信公众号/小程序)、余额系统、积分系统、VIP 会员、提现等。 ## 特性 - **多方式登录**:账号密码、手机验证码、微信公众号 OAuth、微信小程序 - **JWT 认证**:HS384 签名,默认 31 天有效期 - **余额系统**:事务+行锁保证原子性,完整流水明细 - **积分系统** - **VIP 会员**:等级、到期时间、权限校验 - **提现管理**:防重复、每日次数限制 - **扩展字段**:用户 ext JSON 字段,Redis 缓存 ## 安装 通过后台「模块管理 → 安装模块」输入本仓库地址安装: ``` https://gitee.com/my_module/user.git ``` 或命令行 clone 后通过「未注册模块检测」注册: ```bash cd /path/to/your-project git clone https://gitee.com/my_module/user.git user # 然后在后台模块管理页扫描并注册 ``` ## 模块信息 | 项目 | 值 | |------|-----| | 模块名 | user | | 类型 | extension(扩展) | | 路由 | /user | | 版本 | 1.0.0 | ## 依赖 - base(admin)模块 - firebase/php-jwt ^7.0 - overtrue/wechat ~5.0 ## 主要 API | 方法 | 路径 | 说明 | |------|------|------| | POST | /user/login/index | 用户登录(多方式) | | POST | /user/login/code-reset-pwd | 短信验证码重置密码 | | GET | /user/user/index | 用户信息 | | POST | /user/user/set-base | 更新基本信息 | | POST | /user/user/bind-mobile | 绑定手机号 | | GET | /user/user/money-detail | 余额明细 | 详见主项目文档 `docs/user-module.md`。 ## 数据表 - user(用户主表) - user_login(多方式登录关联) - user_login_log(登录日志) - user_money(余额明细) - user_points(积分明细) - user_rank(会员等级) - user_token(简单 Token) - user_withdraw(提现记录) - sms_mail(短信验证码)