修改微信扫码登录 access_token 问题

This commit is contained in:
2025-06-23 11:42:08 +08:00
parent 33b040065f
commit 03c7939a81
13 changed files with 346 additions and 60 deletions

View File

@ -15,3 +15,7 @@ const (
WeChatLoginCache = "wx:login:cache:%s"
WeChatLoginLimit = "wx:login:limit:%s"
)
const (
WechatAccessTokenKey = "wechat:access_token"
)

View File

@ -2,11 +2,14 @@ package storeDesktopSetting
import (
"context"
"encoding/json"
"fmt"
"github.com/gogf/gf/v2/errors/gerror"
"server/internal/dao"
"server/internal/model"
"server/internal/model/do"
"server/internal/service"
"server/utility/mqtt"
)
type sStoreDesktopSetting struct {
@ -60,6 +63,19 @@ func (s *sStoreDesktopSetting) Save(ctx context.Context, in model.SaveDesktopSet
if err != nil {
return nil, err
}
client, b := mqtt.GetClient("emqx")
if !b {
return nil, gerror.New("获取MQTT客户端失败")
}
marshal, err := json.Marshal(in)
if err != nil {
return nil, err
}
err = client.Publish(fmt.Sprintf("/desktop/%d", in.StoreId), marshal)
if err != nil {
return nil, err
}
return &model.SaveDesktopSettingOut{
Success: true,
}, nil

View File

@ -131,7 +131,13 @@ type GiftResponse struct {
}
type gameRoleInfo struct {
// FIXME
RoleIdx string `json:"roleIdx"`
RoleBaseInfo roleBaseInfo `json:"RoleBaseInfo"`
}
type roleBaseInfo struct {
Gid int `json:"gid"`
RoleIdx string `json:"roleidx"`
}
type userAddress struct {
@ -139,13 +145,24 @@ type userAddress struct {
}
type waterExtraInfo struct {
// FIXME
EchangeWaterLog echangeWaterLog `json:"echange_water_log"`
PremiumPrivInfo premiumPrivInfo `json:"premium_priv_info"`
SendOrderQuantity int `json:"send_order_quantity"`
}
type goodsType struct {
// FIXME
type echangeWaterLog struct {
SrcChannel string `json:"src_channel"`
SrcModule string `json:"src_module"`
Source string `json:"source"`
CreateBrandId string `json:"create_brand_id"`
}
type premiumPrivInfo struct {
CustomInfo string `json:"custom_info"` // 字符串 JSON可视需要二次解析
}
type goodsType int64
type goodsDisplayType struct {
// FIXME
}
@ -153,9 +170,44 @@ type goodsDisplayType struct {
type merchantInfo struct {
// FIXME
}
type olCouponCfg struct {
CouponReq couponReq `json:"coupon_req"`
}
type couponReq struct {
ReqContent reqContent `json:"reqContent"`
}
type reqContent struct {
CouponContent couponContent `json:"couponContent"`
}
type couponContent struct {
CouponNum string `json:"couponNum"`
}
type goodsBrandInfo struct {
BrandName string `json:"brand_name"`
JumpStatus int `json:"jump_status"`
BrandId string `json:"brand_id"`
BrandLogo string `json:"brand_logo"`
}
type expireConfig struct {
ExpireDays int `json:"expire_days"`
}
type privCoupon struct {
AppId string `json:"appid"`
PrizeChannelId string `json:"prize_channel_id"`
PrizeId string `json:"prize_id"`
PrizeType int `json:"prize_type"`
Num int `json:"num"`
Url string `json:"url"`
}
type goodsExtraInfo struct {
// FIXME
OlCouponCfg olCouponCfg `json:"olcoupon_cfg"`
GoodsBrandInfo goodsBrandInfo `json:"goods_brand_info"`
ExpireType int `json:"expire_type"`
ExpireConfig expireConfig `json:"expire_config"`
MprocJmpCfg map[string]any `json:"mproc_jmp_cfg"` // 空对象可用 map[string]any 表示
ApplyGoods string `json:"apply_goods"`
NewlyBuilt bool `json:"newly_built"`
PrivCoupon privCoupon `json:"priv_coupon"`
}
type water struct {

View File

@ -19,9 +19,9 @@ type StoreGetDesktopSettingOut struct {
}
type SaveDesktopSettingIn struct {
StoreId int64
TopComponentVisible int // 1显示2 隐藏
RightComponentVisible int // 1显示2 隐藏
StoreId int64 `json:"storeId"`
TopComponentVisible int `json:"topComponentVisible"` // 1显示2 隐藏
RightComponentVisible int `json:"rightComponentVisible"` // 1显示2 隐藏
}
type SaveDesktopSettingOut struct {
Success bool

View File

@ -3,11 +3,12 @@ package packed
import (
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
_ "server/utility/gamelife"
//_ "server/utility/gamelife"
//_ "server/utility/mqtt/emqx"
_ "server/utility/myCasbin"
_ "server/utility/oss/aliyun"
_ "server/utility/rsa"
_ "server/utility/sms/aliyun"
//_ "server/utility/oss/aliyun"
//_ "server/utility/rsa"
//_ "server/utility/sms/aliyun"
_ "server/utility/snowid"
_ "server/utility/wechat"
)