瀏覽代碼

redisession

张金坤 8 年之前
父節點
當前提交
92740879d8
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      common/src/github.com/go-xweb/httpsession/redissessionstore.go

+ 3 - 1
common/src/github.com/go-xweb/httpsession/redissessionstore.go

@@ -95,7 +95,9 @@ func (store *redisStore) UpdateByCustomField(findkey string, findvalue interface
 	}
 	var data map[string]interface{}
 	json.Unmarshal(*bs, &data)
-
+	data[setkey] = setvalue
+	putdata, _ := json.Marshal(data)
+	redis.PutBytes("session", findkey, &putdata, int(store.maxAge.Seconds()))
 	store.lock.Unlock()
 	return true
 }