From 77fa1137acd178ef37a4024b77a9bac62057ae92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 9 Apr 2021 18:03:13 +0800 Subject: [PATCH] aa --- controllers/auth2.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/controllers/auth2.go b/controllers/auth2.go index 109abd360..81b9fff06 100644 --- a/controllers/auth2.go +++ b/controllers/auth2.go @@ -354,21 +354,18 @@ type UserInfoWithWeixin struct { // @Param iv formData string true "iv" // @Param jsCode formData string false "小程序jsCode" // @Param authType formData string false "authType" +// @Param appID formData string false "appID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /GetUserByMiniInfo [post] func (c *Auth2Controller) GetUserByMiniInfo() { c.callGetUserByMiniInfo(func(params *tAuth2GetUserByMiniInfoParams) (retVal interface{}, errCode string, err error) { authInfo := &auth2.AuthInfo{} - // result := api.Cacher.Get(params.Token) - // utils.Map2StructByJson(result.(map[string]interface{}), &authInfo, false) - jsCode := "" - // if params.AuthType == weixin.AuthTypeMini { - // jsCode = GetComposedCode(&c.Controller, params.JsCode) - // } - // if params.AuthType == weixin.AuthTypeWxApp { - jsCode = GetComposedCode2(&c.Controller, params.JsCode) - // } + str := []string{ + params.AppID, + params.JsCode, + } + jsCode := strings.Join(str, ",") if err == nil { decryptedDataBase64, err2 := weixin.AutherObjMini.DecryptData(authInfo, jsCode, params.Data, params.Iv) if err = err2; err == nil {