|
@@ -174,9 +174,16 @@ func (s *sussBi) CheckLoginOut(r *ghttp.Request) bool {
|
|
|
|
|
|
func (s *sussBi) Filter(r *ghttp.Request) error {
|
|
|
ctx := router.GetGContext(r.GetCtx())
|
|
|
+ md5Val := common.GetMd5String(fmt.Sprintf("%s_%s_%d_%d_%d_%d_%d_%d_%s_%d_%s_%d", ctx.Sess.NickName, ctx.Sess.YyName, ctx.Sess.EntRole, ctx.Sess.EntNicheDis, ctx.Sess.PositionId, ctx.Sess.AccountId, ctx.Sess.EntAccountId, ctx.Sess.EntId, ctx.Sess.EntName, ctx.Sess.EntDeptId, ctx.Sess.EntUserName, ctx.Sess.EntUserId))
|
|
|
+ if j_cookie, j_error := r.Request.Cookie("JSESSIONID"); j_error == nil && j_cookie != nil && j_cookie.Value != md5Val {
|
|
|
+ http.SetCookie(r.Response.ResponseWriter, &http.Cookie{
|
|
|
+ Name: "JSESSIONID",
|
|
|
+ MaxAge: -1,
|
|
|
+ })
|
|
|
+ }
|
|
|
http.SetCookie(r.Response.ResponseWriter, &http.Cookie{
|
|
|
Name: "BITOKEN",
|
|
|
- Value: common.GetMd5String(fmt.Sprintf("%s_%s_%d_%d_%d_%d_%d_%d_%s_%d_%s_%d", ctx.Sess.NickName, ctx.Sess.YyName, ctx.Sess.EntRole, ctx.Sess.EntNicheDis, ctx.Sess.PositionId, ctx.Sess.AccountId, ctx.Sess.EntAccountId, ctx.Sess.EntId, ctx.Sess.EntName, ctx.Sess.EntDeptId, ctx.Sess.EntUserName, ctx.Sess.EntUserId)),
|
|
|
+ Value: md5Val,
|
|
|
Path: "/",
|
|
|
HttpOnly: false,
|
|
|
MaxAge: 604800,
|