This commit is contained in:
苏尹岚
2021-04-09 17:54:06 +08:00
parent 927d1b82b7
commit ba144fe63b

View File

@@ -363,12 +363,12 @@ func (c *Auth2Controller) GetUserByMiniInfo() {
// result := api.Cacher.Get(params.Token) // result := api.Cacher.Get(params.Token)
// utils.Map2StructByJson(result.(map[string]interface{}), &authInfo, false) // utils.Map2StructByJson(result.(map[string]interface{}), &authInfo, false)
jsCode := "" jsCode := ""
if params.AuthType == weixin.AuthTypeMini { // if params.AuthType == weixin.AuthTypeMini {
jsCode = GetComposedCode(&c.Controller, params.JsCode) // jsCode = GetComposedCode(&c.Controller, params.JsCode)
} // }
if params.AuthType == weixin.AuthTypeWxApp { // if params.AuthType == weixin.AuthTypeWxApp {
jsCode = GetComposedCode2(&c.Controller, params.JsCode) jsCode = GetComposedCode2(&c.Controller, params.JsCode)
} // }
if err == nil { if err == nil {
decryptedDataBase64, err2 := weixin.AutherObjMini.DecryptData(authInfo, jsCode, params.Data, params.Iv) decryptedDataBase64, err2 := weixin.AutherObjMini.DecryptData(authInfo, jsCode, params.Data, params.Iv)
if err = err2; err == nil { if err = err2; err == nil {