memos/api/utils.go
2021-12-08 23:43:14 +08:00

12 lines
172 B
Go

package api
import (
"net/http"
)
func GetUserIdInCookie(r *http.Request) (string, error) {
userIdCookie, err := r.Cookie("user_id")
return userIdCookie.Value, err
}