Jelajahi Sumber

feat: #热搜词重新对接

loki 3 tahun lalu
induk
melakukan
c170111226
2 mengubah file dengan 14 tambahan dan 9 penghapusan
  1. 12 7
      src/api/base/trend.js
  2. 2 2
      src/views/baseManagement/trending/index.vue

+ 12 - 7
src/api/base/trend.js

@@ -1,14 +1,19 @@
 import api from '@/utils/request';
 
-export const getList = params =>
+export const getPage = params =>
 	api.post(`/yxl-back-end/admin/top-search-keywords/page`, params);
-// export const getItem = ({ id, ...params }) =>
-// api.get(`/yxl-back-end/admin/top-search-keywords/${id}`, params);
-export const saveItem = params => {
-	if (params.id) {
-		return api.post(`/yxl-back-end/admin/top-search-keywords/update`, params);
+// export const saveItem = params => {
+// 	if (params.id) {
+// 		return api.post(`/yxl-back-end/admin/top-search-keywords/update`, params);
+// 	} else {
+// 		return api.post(`/yxl-back-end/admin/top-search-keywords/save`, params);
+// 	}
+// };
+export const saveItem = ({ id, ...params }) => {
+	if (id) {
+		return api.put(`/yxl-back-end/admin/top-search-keywords/${id}`, params);
 	} else {
-		return api.post(`/yxl-back-end/admin/top-search-keywords/save`, params);
+		return api.post(`/yxl-back-end/admin/top-search-keywords`, params);
 	}
 };
 export const delItem = ({ id, ...params }) =>

+ 2 - 2
src/views/baseManagement/trending/index.vue

@@ -20,7 +20,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getList, delItem } from '@/api/base/trend';
+import { getPage, delItem } from '@/api/base/trend';
 
 export default {
   name: 'Trending',
@@ -29,7 +29,7 @@ export default {
 
   mixins: [
     mxFilterList({
-      fetchList: getList, // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getPage, // 在下方data再声明一个 fetchList: iGetList 同等效果
       pagination: {
         page: 1,
         total: 0,