From 311ca35afcbef55ca0d9f09e0dc71f7149a9cb37 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Mon, 20 Oct 2025 13:43:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=93=81=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0ES=E5=95=86=E5=93=81=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增三个API接口用于管理ES商品索引: 1. 删除ES中下架的商品 2. 删除不存在的索引 3. 生成所有商品的缓存 同时在商品设置页面添加对应操作按钮 --- manager/src/api/index.js | 15 +++++++ .../setting-manage/setting/GOODS_SETTING.vue | 41 +++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/manager/src/api/index.js b/manager/src/api/index.js index f87e4f8f..cb583bdd 100644 --- a/manager/src/api/index.js +++ b/manager/src/api/index.js @@ -445,6 +445,21 @@ export const getProgress = () => { return getRequest(`/other/elasticsearch/progress`); }; +// 删除ES中下架的商品 +export const deleteGoodsDown = () => { + return getRequest(`/other/elasticsearch/deleteGoodsDown`); +}; + +// 删除不存在的索引 +export const delSkuIndex = () => { + return getRequest(`/other/elasticsearch/delSkuIndex`); +}; + +// 生成所有商品的缓存 +export const generateGoodsCache = () => { + return getRequest(`/other/elasticsearch/cache`); +}; + // 分页查询自定义分词 export const getCustomWordsPage = (params) => { return getRequest(`/other/customWords/page`, params); diff --git a/manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue b/manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue index c38a83a5..5f0ad9d6 100644 --- a/manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue +++ b/manager/src/views/sys/setting-manage/setting/GOODS_SETTING.vue @@ -54,9 +54,14 @@ -
+
- +
+ + + + +
@@ -65,7 +70,7 @@