Browse Source

delete user session when admin login

刘河 5 năm trước cách đây
mục cha
commit
614d81f374
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      web/controllers/login.go

+ 2 - 0
web/controllers/login.go

@@ -22,6 +22,8 @@ func (self *LoginController) Verify() {
 	var auth bool
 	if self.GetString("password") == beego.AppConfig.String("web_password") && self.GetString("username") == beego.AppConfig.String("web_username") {
 		self.SetSession("isAdmin", true)
+		self.DelSession("clientId")
+		self.DelSession("username")
 		auth = true
 		server.Bridge.Register.Store(common.GetIpByAddr(self.Ctx.Input.IP()), time.Now().Add(time.Hour*time.Duration(2)))
 	}