parent
830d617be3
commit
23288d6021
@ -1,4 +1,4 @@
|
||||
{
|
||||
"Upload":"static/upload/",
|
||||
"NoticeServerJiang": true
|
||||
"NoticeServerJiang": false
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package models
|
||||
|
||||
var CustomConfigs []Config
|
||||
type Config struct{
|
||||
ID uint `gorm:"primary_key" json:"id"`
|
||||
ConfName string `json:"conf_name"`
|
||||
ConfKey string `json:"conf_key"`
|
||||
ConfValue string `json:"conf_value"`
|
||||
}
|
||||
|
||||
func FindConfigs()[]Config{
|
||||
var config []Config
|
||||
DB.Find(&config)
|
||||
return config
|
||||
}
|
||||
func InitConfig(){
|
||||
CustomConfigs=FindConfigs()
|
||||
}
|
||||
func FindConfig(key string)string{
|
||||
for _,config:=range CustomConfigs{
|
||||
if key==config.ConfKey{
|
||||
return config.ConfValue
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package tmpl
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/taoshihan1991/imaptool/config"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//咨询界面
|
||||
func PageChat(c *gin.Context) {
|
||||
kefuId := c.Query("kefu_id")
|
||||
lang,_ := c.Get("lang")
|
||||
language:=config.CreateLanguage(lang.(string))
|
||||
refer := c.Query("refer")
|
||||
if refer==""{
|
||||
refer=c.Request.Referer()
|
||||
}
|
||||
c.HTML(http.StatusOK, "chat_page.html", gin.H{
|
||||
"KEFU_ID":kefuId,
|
||||
"SendBtn":language.Send,
|
||||
"Lang":lang.(string),
|
||||
"Refer":refer,
|
||||
})
|
||||
}
|
||||
func PageKfChat(c *gin.Context) {
|
||||
kefuId := c.Query("kefu_id")
|
||||
visitorId:=c.Query("visitor_id")
|
||||
token:=c.Query("token")
|
||||
c.HTML(http.StatusOK, "chat_kf_page.html", gin.H{
|
||||
"KefuId":kefuId,
|
||||
"VisitorId":visitorId,
|
||||
"Token":token,
|
||||
})
|
||||
}
|
Loading…
Reference in new issue