Browse Source

Merge branch 'dev1.4.1' of http://192.168.3.207:10080/qmx/datatag into dev1.4.1

xuzhiheng 4 years ago
parent
commit
5d1cf1e925
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/filter/filter.go
  2. 1 1
      src/filter/sessfilter.go

+ 2 - 2
src/filter/filter.go

@@ -10,12 +10,12 @@ import (
 //需要系统管理员权限
 
 
-var CustomerReg = regexp.MustCompile("^/client|customerRule/.+$")
+var CustomerReg = regexp.MustCompile("^/client|customerRule|personnel/.+$")
 
 func init() {
 	log.Println("过滤器")
 	matchUrl := make([]*regexp.Regexp, 0)
-	filter, _ := regexp.Compile("/(front|service|client|customerRule)")
+	filter, _ := regexp.Compile("/(front|service|client|customerRule|admin|personnel)")
 	matchUrl = append(matchUrl, filter)
 	xweb.AddFilter(&sessfilter{App: xweb.RootApp(), SessionName: "user",
 		MatchUrl: matchUrl})

+ 1 - 1
src/filter/sessfilter.go

@@ -33,7 +33,7 @@ func (s *sessfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 					b = false
 				}
 			}
-			if user["role"] == ""{
+			if user["role"] == "" || user["role"] == nil {
 				b = false
 			}
 		} else {