简化代码

pull/23/head
taoshihan1991 4 years ago
parent 164ca98b44
commit 09f9e407d2

@ -158,7 +158,7 @@ INSERT INTO `about` (`id`, `title_cn`, `title_en`, `keywords_cn`, `keywords_en`,
GOFLY_LANG:"cn",
})
</script>
<h1>:)</h1><h2> <a href="https://gofly.sopans.com">GOFLY0.3.8</a> 线 !</h2><h3><a href="/login">Administrator</a>&nbsp;<a href="/index_en">English</a>&nbsp;<a href="/index_cn"></a></h3>',
<h1>:)</h1><h2> <a href="https://gofly.sopans.com">GOFLY0.3.9</a> 线 !</h2><h3><a href="/login">Administrator</a>&nbsp;<a href="/index_en">English</a>&nbsp;<a href="/index_cn"></a></h3>',
'<script src="/static/js/gofly-front.js?v=1"></script><script>
GOFLY.init({
GOFLY_URL:"",
@ -167,7 +167,7 @@ INSERT INTO `about` (`id`, `title_cn`, `title_en`, `keywords_cn`, `keywords_en`,
GOFLY_LANG:"en",
})
</script>
<h1>:)</h1><h2>HELLO <a href="https://gofly.sopans.com">GOFLY0.3.8</a> LIVE CHAT !</h2><h3><a href="/login">Administrator</a>&nbsp;<a href="/index_en">English</a>&nbsp;<a href="/index_cn"></a></h3>',
<h1>:)</h1><h2>HELLO <a href="https://gofly.sopans.com">GOFLY0.3.9</a> LIVE CHAT !</h2><h3><a href="/login">Administrator</a>&nbsp;<a href="/index_en">English</a>&nbsp;<a href="/index_cn"></a></h3>',
'index')|
DROP TABLE IF EXISTS `reply_group`|
CREATE TABLE `reply_group` (

@ -1,47 +0,0 @@
package config
type Language struct {
WebCopyRight string
MainIntro string
Send string
Notice, Maintech, NowAsk, LaterAsk string
IndexSubIntro, IndexVisitors, IndexAgent, IndexDocument, IndexOnlineChat string
}
func CreateLanguage(lang string) *Language {
var language *Language
if lang == "en" {
language = &Language{
WebCopyRight: "TaoShihan",
MainIntro: "Simple and Powerful Go language online customer chat system",
IndexSubIntro: "GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers",
IndexDocument: "API Documents",
IndexVisitors: "Visitors Here",
IndexAgent: "Agents Here",
IndexOnlineChat: "Lets chat. - We're online",
Send: "Send",
Notice: "Hello and welcome to go-fly - how can we help?",
Maintech: "Main technical architecture",
NowAsk: "Start Chat",
LaterAsk: "Chat Later",
}
}
if lang == "cn" {
language = &Language{
WebCopyRight: "陶士涵的菜地版权所有",
MainIntro: "极简强大的Go语言在线客服系统",
IndexSubIntro: "GO-FLY一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统",
IndexVisitors: "访客入口",
IndexAgent: "客服入口",
IndexDocument: "接口文档",
IndexOnlineChat: "真人在线-点击与我交流",
Send: "发送",
Notice: "欢迎您访问go-fly有什么我能帮助您的",
Maintech: "主要技术架构",
NowAsk: "现在咨询",
LaterAsk: "稍后再说",
}
}
return language
}

@ -1,20 +0,0 @@
{
"En":{
"WebCopyRight": "TaoShihan",
"MainIntro": "Simple and Powerful Go language online customer chat system",
"IndexSubIntro": "GO-FLY, a Vue 2.0-based online customer service instant messaging system for PHP engineers and Golang engineers",
"IndexDocument":"API Documents",
"IndexVisitors":"Visitors Here",
"IndexAgent":"Agents Here",
"IndexOnlineChat":"Lets chat. - We're online"
},
"Cn":{
"WebCopyRight": "陶士涵的菜地版权所有",
"MainIntro":"极简强大的Go语言在线客服系统",
"IndexSubIntro":"GO-FLY一套为PHP工程师、Golang工程师准备的基于 Vue 2.0的在线客服即时通讯系统",
"IndexVisitors":"访客入口",
"IndexAgent":"客服入口",
"IndexDocument":"接口文档",
"IndexOnlineChat":"在线咨询"
}
}

@ -285,6 +285,10 @@
if (valid) {
this.sendAjax("/kefuinfo","POST",_this.kefuForm,function(result){
_this.kefuDialog=false;
_this.$message({
message: "修改后台账户名后,后台需重新登录",
type: 'success'
});
_this.sendAjax("/kefulist","get",{},function(result){
_this.kefuList=result;
});

@ -191,7 +191,7 @@ new Vue({
var to_id=KEFU_ID;
if(obj){
visitor_id=obj.visitor_id;
to_id=obj.to_id;
//to_id=obj.to_id;
}
let _this=this;
var extra=getQuery("extra");

@ -2,7 +2,6 @@ package tmpl
import (
"github.com/gin-gonic/gin"
"github.com/taoshihan1991/imaptool/config"
"net/http"
)
@ -10,7 +9,6 @@ import (
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()
@ -20,7 +18,6 @@ func PageChat(c *gin.Context) {
}
c.HTML(http.StatusOK, "chat_page.html", gin.H{
"KEFU_ID": kefuId,
"SendBtn": language.Send,
"Lang": lang.(string),
"Refer": refer,
})

@ -2,7 +2,6 @@ package tmpl
import (
"github.com/gin-gonic/gin"
"github.com/taoshihan1991/imaptool/config"
"github.com/taoshihan1991/imaptool/models"
"github.com/taoshihan1991/imaptool/tools"
"html"
@ -53,7 +52,6 @@ func PageIndex(c *gin.Context) {
c.Redirect(302, "/install")
}
lang, _ := c.Get("lang")
language := config.CreateLanguage(lang.(string))
about := models.FindAboutByPageLanguage("index", lang.(string))
cssJs := html.UnescapeString(about.CssJs)
title := about.TitleCn
@ -67,16 +65,12 @@ func PageIndex(c *gin.Context) {
content = html.UnescapeString(about.HtmlEn)
}
c.HTML(http.StatusOK, "index.html", gin.H{
"OnlineChat": language.IndexOnlineChat,
"Notice": language.Notice,
"NowAsk": language.NowAsk,
"LaterAsk": language.LaterAsk,
"Lang": lang,
"Title": title,
"Keywords": keywords,
"Desc": desc,
"Content": template.HTML(content),
"CssJs": template.HTML(cssJs),
"Lang": lang,
"Title": title,
"Keywords": keywords,
"Desc": desc,
"Content": template.HTML(content),
"CssJs": template.HTML(cssJs),
})
}

Loading…
Cancel
Save