12345678910111213141516171819202122232425262728293031323334 |
- package filter
- import (
- "app.yhyue.com/moapp/jybase/redis"
- "fmt"
- "jy-merge/common/jy"
- "jy-merge/public"
- "log"
- "net/http"
- "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
- )
- //用户合并删除用户检测
- type mergeFilter struct {
- W http.ResponseWriter
- R *http.Request
- Session *httpsession.Session
- GetSession map[string]interface{}
- }
- func (l *mergeFilter) Do() bool {
- //账户合并-刷新session
- if uid := l.GetSession["userId"]; uid != nil && uid != "" {
- if val := redis.Get("session", fmt.Sprintf("usermerge_delete_%s", uid)); val != nil {
- if sUid, ok := val.(string); sUid != "" && ok {
- log.Printf("账户合并 mergeFilter 自动刷新session old:%s new:%s\n", uid, sUid)
- jy.CreateUserMerge(public.MQFW, public.MainMysql, l.Session).FlushSession(nil, sUid)
- return true
- }
- }
- }
- return true
- }
|