|
@@ -1,40 +1,39 @@
|
|
|
package front
|
|
|
|
|
|
import (
|
|
|
- "fmt"
|
|
|
- "jy/src/jfw/config"
|
|
|
- "jy/src/jfw/jyutil"
|
|
|
- "jy/src/jfw/qrmanager"
|
|
|
- "jy/src/jfw/tag"
|
|
|
- "jy/src/jfw/wx"
|
|
|
- "log"
|
|
|
- "math/rand"
|
|
|
- "net/http"
|
|
|
- "net/url"
|
|
|
- "regexp"
|
|
|
- "strconv"
|
|
|
- "strings"
|
|
|
- "sync"
|
|
|
- "time"
|
|
|
-
|
|
|
- "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
|
|
|
-
|
|
|
- util "app.yhyue.com/moapp/jybase/common"
|
|
|
- . "app.yhyue.com/moapp/jybase/date"
|
|
|
- "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
- "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
|
- "app.yhyue.com/moapp/jypkg/public"
|
|
|
-
|
|
|
- elastic "app.yhyue.com/moapp/jybase/esv1"
|
|
|
- "app.yhyue.com/moapp/jybase/redis"
|
|
|
-
|
|
|
- "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
- "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
- mgdb "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
- . "app.yhyue.com/moapp/jypkg/identity"
|
|
|
- "github.com/SKatiyar/qr"
|
|
|
- "go.mongodb.org/mongo-driver/bson"
|
|
|
- "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
+ "fmt"
|
|
|
+ "jy/src/jfw/config"
|
|
|
+ "jy/src/jfw/jyutil"
|
|
|
+ "jy/src/jfw/qrmanager"
|
|
|
+ "jy/src/jfw/tag"
|
|
|
+ "jy/src/jfw/wx"
|
|
|
+ "log"
|
|
|
+ "math/rand"
|
|
|
+ "net/url"
|
|
|
+ "regexp"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
+ "sync"
|
|
|
+ "time"
|
|
|
+
|
|
|
+ "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
|
|
|
+
|
|
|
+ util "app.yhyue.com/moapp/jybase/common"
|
|
|
+ . "app.yhyue.com/moapp/jybase/date"
|
|
|
+ "app.yhyue.com/moapp/jybase/encrypt"
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
|
+ "app.yhyue.com/moapp/jypkg/public"
|
|
|
+
|
|
|
+ elastic "app.yhyue.com/moapp/jybase/esv1"
|
|
|
+ "app.yhyue.com/moapp/jybase/redis"
|
|
|
+
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
+ mgdb "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
+ . "app.yhyue.com/moapp/jypkg/identity"
|
|
|
+ "github.com/SKatiyar/qr"
|
|
|
+ "go.mongodb.org/mongo-driver/bson"
|
|
|
+ "go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
)
|
|
|
|
|
|
type Front struct {
|
|
@@ -839,22 +838,6 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
|
|
|
} else {
|
|
|
infoData["openid"] = ""
|
|
|
}
|
|
|
- //设置登录过期时间--电脑端
|
|
|
- if typ == "pc" {
|
|
|
- //获取用户是否选择 下次自动登录 ;否:默认7天改成当天;是:session 保存一个月
|
|
|
- //xweb.RootApp().SessionManager.SetMaxAge(time.Duration(10))
|
|
|
- if sessionId := sess.Id(); string(sessionId) != "" {
|
|
|
- keepSessionKey := fmt.Sprint("keepsession_%s", sessionId)
|
|
|
- if b, err := redis.Exists("newother", keepSessionKey); b && err == nil {
|
|
|
- var (
|
|
|
- rw http.ResponseWriter
|
|
|
- expires = util.IntAllDef(config.Sysconfig["setSessionTimeout"], 24)
|
|
|
- )
|
|
|
- sess.SetMaxAge(time.Hour * time.Duration(expires))
|
|
|
- http.SetCookie(rw, CookieRest(string(sessionId), "SESSIONID", expires))
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
//大会员动画 清除首页缓存
|
|
|
redis.Del("other", "jypcindex")
|
|
|
//清除企业基础架构给虚拟账号重置密码后需要重新登录的标识
|
|
@@ -862,22 +845,6 @@ func CreateSession(q map[string]interface{}, sess *httpsession.Session, typ stri
|
|
|
return true, person, infoData
|
|
|
}
|
|
|
|
|
|
-// CookieRest 生成cookie
|
|
|
-func CookieRest(value, name string, expires int) *http.Cookie {
|
|
|
- maxAge := int(time.Hour * time.Duration(expires) / time.Second) //1天,单位秒
|
|
|
- expiresTime := time.Now().Add(time.Duration(expires) * time.Hour)
|
|
|
- cookie := &http.Cookie{
|
|
|
- Name: name,
|
|
|
- Value: value,
|
|
|
- Path: "/",
|
|
|
- HttpOnly: false,
|
|
|
- MaxAge: maxAge,
|
|
|
- Expires: expiresTime,
|
|
|
- Domain: httpsession.Domain,
|
|
|
- }
|
|
|
- return cookie
|
|
|
-}
|
|
|
-
|
|
|
var bindUrl = "/front/account/phone/bind?mode=mergeBind"
|
|
|
|
|
|
//微信跳转创建session
|