Bladeren bron

feat:黑名单功能

刘云鑫 2 maanden geleden
bovenliggende
commit
5fbd25e1cd

+ 6 - 2
src/api/modules/dynamicManagement.ts

@@ -1,6 +1,7 @@
 import { PORT_NONE } from "@/api/config/servicePort";
 import http from "@/api";
 import httpStore from "@/api/indexStore";
+import httpApi from "@/api/indexApi";
 
 /**
  * 动态管理相关接口
@@ -246,8 +247,10 @@ export const getUserByPhone = (params: {
 export const getBlackList = (params: {
   userType: number; // 用户类型:1表示商家
   userId: number | string; // 用户ID(store_user表的ID)
+  type: number; // 类型:0表示查询所有
 }) => {
-  return httpStore.get(PORT_NONE + `/life-blacklist/blackListByUserId`, params);
+  return httpApi.get(`alienStore/life-blacklist/blackListByUserId`, params, { loading: false });
+  // return httpStore.get(  `/life-blacklist/blackListByUserId`, params);
 };
 
 // 取消拉黑
@@ -258,7 +261,8 @@ export const unblockUser = (params: {
   blockerId: number | string; // 拉黑方ID
   blockerType: number; // 拉黑方类型:1商户,2用户
 }) => {
-  return httpStore.post(PORT_NONE + `/life-blacklist/cancelBlacklist`, params);
+  return httpApi.post(`alienStore/life-blacklist/cancelBlacklist`, params, { loading: false });
+  // return httpStore.post(PORT_NONE + `/life-blacklist/cancelBlacklist`, params);
 };
 
 // 获取评论列表

+ 3 - 2
src/layouts/components/Header/components/BlackListDialog.vue

@@ -89,7 +89,8 @@ const loadBlacklist = async () => {
 
     const res = await getBlackList({
       userType: userType, // 使用动态获取的用户类型
-      userId: userId
+      userId: userId,
+      type: 0
     });
 
     // 处理返回数据
@@ -99,7 +100,7 @@ const loadBlacklist = async () => {
       blacklist.value = list.map((item: any) => ({
         id: item.id,
         name: item.blockedName || item.userName || item.name || "用户",
-        avatar: item.blockedAvatar || item.avatar || "",
+        avatar: item.userImage || item.avatar || "",
         unblocking: false,
         blockedId: item.blockedId,
         blockedType: item.blockedType || 1,