dengbiao 1 mese fa
parent
commit
87459fa217
1 ha cambiato i file con 11 aggiunte e 10 eliminazioni
  1. +11
    -10
      app/customer/hdl/hdl_login.go

+ 11
- 10
app/customer/hdl/hdl_login.go Vedi File

@@ -47,11 +47,11 @@ func WxAppletLogin(c *gin.Context) {
return
}
if !cacheKeyExist { // 如果是首次设置 设置过期时间
//_, err := cache.Expire(cacheKey, md.CfgCacheTime)
//if err != nil {
// _, err := cache.Expire(cacheKey, md.CfgCacheTime)
// if err != nil {
// _ = logx.Error(err)
// return ""
//}
// }
}

e.OutSuc(c, md.WxAppletLoginResponse{
@@ -82,7 +82,7 @@ func WxDecryptUserInfo(c *gin.Context) {
return
}

//获取sessionKey
// 获取sessionKey
get, err := cache.HGetString(md.WxSessionCacheKey, req.OpenId)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
@@ -113,7 +113,7 @@ func WxDecryptMobile(c *gin.Context) {
return
}

//获取sessionKey
// 获取sessionKey
get, err := cache.HGetString(md.WxSessionCacheKey, req.OpenId)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
@@ -172,13 +172,14 @@ func Register(c *gin.Context) {
var req md.RegisterReq
err := c.ShouldBindJSON(&req)
if err != nil {
utils.FilePutContents("Register_ERR", utils.SerializeStr(req))
err = svc2.HandleValidateErr(err)
err1 := err.(e.E)
e.OutErr(c, err1.Code, err1.Error())
return
}

//TODO::解密
// TODO::解密
phone := utils.Base64StdDecode(req.Phone)
if phone == "" {
e.OutErr(c, e.ERR, "非法/恶意 参数!!!")
@@ -234,10 +235,10 @@ func Register(c *gin.Context) {
}

if req.UserId != "" {
//支付宝
// 支付宝
user.UserId = req.UserId
} else {
//微信
// 微信
user.OpenId = req.OpenId
user.UnionId = req.UnionId
}
@@ -307,10 +308,10 @@ func UpdateUser(c *gin.Context) {
}

if req.UserId != "" {
//支付宝
// 支付宝
user.UserId = req.UserId
} else {
//微信
// 微信
user.OpenId = req.OpenId
user.UnionId = req.UnionId
}


Caricamento…
Annulla
Salva