You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-fly/router/view.go

58 lines
1.1 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

package router
import (
"github.com/gin-gonic/gin"
"net/http"
)
func InitViewRouter(engine *gin.Engine) {
//engine.GET("/", tmpl.PageIndex)
engine.GET("/login", PageLogin)
engine.GET("/pannel", PagePannel)
engine.GET("/livechat", PageChat)
engine.GET("/main", PageMain)
engine.GET("/chat_main", PageChatMain)
engine.GET("/setting", PageSetting)
}
// 登陆界面
func PageLogin(c *gin.Context) {
c.HTML(http.StatusOK, "login.html", nil)
}
// 面板界面
func PagePannel(c *gin.Context) {
c.HTML(http.StatusOK, "pannel.html", nil)
}
// 后台界面
func PageMain(c *gin.Context) {
c.HTML(http.StatusOK, "main.html", nil)
}
// 咨询界面
func PageChat(c *gin.Context) {
kefuId := c.Query("user_id")
refer := c.Query("refer")
if refer == "" {
refer = c.Request.Referer()
}
if refer == "" {
refer = "Direct Link"
}
c.HTML(http.StatusOK, "chat_page.html", gin.H{
"KEFU_ID": kefuId,
"Refer": refer,
})
}
// 客服界面
func PageChatMain(c *gin.Context) {
c.HTML(http.StatusOK, "chat_main.html", nil)
}
// 设置界面
func PageSetting(c *gin.Context) {
c.HTML(http.StatusOK, "setting.html", nil)
}