1 Star 0 Fork 0

NeP/社联网站

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
present.go 834 Bytes
一键复制 编辑 原始数据 按行查看 历史
NeP 提交于 2022-01-12 00:50 . implement /signup & /login
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func selectClub(c *gin.Context) {
student := getUser(c)
if student == nil {
c.Redirect(http.StatusFound, "/login")
}
c.HTML(http.StatusOK, "clubs.html", nil)
}
func query(c *gin.Context) {
student := getUser(c)
if student == nil {
c.Redirect(http.StatusFound, "/login")
return
}
login := ""
if c.Query("login") != "" {
login = "登录成功!"
}
c.HTML(http.StatusOK, "info.html", login)
}
func shop(c *gin.Context) {
student := getUser(c)
if student == nil {
c.Redirect(http.StatusFound, "/login")
return
}
c.HTML(http.StatusOK, "shop.html", nil)
}
func buy(c *gin.Context) {
student := getUser(c)
if student == nil {
c.Redirect(http.StatusFound, "/login")
return
}
c.HTML(http.StatusOK, "buy.html", c.Query("product"))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/nep-0/club-union-website.git
git@gitee.com:nep-0/club-union-website.git
nep-0
club-union-website
社联网站
master

搜索帮助