|
@@ -24,6 +24,9 @@ var expertReg = regexp.MustCompile("^/bigmember/(potential|report)/.+$")
|
|
//智慧版
|
|
//智慧版
|
|
var wisdomReg = regexp.MustCompile("^/bigmember/(forecast|decision)/.+$")
|
|
var wisdomReg = regexp.MustCompile("^/bigmember/(forecast|decision)/.+$")
|
|
|
|
|
|
|
|
+//试用版
|
|
|
|
+var trialReg = regexp.MustCompile("^/bigmember/(forecast|decision)/.+$")
|
|
|
|
+
|
|
//继承过滤器方法
|
|
//继承过滤器方法
|
|
func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
|
|
func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
|
|
session := l.App.SessionManager.Session(req, w)
|
|
session := l.App.SessionManager.Session(req, w)
|
|
@@ -31,7 +34,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
userId, _ := session.Get("userId").(string)
|
|
userId, _ := session.Get("userId").(string)
|
|
- status := util.Power(userId) //1:专家版,2:智慧版,3:商机版,
|
|
|
|
|
|
+ status := util.Power(userId) //1:专家版,2:智慧版,3:商机版,4:试用版
|
|
if status <= 0 {
|
|
if status <= 0 {
|
|
R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
|
|
R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
|
|
return false
|
|
return false
|
|
@@ -42,6 +45,9 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
|
|
} else if status == 3 && wisdomReg.MatchString(req.URL.Path) {
|
|
} else if status == 3 && wisdomReg.MatchString(req.URL.Path) {
|
|
R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
|
|
R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
|
|
return false
|
|
return false
|
|
|
|
+ } else if status == 4 && trialReg.MatchString(req.URL.Path) {
|
|
|
|
+ R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
return true
|
|
return true
|
|
}
|
|
}
|