Db file change

This commit is contained in:
刘河
2019-03-29 15:21:30 +08:00
parent cd7f99063c
commit 5fd335f330
17 changed files with 597 additions and 567 deletions

View File

@@ -156,13 +156,13 @@ func (s *BaseController) CheckUserAuth() {
if id := s.GetIntNoErr("id"); id != 0 {
belong := false
if strings.Contains(s.actionName, "h") {
if v, ok := file.GetCsvDb().Hosts.Load(id); ok {
if v, ok := file.GetDb().JsonDb.Hosts.Load(id); ok {
if v.(*file.Host).Client.Id == s.GetSession("clientId").(int) {
belong = true
}
}
} else {
if v, ok := file.GetCsvDb().Tasks.Load(id); ok {
if v, ok := file.GetDb().JsonDb.Tasks.Load(id); ok {
if v.(*file.Tunnel).Client.Id == s.GetSession("clientId").(int) {
belong = true
}