fix config model

master
taoshihan 2 months ago
parent 72b55a05cf
commit 3cd76538ba

@ -14,7 +14,7 @@ func UpdateConfig(userid interface{}, key string, value string) {
config := FindConfigByUserId(userid, key) config := FindConfigByUserId(userid, key)
if config.ID != 0 { if config.ID != 0 {
config.ConfValue = value config.ConfValue = value
DB.Where("user_id = ? and conf_key = ?", userid, key).Update(config) DB.Model(&Config{}).Where("user_id = ? and conf_key = ?", userid, key).Update(config)
} else { } else {
newConfig := &Config{ newConfig := &Config{
ID: 0, ID: 0,

@ -83,7 +83,7 @@ For domain access, configure a reverse proxy to port 8081 to hide the port numbe
### Customer Service Integration ### Customer Service Integration
Chat Link Chat Link
http://127.0.0.1:8081/livechat?kefu_id=agent http://127.0.0.1:8081/livechat?user_id=agent
Popup Integration Popup Integration

@ -89,11 +89,10 @@
</div> </div>
</body> </body>
<script> <script>
var KEFU_ID='{{.KEFU_ID}}'; var KEFU_ID=getQuery("user_id");
var REFER='{{.Refer}}'; var REFER='{{.Refer}}';
</script> </script>
<script> <script>
KEFU_ID=KEFU_ID!=""? KEFU_ID:"kefu2";
new Vue({ new Vue({
el: '#app', el: '#app',
delimiters:["<{","}>"], delimiters:["<{","}>"],

@ -191,7 +191,7 @@
} }
if(data.code==200 && data.result!=null){ if(data.code==200 && data.result!=null){
_this.kefuInfo=data.result; _this.kefuInfo=data.result;
_this.chatEndpoint=window.location.origin + '/livechat?kefu_id='+_this.kefuInfo.username; _this.chatEndpoint=window.location.origin + '/livechat?user_id='+_this.kefuInfo.username;
} }
} }

Loading…
Cancel
Save