添加网页部署

pull/30/head
taoshihan1991 5 years ago
parent 87063a9f5c
commit cf05552796

@ -53,6 +53,9 @@ func main() {
engine.GET("/setting", tmpl.PageSetting)
//设置mysql
engine.GET("/setting_mysql", tmpl.PageSettingMysql)
//网页部署
engine.GET("/setting_deploy", tmpl.PageSettingDeploy)
engine.GET("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlGetConf)
engine.POST("/mysql",middleware.JwtApiMiddleware,middleware.CasbinACL, controller.MysqlSetConf)
engine.GET("/visitor",middleware.JwtApiMiddleware, controller.GetVisitor)

@ -142,7 +142,7 @@
_this.mysql.port=result.Port;
});
}
if(ACTION=="setting_kefu_list"){
if(ACTION=="setting_kefu_list"||ACTION=="setting_deploy"){
this.sendAjax("/kefulist","get",{},function(result){
_this.kefuList=result;
});
@ -229,6 +229,14 @@
_this.kefuList=result;
});
});
},
//生成部署js
createDeployJs(){
let domain=window.location.host;
this.$alert(' <script type="text/javascript">\n' +
' var GOFLY_KEFU_ID="'+this.kefuForm.name+'";\n' +
' <\/script>\n'+
' <script type="text/javascript" src="http://'+domain+'/webjs"><\/script>', '');
}
},
created: function () {

@ -0,0 +1,29 @@
{{template "header" }}
<div id="app" style="width:100%">
<template>
<el-container>
<el-aside>
{{template "setting_left" .}}
</el-aside>
<el-main class="mainMain">
<el-form :model="kefuForm" :rules="rules" ref="kefuForm" label-width="120px">
<el-form-item label="选择客服" prop="name">
<el-select v-model="kefuForm.name" placeholder="请选择客服">
<el-option :label="item.name" :value="item.name" v-for="item in kefuList" v-bind:key="item.name">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="createDeployJs">立即生成</el-button>
</el-form-item>
</el-form>
</el-main>
</el-container>
</template>
</div>
</body>
{{template "setting_bottom" .}}

@ -20,6 +20,7 @@
<el-menu-item style="display:none" index="2-2">设置imap</el-menu-item>
<el-menu-item style="display:none" 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 index="2-5" v-on:click="openUrl('/setting_deploy')">设置网页部署</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>

@ -18,6 +18,13 @@ func PageSettingMysql(c *gin.Context) {
"action":"setting_mysql",
})
}
//设置部署
func PageSettingDeploy(c *gin.Context) {
c.HTML(http.StatusOK, "setting_deploy.html", gin.H{
"tab_index":"2-5",
"action":"setting_deploy",
})
}
//前台js部署
func PageWebJs(c *gin.Context){
c.HTML(http.StatusOK, "chat_web.js",nil)

Loading…
Cancel
Save