浏览代码

Merge branch 'master' of http://192.168.3.207:10080/qmx/jy-data-extract

zhangjinkun 7 年之前
父节点
当前提交
0fdb196ed0
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 0 1
      src/jy/front/front.go
  2. 7 0
      src/jy/router/router.go

+ 0 - 1
src/jy/front/front.go

@@ -29,7 +29,6 @@ func init() {
 func Login(c *gin.Context) {
 	email := c.PostForm("email")
 	pwd := c.PostForm("pwd")
-
 	res, _ := Mgo.FindOne("user", fmt.Sprintf(`{"email":"%s","pwd":"%s"}`, email, Se.EncodeString(pwd)))
 	if res != nil && len(*res) > 0 {
 		session := sessions.Default(c)

+ 7 - 0
src/jy/router/router.go

@@ -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 {