用户中心模板不是单页,它是一整套后台壳子。你改的时候要按整套页面一起看,不要只改一个文件就收工。
模板目录固定放在:
view/index/user/模板名/
1. 页面清单
| 页面 | 作用 |
|---|---|
index.html | 用户中心总壳子 |
home.html | 首页仪表盘 |
profile.html | 个人资料 |
member.html | 会员中心 |
balance_recharge.html | 余额充值 |
points_recharge.html | 点数充值 |
balance_detail.html | 余额明细 |
recharge_record.html | 充值记录 |
points_log.html | 点数明细 |
temp_access.html | 临时访问管理 |
temp_access_error.html | 临时访问错误页 |
douyin/cklogin.html | 抖音账号管理 |
douyin/replylist.html | 回复列表 |
douyin/strategy.html | 回复策略 |
douyin/message_list.html | 私信列表 |
proxy/proxy.html | 天启配置 |
proxy/proxy_list.html | 代理列表 |
douyin/oauth_result.html | 授权结果页 |
2. 页面变量总表
| 页面 | 主要变量 |
|---|---|
index.html | user、site、temp_access、temp_access_json、message_accounts |
home.html | user、site、temp_access |
profile.html | user、avatar、user_captcha_enabled、security_provider、security_captcha_type |
member.html | site、user、current_member、levels、levels_json、enterprise_login_enable、pay_config |
balance_recharge.html | site、user、pay_config、pricing、activities |
points_recharge.html | site、user、pay_config、pricing |
balance_detail.html | site、user |
recharge_record.html | site、user |
points_log.html | site |
temp_access.html | permission_groups、permission_groups_json |
temp_access_error.html | msg |
douyin/cklogin.html | enterprise_login_enable、site、pay_config、pricing、pay_config_json、ck_price_rules_json |
douyin/replylist.html | enterprise_login_enable |
proxy/proxy.html | user、is_vip |
proxy/proxy_list.html | user |
douyin/oauth_result.html | success、msg |
pay_config_json、ck_price_rules_json、temp_access_json、permission_groups_json 这些字段本身已经是 JSON 字符串,前端直接拿去做 JS 初始化就行。
3. 关键字段说明
user
最常用的字段如下:
| 字段 | 说明 |
|---|---|
id | 用户 ID |
username | 用户名 |
status | 账户状态 |
points | 点数 |
balance | 余额 |
member_level_id | 当前会员等级 ID |
member_expire_time | 会员到期时间 |
member_personal_ck_quota | 会员赠送的个人 CK 免费额度 |
member_enterprise_ck_quota | 会员赠送的企业 CK 免费额度 |
avatar_url | 头像地址 |
email | 邮箱 |
vip_expire_time | VIP 到期时间 |
create_time | 注册时间 |
vip_status | VIP 状态 |
重点提醒一下:member_personal_ck_quota 和 member_enterprise_ck_quota 是会员自带的免费额度,不是“最大限制”。免费额度用完以后,再新增 CK 才会按定价继续扣费。
current_member
| 字段 | 说明 |
|---|---|
level_name | 当前会员名称 |
expire_time | 到期时间 |
remaining_days | 剩余天数 |
expire_warning | 是否临期 |
personal_ck_quota | 个人 CK 免费额度 |
enterprise_ck_quota | 企业 CK 免费额度 |
levels
每个会员套餐常见字段:
| 字段 | 说明 |
|---|---|
id | 套餐 ID |
name | 套餐名称 |
buy_price | 当前购买价格 |
buy_plan_label | 当前购买周期文字 |
buy_unit_label | 周期单位文字 |
buy_type | 购买类型 |
buy_text | 按钮文案 |
description | 套餐说明 |
stock_text | 库存说明 |
personal_ck_count | 个人 CK 免费额度 |
enterprise_ck_count | 企业 CK 免费额度 |
send_rate_count | 发送频率限制次数 |
send_rate_seconds | 发送频率限制秒数 |
send_card_limit | 卡片发送上限 |
send_text_limit | 文本发送上限 |
is_current | 当前是否已购买 |
can_buy | 是否可购买 |
plans | 可购买方案列表 |
temp_access
| 字段 | 说明 |
|---|---|
enabled | 是否启用临时访问 |
permissions | 当前可选权限列表 |
permission_groups
这个变量是临时访问页面的复选框数据,里面分 pages 和 operations 两层。页面用来选大类,操作用来选细项。
message_accounts
这是私信页左侧菜单里显示的个人 CK 账号列表,常用字段是:
| 字段 | 说明 |
|---|---|
id | 账号 ID |
menu_label | 菜单里短显示名 |
menu_title | 菜单里完整显示名 |
pay_config 和 pricing
pay_config:支付通道配置,前端主要拿来判断能显示哪些支付方式pricing:价格策略配置,余额充值、点数充值、会员购买、CK 超额收费都会用到
4. 页面怎么写
- 左侧菜单继续用
lay-href - 顶部跳转继续用
ew-href window.tempAccessConfig不要删,权限判断会用到- 表单按钮、提交地址、返回码尽量保持原样,不要随便改名字
pay_config_json、ck_price_rules_json这些给 JS 直接读,不要再手动拼字符串
5. 接口返回示例
5.1 账号和资料
| 接口 | 返回示例 |
|---|---|
GET /user/checkLogin | {"code":200,"msg":"已登录","user":{...}} |
GET /user/checkLogin 未登录 | {"code":201,"msg":"未登录"} |
POST /user/logout | {"code":200,"msg":"退出成功"} |
POST /user/updateProfile | {"code":200,"msg":"资料更新成功","user":{...},"logout":0} |
POST /user/updateProfile 改密码 | {"code":200,"msg":"密码修改成功,请重新登录","logout":1,"redirect":"/user/login"} |
POST /user/bindEmail | {"code":200,"msg":"邮箱绑定成功","user":{...}} |
POST /user/unbindEmail | {"code":200,"msg":"邮箱已解除绑定","user":{...}} |
POST /user/uploadAvatar | {"code":200,"msg":"头像上传成功","data":{"src":"/assets/Userimg/xxx.jpg"},"user":{...}} |
POST /user/sendEmailCode | {"code":200,"msg":"验证码已发送","data":{"interval":180}} |
GET /user/captcha | {"code":200,"msg":"ok","data":{...}} |
GET /user/captchaImage | 图片流,Content-Type: image/png 或 image/jpeg |
5.2 充值和会员
| 接口 | 返回示例 |
|---|---|
POST /user/createRechargeOrder | {"code":200,"msg":"订单创建成功","data":{"trade_no":"202605220001","qrcode":"...","payurl":"...","timeout":300}} |
POST /user/createPointsOrder | {"code":200,"msg":"订单创建成功","data":{"trade_no":"202605220002","qrcode":"...","payurl":"...","timeout":300}} |
POST /user/buyPointsByBalance | {"code":200,"msg":"购买成功","data":{"points":100,"balance":"88.00"}} |
POST /user/buyMember | {"code":200,"msg":"购买成功","data":{...}} |
POST /user/createMemberOrder | {"code":200,"msg":"订单创建成功","data":{"trade_no":"202605220003","qrcode":"...","payurl":"..."}} |
POST /user/redeemBalanceCard | {"code":200,"msg":"兑换成功","data":{...}} |
GET /user/rechargeOrderStatus | {"code":200,"msg":"ok","data":{"trade_no":"202605220001","status":1,"status_text":"已支付","money":"100.00","balance":"188.00","points":300}} |
GET /user/getBalanceDetail | {"code":0,"data":[{...}],"count":20} |
GET /user/getRechargeRecord | {"code":0,"data":[{...}],"count":10} |
POST /user/deleteRechargeRecord | {"code":200,"msg":"删除成功"} |
GET /user/getPointsLog | {"code":0,"data":[{...}],"count":12} |
5.3 临时访问
| 接口 | 返回示例 |
|---|---|
GET /user/getTempAccessList | {"code":0,"data":[{...}],"count":5} |
POST /user/createTempAccess | {"code":200,"msg":"临时访问链接创建成功","data":{"id":1,"key":"...","token":"...","url":"...","expires_at":"2026-05-23 10:00:00"}} |
POST /user/deleteTempAccess | {"code":200,"msg":"删除成功"} |
5.4 抖音账号
| 接口 | 返回示例 |
|---|---|
GET /douyin/getAccountStats | {"code":200,"msg":"获取成功","data":{"days":30,"sent":123,"recv":456}} |
GET /douyin/getTrend | {"code":200,"msg":"获取成功","data":{"days":30,"sent":123,"recv":456}} |
GET /douyin/getCkAccountList | {"code":0,"msg":"获取成功","data":[{...}],"count":3} |
GET /douyin/getCkAccountById | {"code":0,"data":{...}} |
POST /douyin/addCkAccount | {"code":200,"msg":"企业配置添加成功","data":{"id":1,"points_deducted":0,"remaining_points":5,"expire_time":"2026-06-21 00:00:00"}} |
POST /douyin/editCkAccount | {"code":200,"msg":"修改成功"} |
POST /douyin/removeCkAccount | {"code":200,"msg":"删除成功"} |
POST /douyin/renewCkAccount | {"code":200,"msg":"续费成功","data":{"new_expire_time":"2026-06-21 00:00:00","remaining_points":4}} |
POST /douyin/testCkAccount | {"code":200,"msg":"配置有效","data":{"valid":true,"message":"配置有效"}} |
POST /douyin/getCkAccountOptions | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/getEnterpriseConfigOptions | {"code":200,"msg":"获取成功","data":[{...}]} |
GET /douyin/getPersonalCkList | {"code":0,"msg":"获取成功","data":[{...}],"count":8} |
GET /douyin/getPersonalCkById | {"code":0,"data":{...}} |
POST /douyin/addPersonalCk | {"code":200,"msg":"添加成功","data":{"status":"success","id":1,"expire_time":"2026-06-21 00:00:00","remaining_points":5,"balance":"88.00"}} |
POST /douyin/editPersonalCk | {"code":200,"msg":"修改成功"} |
POST /douyin/removePersonalCk | {"code":200,"msg":"删除成功"} |
POST /douyin/renewPersonalCk | {"code":200,"msg":"续费成功","data":{"new_expire_time":"2026-06-21 00:00:00","remaining_points":4}} |
POST /douyin/testPersonalCk | {"code":200,"msg":"获取成功","data":{...}} |
POST /douyin/verifyCookieOnly | {"code":200,"msg":"验证成功","data":{...}} |
POST /douyin/getPersonalCkOptions | {"code":200,"msg":"获取成功","data":[{...}]} |
GET /douyin/getPersonalCkStats | {"code":200,"msg":"获取成功","data":{"days":30,"sent":123,"recv":456}} |
GET /douyin/getPersonalCkLog | {"code":0,"msg":"获取成功","data":[{...}],"count":20} |
POST /douyin/getOAuthUrl | {"code":200,"msg":"ok","data":{"url":"https://open.douyin.com/...","state":"..."}} |
douyin/oauth_result.html | 页面接收 success 和 msg,成功时显示授权成功,失败时直接显示错误信息 |
5.5 回复和策略
| 接口 | 返回示例 |
|---|---|
GET /douyin/getReplyList | {"code":0,"msg":"获取成功","data":[{...}],"count":15} |
POST /douyin/getReplyById | {"code":200,"msg":"获取成功","data":{...}} |
POST /douyin/addReply | {"code":200,"msg":"新增成功","data":{...}} |
POST /douyin/editReply | {"code":200,"msg":"修改成功"} |
POST /douyin/removeReply | {"code":200,"msg":"删除成功"} |
POST /douyin/batchRemoveReply | {"code":200,"msg":"批量删除成功"} |
POST /douyin/statusReply | {"code":200,"msg":"状态已更新"} |
GET /douyin/getStrategyList | {"code":0,"msg":"获取成功","data":[{...}],"count":6} |
POST /douyin/getStrategyById | {"code":200,"msg":"获取成功","data":{...}} |
POST /douyin/getStrategyReplyOptions | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/getStrategyDmUsers | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/saveStrategy | {"code":200,"msg":"保存成功"} |
POST /douyin/removeStrategy | {"code":200,"msg":"删除成功"} |
5.6 私信
| 接口 | 返回示例 |
|---|---|
GET /douyin/getMessageAccountOptions | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/getMessageConversationList | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/getMessageConversationMessages | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/pollMessageLocal | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/sendMessageText | {"code":200,"msg":"发送成功","data":{...}} |
POST /douyin/sendMessageCard | {"code":200,"msg":"发送成功","data":{"msg_id":"..."}} |
POST /douyin/recallMessage | {"code":200,"msg":"撤回成功","data":{...}} |
5.7 代理和天启
| 接口 | 返回示例 |
|---|---|
POST /douyin/getTianqiConfig | {"code":200,"msg":"ok","data":{"secret":"...","sign":"...","enabled":1}} |
POST /douyin/saveTianqiConfig | {"code":200,"msg":"保存成功"} |
POST /douyin/testTianqiProxy | {"code":200,"msg":"测试成功","data":{"ip":"1.2.3.4","port":"8080"}} |
GET /douyin/getCustomProxyList | {"code":0,"msg":"ok","count":2,"data":[{...}]} |
POST /douyin/getCustomProxyOptions | {"code":0,"msg":"ok","data":[{...}]} |
POST /douyin/saveCustomProxy | {"code":200,"msg":"保存成功","data":{"id":1}} |
POST /douyin/removeCustomProxy | {"code":200,"msg":"删除成功"} |
POST /douyin/testCustomProxy | {"code":200,"msg":"测试成功,HTTP 200"} |
5.8 黑名单和素材
| 接口 | 返回示例 |
|---|---|
POST /douyin/getBlacklist | {"code":0,"msg":"获取成功","data":[{...}],"count":10} |
POST /douyin/addBlacklist | {"code":200,"msg":"已加入黑名单"} |
POST /douyin/removeBlacklist | {"code":200,"msg":"已移除黑名单"} |
POST /douyin/removeBlacklistByUid | {"code":200,"msg":"已移除"} |
POST /douyin/uploadMaterial | {"code":200,"msg":"上传成功","data":{"filename":"xxx.png"}} |
POST /douyin/getMaterialList | {"code":200,"msg":"获取成功","data":[{...}]} |
POST /douyin/deleteMaterial | {"code":200,"msg":"删除成功"} |
6. 实际写页面时记住这几条
- 会员里的个人 CK 数量和企业 CK 数量是免费额度,不是硬限制
- 列表接口统一读
count和data - 详情接口统一读
data - 操作接口统一看
code和msg
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
![[模板开发]用户中心模板开发-抖音获客系统](https://www.spiunet.com/wp-content/uploads/2026/05/Screenshot_2026-05-30-14-18-57-608_com.miui_.media_-800x597.jpg)

![[第11期]充值活动基础讲解教程-抖音获客系统](https://www.spiunet.com/wp-content/uploads/2026/05/Screenshot_2026-05-30-13-52-48-417_com.miui_.media_-800x575.jpg)
![[更新日志]V1.0.0 [1001][2026-05-28 17:50:40]-抖音获客系统](https://www.spiunet.com/wp-content/uploads/2026/05/11339-800x578.png)


暂无评论内容