Commit 7f2a2a31 authored by chenhan wang's avatar chenhan wang
Browse files

版本1.1

parent be1252fa
package middleware
import (
"github.com/labstack/echo/v4"
//"http/net"
//"pastebin_backend/app/controller"
)
func Auth(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
//c.Bind("User")
/*
cookie, _ := c.Cookie("user")
if cookie == nil {
err := controller.AskPasswd(c)
if err != nil {
return nil
}
}*/
//c.Set("uid", cookie.Value)
c.Set("uid", 114514)
return next(c)
}
}
/*
func CookieAuth(c echo.Context) error{
cookie, err := c.Cookie()
if err != nil {
return err
}
}*/
package middleware
import (
"github.com/labstack/echo/v4"
//"http/net"
//"pastebin_backend/app/controller"
)
func Auth(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
//c.Bind("User")
/*
cookie, _ := c.Cookie("user")
if cookie == nil {
err := controller.AskPasswd(c)
if err != nil {
return nil
}
}*/
//c.Set("uid", cookie.Value)
c.Set("uid", 114514)
return next(c)
}
}
/*
func CookieAuth(c echo.Context) error{
cookie, err := c.Cookie()
if err != nil {
return err
}
}*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment