feat: add system config disable user registeration

This commit is contained in:
RockYang
2024-01-18 17:24:02 +08:00
parent 378e6ec9af
commit 72b95151a1
4 changed files with 22 additions and 4 deletions

View File

@@ -180,7 +180,8 @@ type SystemConfig struct {
VipMonthCalls int `json:"vip_month_calls"` // VIP 会员每月赠送的对话次数
VipMonthImgCalls int `json:"vip_month_img_calls"` // VIP 会员每月赠送绘图次数
RegisterWays []string `json:"register_ways"` // 注册方式:支持手机,邮箱注册
RegisterWays []string `json:"register_ways"` // 注册方式:支持手机,邮箱注册
EnabledRegister bool `json:"enabled_register"` // 是否开放注册
RewardImg string `json:"reward_img"` // 众筹收款二维码地址
EnabledReward bool `json:"enabled_reward"` // 启用众筹功能

View File

@@ -64,9 +64,9 @@ func (b *Bot) messageHandler(msg *openwechat.Message) {
msg.AppMsgType == openwechat.AppMsgTypeUrl {
// 解析支付金额
message := parseTransactionMessage(msg.Content)
if message.Url != "" {
transaction := extractTransaction(message)
logger.Infof("解析到收款信息:%+v", transaction)
transaction := extractTransaction(message)
logger.Infof("解析到收款信息:%+v", transaction)
if transaction.TransId != "" {
var item model.Reward
res := b.db.Where("tx_id = ?", transaction.TransId).First(&item)
if item.Id > 0 {