taoshihan 3 weeks ago
parent 73e46a9295
commit 96a05e8258

@ -17,9 +17,6 @@ func InitViewRouter(engine *gin.Engine) {
engine.GET("/chat_main", middleware.JwtPageMiddleware, middleware.DomainLimitMiddleware, tmpl.PageChatMain)
engine.GET("/setting", middleware.DomainLimitMiddleware, tmpl.PageSetting)
engine.GET("/setting_statistics", tmpl.PageSettingStatis)
engine.GET("/setting_indexpage", tmpl.PageSettingIndexPage)
engine.GET("/setting_indexpages", tmpl.PageSettingIndexPages)
engine.GET("/setting_mysql", tmpl.PageSettingMysql)
engine.GET("/setting_welcome", tmpl.PageSettingWelcome)
engine.GET("/setting_deploy", tmpl.PageSettingDeploy)
engine.GET("/setting_kefu_list", tmpl.PageKefuList)
@ -27,6 +24,4 @@ func InitViewRouter(engine *gin.Engine) {
engine.GET("/setting_modifypass", tmpl.PageModifypass)
engine.GET("/setting_ipblack", tmpl.PageIpblack)
engine.GET("/setting_config", tmpl.PageConfig)
engine.GET("/mail_list", tmpl.PageMailList)
engine.GET("/roles_list", tmpl.PageRoleList)
}

@ -51,7 +51,7 @@
<div style="padding: 20px">
<el-card class="deployment-guide">
<div slot="header" class="clearfix">
<h2>Quick Start via Chat Link</h2>
<h2>Quick Start</h2>
</div>
<div class="deployment-section">
@ -66,7 +66,11 @@
title="Copy link"></el-button>
</el-input>
</div>
<div class="deployment-section">
<p>Add the following code (via copy/paste) at the bottom of the web page (immediately before the &lt;/body> tag).</p>
<el-input style="width: 100%; margin-top: 10px;" type="textarea" v-model="deployCode" :rows="20" readonly>
</el-input>
</div>
</el-card>
</div>

@ -10,6 +10,7 @@
delimiters:["<{","}>"],
data: {
host:getBaseUrl(),
deployCode:"",
kefuInfo:{},
account: {
username: "",
@ -194,6 +195,29 @@
_this.chatEndpoint=window.location.origin + '/livechat?user_id='+_this.kefuInfo.username;
}
_this.deployCode = `
<script>
(function(global, document, scriptUrl, callback) {
const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = scriptUrl + "/static/js/chat-widget.js";
script.onload = script.onreadystatechange = function () {
if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
callback(scriptUrl);
}
};
head.appendChild(script);
})(window, document, "${_this.host}", function(baseUrl) {
CHAT_WIDGET.initialize({
API_URL: baseUrl,
AGENT_ID: "${_this.kefuInfo.username}",
});
});
<\/script>
`.trim();
}
});
},
@ -211,6 +235,7 @@
this.getKefuInfo();
this.initInfo();
},
created: function () {

Loading…
Cancel
Save