auth middleware
This commit is contained in:
parent
dfb32d4ebe
commit
e9f6a0a1d2
3 changed files with 73 additions and 15 deletions
|
|
@ -45,3 +45,10 @@ func (c *Context) QueryInt64(key string) (int64, error) {
|
|||
query := c.Req.URL.Query()
|
||||
return strconv.ParseInt(query.Get("page"), 10, 64)
|
||||
}
|
||||
|
||||
func (c *Context) Redirect(url string) {
|
||||
if url == "" {
|
||||
url = "/"
|
||||
}
|
||||
http.Redirect(c.Out, c.Req, url, http.StatusFound)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue