Prechádzať zdrojové kódy

feat: 添加 Dify chatbot 配置和动态加载脚本

weipengtao 6 mesiacov pred
rodič
commit
3fddccec53
1 zmenil súbory, kde vykonal 24 pridanie a 0 odobranie
  1. 24 0
      src/views/Project/Schedule.vue

+ 24 - 0
src/views/Project/Schedule.vue

@@ -151,6 +151,23 @@ export default {
       return this.$store.state.workspace.currentProjectMembers;
     },
   },
+  mounted() {
+    // Dify chatbot 配置
+    window.difyChatbotConfig = {
+      token: 'h8mBtz4IQMSuT3xm',
+      baseUrl: 'http://dify.seec.seecoder.cn',
+      systemVariables: {},
+      userVariables: {},
+    };
+    // 动态加载 Dify chatbot 脚本
+    if (!document.getElementById('h8mBtz4IQMSuT3xm')) {
+      const script = document.createElement('script');
+      script.src = 'http://dify.seec.seecoder.cn/embed.min.js';
+      script.id = 'h8mBtz4IQMSuT3xm';
+      script.defer = true;
+      document.head.appendChild(script);
+    }
+  },
   watch: {
     $route: {
       async handler() {
@@ -346,4 +363,11 @@ export default {
 .el-table .cell{
   white-space: pre-line;
 }
+#dify-chatbot-bubble-button {
+  background-color: #1C64F2 !important;
+}
+#dify-chatbot-bubble-window {
+  width: 24rem !important;
+  height: 40rem !important;
+}
 </style>