From 61f296e0c641d4105694fd5f1b3af80de44a0b11 Mon Sep 17 00:00:00 2001
From: hoteas <hoteas@958342c6-dd43-9346-b63c-019703d72853>
Date: Sat, 7 Apr 2018 16:54:08 +0000
Subject: [PATCH]

---
 trunk/src/go.hoteas.com/hotime/application.go | 7 ++++---
 trunk/src/go.hoteas.com/hotime/error.go       | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/trunk/src/go.hoteas.com/hotime/application.go b/trunk/src/go.hoteas.com/hotime/application.go
index 07aa2c0..a6cc7ea 100644
--- a/trunk/src/go.hoteas.com/hotime/application.go
+++ b/trunk/src/go.hoteas.com/hotime/application.go
@@ -135,7 +135,8 @@ func (this *Application) SetConfig(configPath ...string) {
 		cmap.JsonToMap(string(btes), &this.Error)
 
 		for k, v := range cmap {
-			this.Config.Put(k, v)
+			this.Config.Put(k, v)//程序配置
+			Config.Put(k,v)//系统配置
 		}
 	}
 	//else {
@@ -214,7 +215,7 @@ func (this *Application) handler(w http.ResponseWriter, req *http.Request) {
 	// 如果token存在就判断token是否在Session中有保存
 	// 如果有取出token并复制给cookie
 	// 没有保存就生成随机的session
-	cookie, err := req.Cookie((this.Config["sessionName"]).(string))
+	cookie, err := req.Cookie(this.Config.GetString("sessionName"))
 	sessionId := Md5(strconv.Itoa(Rand(10)))
 	token := req.FormValue("token")
 	//isFirst:=false
@@ -225,7 +226,7 @@ func (this *Application) handler(w http.ResponseWriter, req *http.Request) {
 		//else{
 		//	isFirst=true;
 		//}
-		http.SetCookie(w, &http.Cookie{Name: this.Config["sessionName"].(string), Value: sessionId, Path: "/"})
+		http.SetCookie(w, &http.Cookie{Name: this.Config.GetString("sessionName"), Value: sessionId, Path: "/"})
 	} else {
 		sessionId = cookie.Value
 	}
diff --git a/trunk/src/go.hoteas.com/hotime/error.go b/trunk/src/go.hoteas.com/hotime/error.go
index a3e170c..558bd5d 100644
--- a/trunk/src/go.hoteas.com/hotime/error.go
+++ b/trunk/src/go.hoteas.com/hotime/error.go
@@ -24,7 +24,7 @@ func(this *Error)SetError(err error,loglevel ...int){
 			return
 		}
 
-		lev:=Config.GetInt("LOG_NIL")
+		lev:=Config.GetInt("logLevel")
 
 		if len(loglevel)!=0{
 			lev=loglevel[0]