Bladeren bron

搜索记录

CzRger 1 maand geleden
bovenliggende
commit
2eb07c84e1
2 gewijzigde bestanden met toevoegingen van 9 en 1 verwijderingen
  1. 7 0
      src/api/modules/web/list.ts
  2. 2 1
      src/views/web/list/index.vue

+ 7 - 0
src/api/modules/web/list.ts

@@ -27,3 +27,10 @@ export const frontGetThemeByThemeId = (id: any) => handle({
   url: `/${suffix}/front/getThemeByThemeId/${id}`,
   method: 'get',
 })
+
+// 保存搜索记录
+export const searchLogsSaveSearchLog = (params: any) => handle({
+  url: `/${suffix}/search-logs/saveSearchLog`,
+  method: 'post',
+  params
+})

+ 2 - 1
src/views/web/list/index.vue

@@ -226,7 +226,7 @@ import {computed, getCurrentInstance, onBeforeMount, onMounted, reactive, ref, w
 import {useRoute, useRouter} from "vue-router";
 import {useAppStore, useDictionaryStore, useThemeStore, useWebStore} from "@/stores";
 import {ElLoading, ElMessage} from "element-plus";
-import {frontGetIndexAndFieldInfo} from "@/api/modules/web/list";
+import {frontGetIndexAndFieldInfo, searchLogsSaveSearchLog} from "@/api/modules/web/list";
 import DetailCom from './detail.vue'
 
 const {proxy} = getCurrentInstance()
@@ -539,6 +539,7 @@ const initWS = () => {
       }
       lastListParams = JSON.stringify(params)
       ws.send(lastListParams)
+      searchLogsSaveSearchLog({keyword: params.keyData})
     }
     state.ws.detail = (esId) => {
       const params = {