This commit is contained in:
邹宗楠
2023-01-31 10:27:15 +08:00
parent c3c7c7ddbd
commit 0f45dee310
8 changed files with 44 additions and 32 deletions

View File

@@ -38,12 +38,16 @@ func GetComposedCode2(c *web.Controller, code string) (composedCode string) {
composedCode = code
referer := c.Ctx.Request.UserAgent()
index := strings.Index(referer, "//")
globals.SugarLogger.Debugf("====GetComposedCode2==== %s", referer)
if index > 0 {
list := strings.Split(referer[index+2:], "/")
globals.SugarLogger.Debugf("====GetComposedCode2===list= %s", utils.Format4Output(list, false))
if len(list) >= 2 {
composedCode = weixin.ComposeJsCode(list[1], code)
}
}
globals.SugarLogger.Debugf("====composedCode===list= %s", utils.Format4Output(composedCode, false))
return composedCode
}
@@ -123,7 +127,7 @@ func (c *Auth2Controller) Login() {
if params.AuthType == weixin.AuthTypeMini {
params.AuthSecret = GetComposedCode(&c.Controller, params.AuthSecret)
}
if params.AuthType == weixin.AuthTypeWxApp {
if params.AuthType == weixin.AuthTypeWxApp || params.AuthType == weixin.AuthTypeWxAppCaishi {
//if configs, _ := dao.QueryConfigs(dao.GetDB(), "checkversion", model.ConfigTypeSys, ""); len(configs) > 0 {
// if params.Version == "" || configs[0].Value != params.Version {
// return nil, "", fmt.Errorf("当前APP版本过旧数据显示有错误请到'京西菜市'公众号下载最新版本APP")