准备客服管理

pull/30/head
taoshihan1991 4 years ago
parent 1c08303e13
commit f7be76dd92

@ -51,6 +51,7 @@ func main() {
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlSetConf)
engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor)
engine.GET("/visitors",middleware.JwtApiMiddleware, controller.GetVisitors)
engine.GET("/setting_kefu_list",tmpl.PageKefuList)
//------------------old code-----------------------------
mux := &http.ServeMux{}
//根路径

@ -65,6 +65,7 @@
<body>
<div id="app">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-row :gutter="2">
<el-col :span="6">
<div class="chatBg chatLeft">
@ -142,6 +143,7 @@
</div>
</el-col>
</el-row>
</el-container>
</template>
</div>
</body>
@ -348,9 +350,9 @@
type: 'error'
});
}
_this.fullscreenLoading=false;
}
}).then(function(data){
});
},
//获取客服信息

@ -1,4 +1,7 @@
{{define "setting_bottom"}}
<script>
var ACTION="{{.action}}";
</script>
<script>
var app=new Vue({
el: '#app',
@ -112,36 +115,40 @@
},
//初始化数据
initInfo(){
{{if eq .action "setting_mysql"}}
let _this=this;
$.ajax({
type:"get",
url:"/mysql",
headers:{
"token":localStorage.getItem("token")
},
success: function(data) {
if(data.result!=null){
_this.mysql.username=data.result.Username;
_this.mysql.password=data.result.Password;
_this.mysql.database=data.result.Database;
_this.mysql.server=data.result.Server;
_this.mysql.port=data.result.Port;
}
if(data.code!=200){
_this.$message({
message: data.msg,
type: 'error'
});
if(ACTION=="setting_mysql"){
$.ajax({
type:"get",
url:"/mysql",
headers:{
"token":localStorage.getItem("token")
},
success: function(data) {
if(data.result!=null){
_this.mysql.username=data.result.Username;
_this.mysql.password=data.result.Password;
_this.mysql.database=data.result.Database;
_this.mysql.server=data.result.Server;
_this.mysql.port=data.result.Port;
}
if(data.code!=200){
_this.$message({
message: data.msg,
type: 'error'
});
}
_this.fullscreenLoading=false;
}
}
});
});
}
{{end}}
}
},
created: function () {
this.showNotice();
if(ACTION=="setting"){
this.showNotice();
}
this.initInfo();
}
})

@ -0,0 +1,18 @@
{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-container v-loading.fullscreen.lock="fullscreenLoading">
<el-aside>
{{template "setting_left" .}}
</el-aside>
<el-main class="mainMain">
ss
</el-main>
</el-container>
</template>
</div>
</body>
{{template "setting_bottom" .}}

@ -3,13 +3,23 @@
<el-submenu index="1">
<template slot="title">
<i class="el-icon-s-custom"></i>
<span>账户中心</span>
<span>账户设置</span>
</template>
<el-menu-item-group>
<el-menu-item index="1-1">设置smtp</el-menu-item>
<el-menu-item index="1-2">设置imap</el-menu-item>
<el-menu-item index="1-3" v-on:click="openUrl('/setting')">设置登陆账号</el-menu-item>
<el-menu-item index="1-4" v-on:click="openUrl('/setting_mysql')">设置mysql</el-menu-item>
<el-menu-item index="1-1" v-on:click="">智能回复</el-menu-item>
<el-menu-item index="1-2" v-on:click="openUrl('/setting_kefu_list')">客服管理</el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="2">
<template slot="title">
<i class="el-icon-s-tools"></i>
<span>系统设置</span>
</template>
<el-menu-item-group>
<el-menu-item index="2-1">设置smtp</el-menu-item>
<el-menu-item index="2-2">设置imap</el-menu-item>
<el-menu-item index="2-3" v-on:click="openUrl('/setting')">设置登陆账号</el-menu-item>
<el-menu-item index="2-4" v-on:click="openUrl('/setting_mysql')">设置mysql</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>

@ -7,17 +7,23 @@ import (
//设置界面
func PageSetting(c *gin.Context) {
c.HTML(http.StatusOK, "setting.html", gin.H{
"tab_index":"1-3",
"tab_index":"2-3",
"action":"setting",
})
}
//设置mysql
func PageSettingMysql(c *gin.Context) {
c.HTML(http.StatusOK, "setting_mysql.html", gin.H{
"tab_index":"1-4",
"tab_index":"2-4",
"action":"setting_mysql",
})
}
func PageKefuList(c *gin.Context) {
c.HTML(http.StatusOK, "setting_kefu_list.html", gin.H{
"tab_index":"1-2",
"action":"setting_kefu_list",
})
}
type SettingHtml struct {
*CommonHtml
Username, Password string

Loading…
Cancel
Save