ai-chat-bot-interface 1.4.7 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.4.7",
4
+ "version": "1.4.8",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -5,7 +5,7 @@ import ChatUi from './ChatUi.vue';
5
5
  <template>
6
6
  <div style="width: 100vw; height: 100vh">
7
7
  <chat-ui
8
- bot-id="555"
8
+ bot-id="5555"
9
9
  token="pat_8888"
10
10
  uid="262598"
11
11
  :def-msg="{ placeholder: '发消息...' }"
@@ -23,7 +23,8 @@
23
23
  :key="index"
24
24
  class="file_card"
25
25
  >
26
- <img class="img" :src="item.file_url" width="100%" alt="img" />
26
+ <img v-if="(item.file_type).toLocaleLowerCase().includes('pdf')" class="pdf" :src="pdfIcon" width="100%" alt="img" />
27
+ <img v-else class="img" :src="item.file_url" width="100%" alt="img" />
27
28
  <div v-if="item.percent < 100" class="process">
28
29
  <progress-ring :percent="item.percent" />
29
30
  </div>
@@ -112,7 +113,7 @@ import AddIcon from './icons/addIcon.vue';
112
113
  import CloseBorderIcon from './icons/closeBorderIcon.vue';
113
114
  import CloseIcon from './icons/CloseIcon.vue';
114
115
  import NewChat from './icons/newChat.vue';
115
-
116
+ const pdfIcon = 'https://prodstatic.weis1606.cn/api/smartFood/icon/pdf_icon.png';
116
117
  const extraList = [
117
118
  // { name: '相機', icon: CameraIcon, type: 'camera' },
118
119
  { name: '相冊', icon: PictureIcon, type: 'photo' },
@@ -237,10 +238,11 @@ const triggerUploadInput = () => {
237
238
 
238
239
  const handleFileChange = (e) => {
239
240
  const selFile = e.target.files[0];
240
-
241
+ console.log('=== file ===', e);
241
242
  if (selFile) {
242
243
  uFileList.value.push({
243
244
  file: selFile,
245
+ file_type: selFile.type,
244
246
  file_url: URL.createObjectURL(selFile),
245
247
  size: (selFile.size / 1024).toFixed(2),
246
248
  percent: 0,