- 添加用户最后登录信息

This commit is contained in:
gazebo
2019-09-24 18:09:32 +08:00
parent 412b11396a
commit bf86235ce2
4 changed files with 35 additions and 7 deletions

View File

@@ -88,7 +88,8 @@ func (c *Auth2Controller) Login() {
if params.AuthType == weixin.AuthTypeMini {
params.AuthSecret = GetComposedCode(&c.Controller, params.AuthSecret)
}
retVal, err = auth2.Login(params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret)
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
retVal, err = auth2.Login(ctx, params.AuthType, params.AuthID, params.AuthIDType, params.AuthSecret)
return retVal, "", err
})
}
@@ -127,7 +128,8 @@ func (c *Auth2Controller) WeixinOAuth2() {
callResult *CallResult
)
c.callWeixinOAuth2(func(params *tAuth2WeixinOAuth2Params) (retVal interface{}, errCode string, err error) {
authInfo, err := auth2.Login(weixin.AuthTypeWeixin, params.State, "", params.Code)
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
authInfo, err := auth2.Login(ctx, weixin.AuthTypeWeixin, params.State, "", params.Code)
if err == nil {
callResult = &CallResult{
Code: model.ErrCodeSuccess,
@@ -160,7 +162,8 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
callResult *CallResult
)
c.callWeixinMPOAuth2(func(params *tAuth2WeixinMPOAuth2Params) (retVal interface{}, errCode string, err error) {
authInfo, err := auth2.Login(weixin.AuthTypeMP, params.State, "", params.Code)
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
authInfo, err := auth2.Login(ctx, weixin.AuthTypeMP, params.State, "", params.Code)
if err == nil {
callResult = &CallResult{
Code: model.ErrCodeSuccess,
@@ -197,7 +200,8 @@ func (c *Auth2Controller) DingDingOAuth2() {
params.Block = params.State
params.State = ""
}
authInfo, err := auth2.Login(dingding.AuthTypeQRCode, params.State, "", params.Code)
ctx := auth2.NewContext(c.Ctx.ResponseWriter, c.Ctx.Request)
authInfo, err := auth2.Login(ctx, dingding.AuthTypeQRCode, params.State, "", params.Code)
if err == nil {
callResult = &CallResult{
Code: model.ErrCodeSuccess,