diff --git a/layouts/default.vue b/layouts/default.vue index 7323468..da5de05 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -32,18 +32,22 @@ export default { } }, created() { - + }, - mounted(){ + beforeMount(){ window.difyChatbotConfig = { token: 'BC985VI4DnedSaIQ', baseUrl: 'http://101.245.103.204', systemVariables: { // user_id: 'YOU CAN DEFINE USER ID HERE', // conversation_id: 'YOU CAN DEFINE CONVERSATION ID HERE, IT MUST BE A VALID UUID', - }, + } } - console.log('执行完成') + let a = document.createElement('script'); + a.setAttribute('src', 'http://101.245.103.204/embed.min.js'); + a.setAttribute('defer', true); + a.setAttribute('id', 'BC985VI4DnedSaIQ'); + document.body.appendChild(a); }, methods: { diff --git a/nuxt.config.js b/nuxt.config.js index 999f9b1..ca66cae 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -32,7 +32,6 @@ export default { ], script: [ // { type:"text/javascript" , src: 'https://api.map.baidu.com/api?v=1.0&type=webgl&ak=otBoKESzaUj1nGjWiehnCP3AUyRKgikx'} - {type:"text/javascript",src:'http://101.245.103.204/embed.min.js',id:"BC985VI4DnedSaIQ",defer:true} ] }, env: { @@ -157,7 +156,7 @@ export default { ] }, router: { - middleware: ['i18n', 'footer', 'header', 'burying-point'] + middleware: ['burying-point','i18n', 'footer', 'header'] }, /* ** Build configuration diff --git a/pages/index.vue b/pages/index.vue index 53f0de3..670b660 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -26,7 +26,11 @@
{{ $t('index.companyProfile') }}

{{ $t('index.corporateName') }}

-
+
+