This commit is contained in:
苏尹岚
2021-04-09 18:03:13 +08:00
parent ba144fe63b
commit 77fa1137ac

View File

@@ -354,21 +354,18 @@ type UserInfoWithWeixin struct {
// @Param iv formData string true "iv" // @Param iv formData string true "iv"
// @Param jsCode formData string false "小程序jsCode" // @Param jsCode formData string false "小程序jsCode"
// @Param authType formData string false "authType" // @Param authType formData string false "authType"
// @Param appID formData string false "appID"
// @Success 200 {object} controllers.CallResult // @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /GetUserByMiniInfo [post] // @router /GetUserByMiniInfo [post]
func (c *Auth2Controller) GetUserByMiniInfo() { func (c *Auth2Controller) GetUserByMiniInfo() {
c.callGetUserByMiniInfo(func(params *tAuth2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { c.callGetUserByMiniInfo(func(params *tAuth2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) {
authInfo := &auth2.AuthInfo{} authInfo := &auth2.AuthInfo{}
// result := api.Cacher.Get(params.Token) str := []string{
// utils.Map2StructByJson(result.(map[string]interface{}), &authInfo, false) params.AppID,
jsCode := "" params.JsCode,
// if params.AuthType == weixin.AuthTypeMini { }
// jsCode = GetComposedCode(&c.Controller, params.JsCode) jsCode := strings.Join(str, ",")
// }
// if params.AuthType == weixin.AuthTypeWxApp {
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 {