|
@@ -1,11 +1,14 @@
|
|
|
package router
|
|
|
|
|
|
import (
|
|
|
+ "encoding/gob"
|
|
|
"net/http"
|
|
|
+ "time"
|
|
|
|
|
|
"github.com/gin-contrib/sessions"
|
|
|
"github.com/gin-contrib/sessions/memstore"
|
|
|
"github.com/gin-gonic/gin"
|
|
|
+ "gopkg.in/mgo.v2/bson"
|
|
|
)
|
|
|
|
|
|
var Router = gin.Default()
|
|
@@ -13,6 +16,10 @@ var Router = gin.Default()
|
|
|
func init() {
|
|
|
store := memstore.NewStore([]byte("jy_data_extract"))
|
|
|
Router.Use(sessions.Sessions("mysession", store))
|
|
|
+ gob.Register(&map[string]interface{}{})
|
|
|
+ gob.Register(&[]map[string]interface{}{})
|
|
|
+ gob.Register(&time.Time{})
|
|
|
+ gob.Register(bson.ObjectIdHex("518781f5904a2ea61544f852"))
|
|
|
}
|
|
|
|
|
|
func AuthMiddleWare() gin.HandlerFunc {
|