fix: add aicss path prefix
This commit is contained in:
parent
25d823769f
commit
2e7fb387cf
@ -10,6 +10,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/spf13/cobra"
|
||||
@ -54,10 +55,13 @@ func run() {
|
||||
log.Println("start server...\r\ngo:http://" + baseServer)
|
||||
tools.Logger().Println("start server...\r\ngo:http://" + baseServer)
|
||||
|
||||
engine := gin.Default()
|
||||
var (
|
||||
engine = gin.Default()
|
||||
basePath = "aicss"
|
||||
)
|
||||
engine.LoadHTMLGlob("static/templates/*")
|
||||
engine.Static("/assets", "./static")
|
||||
engine.Static("/static", "./static")
|
||||
engine.Static(path.Join(basePath, "/assets"), "./static")
|
||||
engine.Static(path.Join(basePath, "/static"), "./static")
|
||||
engine.Use(tools.Session("gofly"))
|
||||
engine.Use(middleware.CrossSite)
|
||||
//性能监控
|
||||
@ -66,8 +70,9 @@ func run() {
|
||||
//记录日志
|
||||
engine.Use(middleware.NewMidLogger())
|
||||
engine.Use(xpink_auth.MiddlewareSetIdentity)
|
||||
router.InitViewRouter(engine)
|
||||
router.InitApiRouter(engine)
|
||||
routerGroup := engine.Group(basePath)
|
||||
router.InitViewRouter(routerGroup)
|
||||
router.InitApiRouter(routerGroup)
|
||||
//记录pid
|
||||
os.WriteFile("gofly.sock", []byte(fmt.Sprintf("%d,%d", os.Getppid(), os.Getpid())), 0666)
|
||||
//限流类
|
||||
|
||||
@ -183,7 +183,7 @@ func PostKefuRegister(c *gin.Context) {
|
||||
name := c.PostForm("username")
|
||||
password := c.PostForm("password")
|
||||
nickname := c.PostForm("nickname")
|
||||
avatar := "/static/images/4.jpg"
|
||||
avatar := "/aicss/static/images/4.jpg"
|
||||
|
||||
if name == "" || password == "" {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
|
||||
@ -2,6 +2,7 @@ package controller
|
||||
|
||||
import (
|
||||
"ai-css/models"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
@ -64,9 +64,9 @@ func PostVisitorLogin(c *gin.Context) {
|
||||
avator := ""
|
||||
userAgent := c.GetHeader("User-Agent")
|
||||
if tools.IsMobile(userAgent) {
|
||||
avator = "/static/images/1.png"
|
||||
avator = "/aicss/static/images/1.png"
|
||||
} else {
|
||||
avator = "/static/images/2.png"
|
||||
avator = "/aicss/static/images/2.png"
|
||||
}
|
||||
|
||||
toId := c.PostForm("to_id")
|
||||
|
||||
@ -8,7 +8,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitApiRouter(engine *gin.Engine) {
|
||||
func InitApiRouter(engine *gin.RouterGroup) {
|
||||
//路由分组
|
||||
v2 := engine.Group("/2")
|
||||
{
|
||||
|
||||
@ -3,10 +3,11 @@ package router
|
||||
import (
|
||||
"ai-css/middleware"
|
||||
"ai-css/tmpl"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitViewRouter(engine *gin.Engine) {
|
||||
func InitViewRouter(engine *gin.RouterGroup) {
|
||||
engine.GET("/", tmpl.PageIndex)
|
||||
|
||||
engine.GET("/login", tmpl.PageLogin)
|
||||
|
||||
@ -94,7 +94,7 @@ var faceTitles = ["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[
|
||||
function placeFace() {
|
||||
var faces=[];
|
||||
for(var i=0;i<faceTitles.length;i++){
|
||||
faces[faceTitles[i]]="/static/images/face/"+i+".gif";
|
||||
faces[faceTitles[i]]="/aicss/static/images/face/"+i+".gif";
|
||||
}
|
||||
return faces;
|
||||
}
|
||||
@ -129,49 +129,49 @@ function replaceAttachment(str){
|
||||
var imgSrc="";
|
||||
switch(info.ext){
|
||||
case ".mp3":
|
||||
imgSrc="/static/images/ext/MP3.png";
|
||||
imgSrc="/aicss/static/images/ext/MP3.png";
|
||||
break;
|
||||
case ".zip":
|
||||
imgSrc="/static/images/ext/ZIP.png";
|
||||
imgSrc="/aicss/static/images/ext/ZIP.png";
|
||||
break;
|
||||
case ".txt":
|
||||
imgSrc="/static/images/ext/TXT.png";
|
||||
imgSrc="/aicss/static/images/ext/TXT.png";
|
||||
break;
|
||||
case ".7z":
|
||||
imgSrc="/static/images/ext/7z.png";
|
||||
imgSrc="/aicss/static/images/ext/7z.png";
|
||||
break;
|
||||
case ".bpm":
|
||||
imgSrc="/static/images/ext/BMP.png";
|
||||
imgSrc="/aicss/static/images/ext/BMP.png";
|
||||
break;
|
||||
case ".png":
|
||||
imgSrc="/static/images/ext/PNG.png";
|
||||
imgSrc="/aicss/static/images/ext/PNG.png";
|
||||
break;
|
||||
case ".jpg":
|
||||
imgSrc="/static/images/ext/JPG.png";
|
||||
imgSrc="/aicss/static/images/ext/JPG.png";
|
||||
break;
|
||||
case ".jpeg":
|
||||
imgSrc="/static/images/ext/JPEG.png";
|
||||
imgSrc="/aicss/static/images/ext/JPEG.png";
|
||||
break;
|
||||
case ".pdf":
|
||||
imgSrc="/static/images/ext/PDF.png";
|
||||
imgSrc="/aicss/static/images/ext/PDF.png";
|
||||
break;
|
||||
case ".doc":
|
||||
imgSrc="/static/images/ext/DOC.png";
|
||||
imgSrc="/aicss/static/images/ext/DOC.png";
|
||||
break;
|
||||
case ".docx":
|
||||
imgSrc="/static/images/ext/DOCX.png";
|
||||
imgSrc="/aicss/static/images/ext/DOCX.png";
|
||||
break;
|
||||
case ".rar":
|
||||
imgSrc="/static/images/ext/RAR.png";
|
||||
imgSrc="/aicss/static/images/ext/RAR.png";
|
||||
break;
|
||||
case ".xlsx":
|
||||
imgSrc="/static/images/ext/XLSX.png";
|
||||
imgSrc="/aicss/static/images/ext/XLSX.png";
|
||||
break;
|
||||
case ".csv":
|
||||
imgSrc="/static/images/ext/XLSX.png";
|
||||
imgSrc="/aicss/static/images/ext/XLSX.png";
|
||||
break;
|
||||
default:
|
||||
imgSrc="/static/images/ext/default.png";
|
||||
imgSrc="/aicss/static/images/ext/default.png";
|
||||
break;
|
||||
}
|
||||
var html= `<div onclick="window.open('`+info.path+`')" class="productCard">
|
||||
|
||||
@ -25,7 +25,7 @@ GOFLY.init=function(config){
|
||||
if (typeof config.GOFLY_URL!="undefined"){
|
||||
this.GOFLY_URL=config.GOFLY_URL.replace(/([\w\W]+)\/$/,"$1");
|
||||
}
|
||||
this.dynamicLoadCss(this.GOFLY_URL+"/static/css/gofly-front.css?v=1");
|
||||
this.dynamicLoadCss(this.GOFLY_URL+"/aicss/static/css/gofly-front.css?v=1");
|
||||
|
||||
if (typeof config.GOFLY_KEFU_ID!="undefined"){
|
||||
this.GOFLY_KEFU_ID=config.GOFLY_KEFU_ID;
|
||||
@ -50,7 +50,7 @@ GOFLY.init=function(config){
|
||||
this.GOFLY_EXTRA.host=document.location.href;
|
||||
this.GOFLY_EXTRA=JSON.stringify(_this.GOFLY_EXTRA);
|
||||
|
||||
this.dynamicLoadJs(this.GOFLY_URL+"/assets/js/functions.js?v=1",function(){
|
||||
this.dynamicLoadJs(this.GOFLY_URL+"/aicss/assets/js/functions.js?v=1",function(){
|
||||
if (typeof config.GOFLY_LANG!="undefined"){
|
||||
_this.GOFLY_LANG=config.GOFLY_LANG;
|
||||
}else{
|
||||
|
||||
@ -54,19 +54,19 @@ KEFU.init=function(config){
|
||||
if (typeof config.KEFU_URL!="undefined"){
|
||||
this.KEFU_URL=config.KEFU_URL.replace(/([\w\W]+)\/$/,"$1");
|
||||
}
|
||||
this.dynamicLoadCss(this.KEFU_URL+"/static/css/kefu-front.css?v="+Date.now());
|
||||
this.dynamicLoadCss(this.KEFU_URL+"/static/css/layui/css/layui.css?v="+Date.now());
|
||||
this.dynamicLoadCss(this.KEFU_URL+"/aicss/static/css/kefu-front.css?v="+Date.now());
|
||||
this.dynamicLoadCss(this.KEFU_URL+"/aicss/static/css/layui/css/layui.css?v="+Date.now());
|
||||
|
||||
var refer=document.referrer?document.referrer:"none";
|
||||
this.KEFU_EXTRA.refer=refer;
|
||||
this.KEFU_EXTRA.host=document.location.href;
|
||||
this.KEFU_EXTRA=JSON.stringify(_this.KEFU_EXTRA);
|
||||
|
||||
this.dynamicLoadJs(this.KEFU_URL+"/static/js/functions.js?v=1",function(){
|
||||
this.dynamicLoadJs(this.KEFU_URL+"/aicss/static/js/functions.js?v=1",function(){
|
||||
|
||||
_this.dynamicLoadJs("https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js",function () {
|
||||
jQuery.noConflict();
|
||||
_this.dynamicLoadJs(_this.KEFU_URL+"/static/js/layer/layer.js",function () {
|
||||
_this.dynamicLoadJs(_this.KEFU_URL+"/aicss/static/js/layer/layer.js",function () {
|
||||
_this.jsCallBack();
|
||||
});
|
||||
});
|
||||
@ -292,7 +292,7 @@ KEFU.layerOpen=function (width,height,offset){
|
||||
var title=`
|
||||
<div class="kfBar">
|
||||
<div class="kfBarAvator">
|
||||
<img src="`+this.KEFU_URL+`/static/images/4.jpg" class="kfBarLogo">
|
||||
<img src="`+this.KEFU_URL+`/aicss/static/images/4.jpg" class="kfBarLogo">
|
||||
|
||||
</div>
|
||||
<div class="kfBarText">
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" href="/static/images/favicon.ico">
|
||||
<link rel="icon" href="/aicss/static/images/favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" class="signin">
|
||||
@ -107,7 +107,7 @@
|
||||
phone:this.kefuForm.phone,
|
||||
password:this.kefuForm.password,
|
||||
};
|
||||
$.post("/2/bindOfficial", data, function (data) {
|
||||
$.post("/aicss/2/bindOfficial", data, function (data) {
|
||||
if (data == "success") {
|
||||
_this.$message({
|
||||
message: "认证成功!",
|
||||
|
||||
@ -4,14 +4,14 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<title>GOFLY - Open Source Customer Support System</title>
|
||||
<link rel="stylesheet" href="/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/common.css?v=dgftr65ujhfg">
|
||||
<script src="/assets/js/functions.js"></script>
|
||||
<script src="/assets/js/reconnecting-websocket.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/icon/iconfont.css?v=fgjlgfda"/>
|
||||
<link rel="stylesheet" href="/aicss/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/aicss/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/aicss/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/aicss/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/css/common.css?v=dgftr65ujhfg">
|
||||
<script src="/aicss/assets/js/functions.js"></script>
|
||||
<script src="/aicss/assets/js/reconnecting-websocket.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/css/icon/iconfont.css?v=fgjlgfda"/>
|
||||
<style>
|
||||
html, body {overflow:hidden;height: 100%;padding: 0;margin: 0;background-color: #f5f5f5;}
|
||||
.el-row{width:100%}
|
||||
@ -125,11 +125,11 @@
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="Upload Image" placement="top">
|
||||
<div class="iconBtn el-icon-picture" id="uploadImg" v-on:click="uploadImg('/uploadimg')" style="font-size: 24px;"></div>
|
||||
<div class="iconBtn el-icon-picture" id="uploadImg" v-on:click="uploadImg('/aicss/uploadimg')" style="font-size: 24px;"></div>
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="Upload File" placement="top">
|
||||
<div class="iconBtn el-icon-upload" id="uploadFile" v-on:click="uploadFile('/uploadfile')" style="font-size: 26px;"></div>
|
||||
<div class="iconBtn el-icon-upload" id="uploadFile" v-on:click="uploadFile('/aicss/uploadfile')" style="font-size: 26px;"></div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
@ -252,15 +252,15 @@
|
||||
|
||||
<!-- Image Preview -->
|
||||
<div id="bigPic" class="bigPic">
|
||||
<img src="/static/images/3.jpg"/>
|
||||
<img src="/aicss/static/images/3.jpg"/>
|
||||
</div>
|
||||
|
||||
<!-- Audio Elements -->
|
||||
<audio id="chatMessageAudio">
|
||||
<source id="chatMessageAudioSource" src="/static/images/alert2.ogg" type="audio/mpeg" />
|
||||
<source id="chatMessageAudioSource" src="/aicss/static/images/alert2.ogg" type="audio/mpeg" />
|
||||
</audio>
|
||||
<audio id="chatMessageSendAudio">
|
||||
<source id="chatMessageSendAudioSource" src="/static/images/sent.ogg" type="audio/mpeg" />
|
||||
<source id="chatMessageSendAudioSource" src="/aicss/static/images/sent.ogg" type="audio/mpeg" />
|
||||
</audio>
|
||||
|
||||
<!-- Transfer Dialog -->
|
||||
@ -321,7 +321,7 @@
|
||||
rightTabActive:"visitorInfo",
|
||||
users:[],
|
||||
usersMap:[],
|
||||
server:getWsBaseUrl()+"/ws_kefu?aicss-token="+localStorage.getItem("aicss-token"),
|
||||
server:getWsBaseUrl()+"/aicss/ws_kefu?aicss-token="+localStorage.getItem("aicss-token"),
|
||||
//server:getWsBaseUrl()+"/chat_server",
|
||||
socket:null,
|
||||
socketClosed:false,
|
||||
@ -420,7 +420,7 @@
|
||||
confirmButtonText: '确定',
|
||||
callback:function () {
|
||||
localStorage.removeItem("aicss-token");
|
||||
window.location.href="/login";
|
||||
window.location.href="/aicss/login";
|
||||
}
|
||||
});
|
||||
|
||||
@ -532,7 +532,7 @@
|
||||
mes.from_id = this.kfConfig.id;
|
||||
mes.to_id = this.currentGuest;
|
||||
mes.content = this.messageContent;
|
||||
this.sendAjax("/kefu/message","POST",mes,function(res){
|
||||
this.sendAjax("/aicss/kefu/message","POST",mes,function(res){
|
||||
_this.sendDisabled=false;
|
||||
if(res.code!=200){
|
||||
_this.$message({
|
||||
@ -638,7 +638,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/kefuinfo",
|
||||
url:"/aicss/kefuinfo",
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
},
|
||||
@ -663,7 +663,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/visitors_kefu_online",
|
||||
url:"/aicss/visitors_kefu_online",
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
},
|
||||
@ -681,7 +681,7 @@
|
||||
});
|
||||
}
|
||||
if(data.code==400){
|
||||
window.location.href="/login";
|
||||
window.location.href="/aicss/login";
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -693,7 +693,7 @@
|
||||
visitor_id: this.currentGuest,
|
||||
}
|
||||
let _this=this;
|
||||
$.get("/2/messagesPages",params,function(res){
|
||||
$.get("/aicss/2/messagesPages",params,function(res){
|
||||
let msgList=res.result.list;
|
||||
if(msgList.length>=_this.messages.pagesize){
|
||||
_this.showLoadMore=true;
|
||||
@ -727,7 +727,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/messages?visitorId="+visitorId,
|
||||
url:"/aicss/messages?visitorId="+visitorId,
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
},
|
||||
@ -765,7 +765,7 @@
|
||||
});
|
||||
}
|
||||
if(data.code==400){
|
||||
window.location.href="/login";
|
||||
window.location.href="/aicss/login";
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -775,7 +775,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/visitor",
|
||||
url:"/aicss/visitor",
|
||||
data:{visitorId:vid},
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
@ -826,7 +826,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/2/message_close",
|
||||
url:"/aicss/2/message_close",
|
||||
data:{visitor_id:visitorId},
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
@ -862,7 +862,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/visitors",
|
||||
url:"/aicss/visitors",
|
||||
data:{page:page},
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
@ -991,7 +991,7 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"/ipblack",
|
||||
url:"/aicss/ipblack",
|
||||
data:{ip:ip},
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
@ -1030,7 +1030,7 @@
|
||||
var formData = new FormData();
|
||||
formData.append('imgfile', file);
|
||||
$.ajax({
|
||||
url: '/uploadimg',
|
||||
url: '/aicss/uploadimg',
|
||||
type: "post",
|
||||
data: formData,
|
||||
contentType: false,
|
||||
@ -1071,14 +1071,14 @@
|
||||
transKefu(){
|
||||
this.transKefuDialog=true;
|
||||
var _this=this;
|
||||
this.sendAjax("/other_kefulist","get",{},function(result){
|
||||
this.sendAjax("/aicss/other_kefulist","get",{},function(result){
|
||||
_this.otherKefus=result;
|
||||
});
|
||||
},
|
||||
//转移访客客服
|
||||
transKefuVisitor(kefu,visitorId){
|
||||
var _this=this;
|
||||
this.sendAjax("/trans_kefu","get",{kefu_id:kefu,visitor_id:visitorId},function(result){
|
||||
this.sendAjax("/aicss/trans_kefu","get",{kefu_id:kefu,visitor_id:visitorId},function(result){
|
||||
//_this.otherKefus=result;
|
||||
_this.transKefuDialog = false
|
||||
});
|
||||
@ -1086,7 +1086,7 @@
|
||||
//保存回复分组
|
||||
addReplyGroup(){
|
||||
var _this=this;
|
||||
this.sendAjax("/reply","post",{group_name:_this.groupName},function(result){
|
||||
this.sendAjax("/aicss/reply","post",{group_name:_this.groupName},function(result){
|
||||
//_this.otherKefus=result;
|
||||
_this.replyGroupDialog = false
|
||||
_this.groupName="";
|
||||
@ -1096,7 +1096,7 @@
|
||||
//添加回复内容
|
||||
addReplyContent(){
|
||||
var _this=this;
|
||||
this.sendAjax("/reply_content","post",{group_id:_this.groupId,item_name:_this.replyTitle,content:_this.replyContent},function(result){
|
||||
this.sendAjax("/aicss/reply_content","post",{group_id:_this.groupId,item_name:_this.replyTitle,content:_this.replyContent},function(result){
|
||||
//_this.otherKefus=result;
|
||||
_this.replyContentDialog = false
|
||||
_this.replyContent="";
|
||||
@ -1106,21 +1106,21 @@
|
||||
//获取快捷回复
|
||||
getReplys(){
|
||||
var _this=this;
|
||||
this.sendAjax("/replys","get",{},function(result){
|
||||
this.sendAjax("/aicss/replys","get",{},function(result){
|
||||
_this.replys=result;
|
||||
});
|
||||
},
|
||||
//删除回复
|
||||
deleteReplyGroup(id){
|
||||
var _this=this;
|
||||
this.sendAjax("/reply?id="+id,"delete",{},function(result){
|
||||
this.sendAjax("/aicss/reply?id="+id,"delete",{},function(result){
|
||||
_this.getReplys();
|
||||
});
|
||||
},
|
||||
//删除回复
|
||||
deleteReplyContent(id){
|
||||
var _this=this;
|
||||
this.sendAjax("/reply_content?id="+id,"delete",{},function(result){
|
||||
this.sendAjax("/aicss/reply_content?id="+id,"delete",{},function(result){
|
||||
_this.getReplys();
|
||||
});
|
||||
},
|
||||
@ -1133,7 +1133,7 @@
|
||||
reply_title:this.replyTitle,
|
||||
reply_content:this.replyContent
|
||||
}
|
||||
this.sendAjax("/reply_content_save","post",data,function(result){
|
||||
this.sendAjax("/aicss/reply_content_save","post",data,function(result){
|
||||
_this.editReplyContentDialog=false;
|
||||
_this.getReplys();
|
||||
});
|
||||
@ -1152,7 +1152,7 @@
|
||||
if(this.replySearch==""){
|
||||
_this.replySearchList=[];
|
||||
}
|
||||
this.sendAjax("/reply_search","post",{search:this.replySearch},function(result){
|
||||
this.sendAjax("/aicss/reply_search","post",{search:this.replySearch},function(result){
|
||||
_this.replySearchList=result;
|
||||
for (var i in result) {
|
||||
_this.replySearchListActive.push(result[i].group_id);
|
||||
@ -1162,15 +1162,15 @@
|
||||
//获取黑名单
|
||||
getIpblacks(){
|
||||
var _this=this;
|
||||
this.sendAjax("/ipblacks","get",{},function(result){
|
||||
this.sendAjax("/aicss/ipblacks","get",{},function(result){
|
||||
_this.ipBlacks=result;
|
||||
});
|
||||
},
|
||||
//删除黑名单
|
||||
delIpblack(ip){
|
||||
let _this=this;
|
||||
this.sendAjax("/ipblack?ip="+ip,"DELETE",{ip:ip},function(result){
|
||||
_this.sendAjax("/ipblacks","get",{},function(result){
|
||||
this.sendAjax("/aicss/ipblack?ip="+ip,"DELETE",{ip:ip},function(result){
|
||||
_this.sendAjax("/aicss/ipblacks","get",{},function(result){
|
||||
_this.ipBlacks=result;
|
||||
});
|
||||
});
|
||||
|
||||
@ -72,17 +72,17 @@
|
||||
applyBodyClass();
|
||||
})();
|
||||
</script>
|
||||
<link rel="stylesheet" href="/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/aicss/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/aicss/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/aicss/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
|
||||
<script src="/assets/js/functions.js?v=fgffdwersdccvcbv"></script>
|
||||
<script src="/assets/js/reconnecting-websocket.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/common.css?v=sdsderfrgfgdfdf" />
|
||||
<link rel="stylesheet" href="/static/css/icono.min.css" />
|
||||
<link rel="stylesheet" href="/static/css/icon/iconfont.css?v=fgjlgfda"/>
|
||||
<link rel="stylesheet" href="/static/css/dark-mode.css" />
|
||||
<script src="/aicss/assets/js/functions.js?v=fgffdwersdccvcbv"></script>
|
||||
<script src="/aicss/assets/js/reconnecting-websocket.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/css/common.css?v=sdsderfrgfgdfdf" />
|
||||
<link rel="stylesheet" href="/aicss/static/css/icono.min.css" />
|
||||
<link rel="stylesheet" href="/aicss/static/css/icon/iconfont.css?v=fgjlgfda"/>
|
||||
<link rel="stylesheet" href="/aicss/static/css/dark-mode.css" />
|
||||
</head>
|
||||
<body class="visitorBody">
|
||||
<div id="app" class="chatCenter">
|
||||
@ -216,7 +216,7 @@
|
||||
delimiters:["<{","}>"],
|
||||
data: {
|
||||
window:window,
|
||||
server:getWsBaseUrl()+"/ws_visitor",
|
||||
server:getWsBaseUrl()+"/aicss/ws_visitor",
|
||||
socket:null,
|
||||
msgList:[],
|
||||
msgListNum:[],
|
||||
@ -368,8 +368,7 @@
|
||||
mes.from_id = this.visitor.visitor_id;
|
||||
mes.to_id = this.visitor.to_id;
|
||||
mes.content = this.messageContent;
|
||||
this.messageContent = ""
|
||||
$.post("/2/message",mes,function(res){
|
||||
$.post("/aicss/2/message",mes,function(res){
|
||||
_this.sendDisabled=false;
|
||||
if(res.code!=200){
|
||||
_this.msgList.pop();
|
||||
@ -398,7 +397,7 @@
|
||||
}
|
||||
let _this=this;
|
||||
var extra=getQuery("extra");
|
||||
$.post("/visitor_login",{visitor_id:visitor_id,refer:REFER,to_id:to_id,extra:extra},function(res){
|
||||
$.post("/aicss/visitor_login",{visitor_id:visitor_id,refer:REFER,to_id:to_id,extra:extra},function(res){
|
||||
if(res.code!=200){
|
||||
_this.$message({
|
||||
message: res.msg,
|
||||
@ -420,7 +419,7 @@
|
||||
visitor_id: this.visitor.visitor_id,
|
||||
}
|
||||
let _this=this;
|
||||
$.get("/2/messagesPages",params,function(res){
|
||||
$.get("/aicss/2/messagesPages",params,function(res){
|
||||
let msgList=res.result.list;
|
||||
if(msgList.length>=_this.messages.pagesize){
|
||||
_this.showLoadMore=true;
|
||||
@ -474,7 +473,7 @@
|
||||
},
|
||||
getNotice : function (){
|
||||
let _this=this;
|
||||
$.get("/notice?kefu_id="+KEFU_ID,function(res) {
|
||||
$.get("/aicss/notice?kefu_id="+KEFU_ID,function(res) {
|
||||
var code=res.code;
|
||||
if(code!=200) return;
|
||||
_this.kefuInfo=res.result;
|
||||
@ -633,7 +632,7 @@
|
||||
var formData = new FormData();
|
||||
formData.append('imgfile', file);
|
||||
$.ajax({
|
||||
url: '/uploadimg',
|
||||
url: '/aicss/uploadimg',
|
||||
type: "post",
|
||||
data: formData,
|
||||
contentType: false,
|
||||
@ -657,10 +656,10 @@
|
||||
});
|
||||
},
|
||||
alertSound:function(){
|
||||
alertSound("chatMessageAudio",'/static/images/alert2.ogg');
|
||||
alertSound("chatMessageAudio",'/aicss/static/images/alert2.ogg');
|
||||
},
|
||||
sendSound:function(){
|
||||
alertSound("chatMessageSendAudio",'/static/images/sent.ogg');
|
||||
alertSound("chatMessageSendAudio",'/aicss/static/images/sent.ogg');
|
||||
},
|
||||
sendAjax:function(url,method,params,callback){
|
||||
let _this=this;
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="">
|
||||
<title>Go Open Source Live Chat Software</title>
|
||||
<link rel="stylesheet" href="/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="/static/js/functions.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/common.css">
|
||||
<link rel="stylesheet" href="/aicss/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/aicss/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/aicss/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/aicss/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="/aicss/static/js/functions.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/css/common.css">
|
||||
|
||||
</head>
|
||||
<body class="text-center">
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
var data = _this.mysql;
|
||||
_this.loading=true;
|
||||
_this.sendDisabled=true;
|
||||
$.post("/install", data, function (data) {
|
||||
$.post("/aicss/install", data, function (data) {
|
||||
if (data.code == 200) {
|
||||
_this.$message({
|
||||
message: data.msg,
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>GoflyLiveChat - Open Source Live Chat</title>
|
||||
<link rel="stylesheet" href="/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/aicss/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/aicss/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/aicss/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
@ -156,14 +156,14 @@
|
||||
"password": this.form.password,
|
||||
};
|
||||
|
||||
$.post("/check", data, (response) => {
|
||||
$.post("/aicss/check", data, (response) => {
|
||||
if (response.code === 200) {
|
||||
this.$message({
|
||||
message: 'Welcome back!',
|
||||
type: 'success'
|
||||
});
|
||||
localStorage.setItem("aicss-token", response.result.token);
|
||||
window.location.href = "/main";
|
||||
localStorage.setItem("aicss-token", response.result.token);
|
||||
window.location.href = "/aicss/main";
|
||||
} else {
|
||||
this.$message({
|
||||
message: response.message || 'Invalid credentials',
|
||||
@ -193,7 +193,7 @@
|
||||
"nickname": this.form.nickname,
|
||||
};
|
||||
|
||||
$.post("/register", data, (response) => {
|
||||
$.post("/aicss/register", data, (response) => {
|
||||
if (response.code === 200) {
|
||||
this.$message({
|
||||
message: 'Account created successfully!',
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<title>Open Source Customer Support System</title>
|
||||
<link rel="stylesheet" href="/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/cdn/element-ui/2.15.1/theme-chalk/index.min.css">
|
||||
<script src="/aicss/static/cdn/vue/2.6.11/vue.min.js"></script>
|
||||
<script src="/aicss/static/cdn/element-ui/2.15.1/index.js"></script>
|
||||
<script src="/aicss/static/cdn/jquery/3.6.0/jquery.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="/static/css/common.css">
|
||||
<script src="/assets/js/functions.js"></script>
|
||||
<link rel="stylesheet" href="/aicss/static/css/common.css">
|
||||
<script src="/aicss/assets/js/functions.js"></script>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
@ -55,24 +55,24 @@
|
||||
<el-avatar class="mainLogo" title="Customer Support" :size="45" :src="adminAvator"></el-avatar>
|
||||
</el-badge>
|
||||
</div>
|
||||
<div class="menuLeftItem active" v-on:click="openIframeUrl('/pannel')">
|
||||
<div class="menuLeftItem active" v-on:click="openIframeUrl('/aicss/pannel')">
|
||||
<i class="el-icon-platform-eleme"></i>
|
||||
<span slot="title">Dashboard</span>
|
||||
</div>
|
||||
|
||||
<div class="menuLeftItem" v-on:click="haveNewMessage='';openIframeUrl('/chat_main')">
|
||||
<div class="menuLeftItem" v-on:click="haveNewMessage='';openIframeUrl('/aicss/chat_main')">
|
||||
<el-badge :value="haveNewMessage" class="item">
|
||||
<i class="el-icon-chat-dot-round"></i>
|
||||
</el-badge>
|
||||
<span slot="title">Chat</span>
|
||||
</div>
|
||||
|
||||
<div style="display: none" class="menuLeftItem" v-on:click="openIframeUrl('/setting_deploy')">
|
||||
<div style="display: none" class="menuLeftItem" v-on:click="openIframeUrl('/aicss/setting_deploy')">
|
||||
<i class="el-icon-notebook-2"></i>
|
||||
<span slot="title">Integration</span>
|
||||
</div>
|
||||
|
||||
<div class="menuLeftItem" v-on:click="openIframeUrl('/setting')">
|
||||
<div class="menuLeftItem" v-on:click="openIframeUrl('/aicss/setting')">
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">Settings</span>
|
||||
</div>
|
||||
@ -99,7 +99,7 @@
|
||||
adminRole:"",
|
||||
onlineType:"success",
|
||||
haveNewMessage:"",
|
||||
iframeUrl:"/pannel",
|
||||
iframeUrl:"/aicss/pannel",
|
||||
},
|
||||
methods: {
|
||||
focusWindow(){
|
||||
@ -115,7 +115,7 @@
|
||||
}, function(notification) {
|
||||
window.focus();
|
||||
notification.close();
|
||||
_this.openIframeUrl("/chat_main");
|
||||
_this.openIframeUrl("/aicss/chat_main");
|
||||
});
|
||||
});
|
||||
},
|
||||
@ -124,7 +124,7 @@
|
||||
},
|
||||
logout(){
|
||||
localStorage.removeItem("aicss-token");
|
||||
this.openIframeUrl('/login');
|
||||
this.openIframeUrl('/aicss/login');
|
||||
},
|
||||
openUrl(url){
|
||||
window.location.href=url;
|
||||
@ -138,16 +138,16 @@
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"GET",
|
||||
url:"/kefuinfo",
|
||||
url:"/aicss/kefuinfo",
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
},
|
||||
success: function(data) {
|
||||
if (data.code != 200) {
|
||||
window.location.href="/login";
|
||||
window.location.href="/aicss/login";
|
||||
} else {
|
||||
_this.adminAvator=data.result.avator;
|
||||
_this.iframeUrl = "/pannel";
|
||||
_this.iframeUrl = "/aicss/pannel";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -216,7 +216,7 @@ A: 因二次结算导致,系统将按最终结果扣回或补发。`}
|
||||
},
|
||||
getConfigList(){
|
||||
let _this=this;
|
||||
this.sendAjax("/configs","get",{},function(result){
|
||||
this.sendAjax("/aicss/configs","get",{},function(result){
|
||||
for(let index in _this.configList){
|
||||
for(let item of result){
|
||||
if(_this.configList[index]['conf_key']==item['conf_key']){
|
||||
@ -229,7 +229,7 @@ A: 因二次结算导致,系统将按最终结果扣回或补发。`}
|
||||
//设置配置项
|
||||
setConfigItem(key,value){
|
||||
let _this=this;
|
||||
this.sendAjax("/config","POST",{key:key,value:value},function(result){
|
||||
this.sendAjax("/aicss/config","POST",{key:key,value:value},function(result){
|
||||
_this.getConfigList();
|
||||
_this.$message({
|
||||
message: "success!",
|
||||
@ -240,7 +240,7 @@ A: 因二次结算导致,系统将按最终结果扣回或补发。`}
|
||||
|
||||
setUser(){
|
||||
let _this=this;
|
||||
this.sendAjax("/kefuinfo","POST",{
|
||||
this.sendAjax("/aicss/kefuinfo","POST",{
|
||||
id:_this.kefuInfo.uid,
|
||||
name:_this.kefuInfo.username,
|
||||
nickname:_this.kefuInfo.nickname,
|
||||
@ -292,19 +292,18 @@ A: 因二次结算导致,系统将按最终结果扣回或补发。`}
|
||||
let _this=this;
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url:"/kefuinfo",
|
||||
url:"/aicss/kefuinfo",
|
||||
headers:{
|
||||
"aicss-token":localStorage.getItem("aicss-token")
|
||||
},
|
||||
success: function(data) {
|
||||
if(data.result.username==""){
|
||||
window.location.href="/login";
|
||||
window.location.href="/aicss/login";
|
||||
}
|
||||
if(data.code==200 && data.result!=null){
|
||||
_this.kefuInfo=data.result;
|
||||
_this.chatEndpoint=window.location.origin + '/livechat?kefu_id='+data.result.username;
|
||||
_this.chatEndpoint=window.location.origin + '/aicss/livechat?kefu_id='+data.result.username;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" prop="avator">
|
||||
<el-select v-model="kefuForm.avator" placeholder="请选择头像">
|
||||
<el-option :label="'头像'+item" :value="'/static/images/'+item+'.jpg'" v-for="item in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]" v-bind:key="item">
|
||||
<el-avatar :size="30" :src="'/static/images/'+item+'.jpg'"></el-avatar>
|
||||
<el-option :label="'头像'+item" :value="'/aicss/static/images/'+item+'.jpg'" v-for="item in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]" v-bind:key="item">
|
||||
<el-avatar :size="30" :src="'/aicss/static/images/'+item+'.jpg'"></el-avatar>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user