|
@@ -4,6 +4,7 @@ import (
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"errors"
|
|
"errors"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "github.com/gin-contrib/sessions"
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/gin-gonic/gin"
|
|
|
"net/http"
|
|
"net/http"
|
|
|
"one-api/common"
|
|
"one-api/common"
|
|
@@ -142,9 +143,10 @@ func WeChatBind(c *gin.Context) {
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- id := c.GetInt("id")
|
|
|
|
|
|
|
+ session := sessions.Default(c)
|
|
|
|
|
+ id := session.Get("id")
|
|
|
user := model.User{
|
|
user := model.User{
|
|
|
- Id: id,
|
|
|
|
|
|
|
+ Id: id.(int),
|
|
|
}
|
|
}
|
|
|
err = user.FillUserById()
|
|
err = user.FillUserById()
|
|
|
if err != nil {
|
|
if err != nil {
|