fix(web): 成员名称列 dataIndex;改 key 归属后刷新成员缓存

This commit is contained in:
2026-10-08 00:29:45 +08:00
parent b16ddb1acb
commit b808be324d
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -44,6 +44,8 @@ export function useKeys(filters: () => KeyListFilters) {
return useQuery({
queryKey: () => qk.admin.keys(filters()),
queryFn: () => fetchKeys(filters()),
// 切页回列表时立即反映最新归属/状态
staleTime: 0,
});
}
@@ -53,6 +55,7 @@ export function useRegisterKey() {
mutationFn: registerKey,
onSuccess: () => {
void qc.invalidateQueries({ queryKey: ["admin", "keys"] });
void qc.invalidateQueries({ queryKey: qk.admin.members() });
},
});
}
@@ -69,6 +72,8 @@ export function usePatchKey() {
}) => patchKey(id, body),
onSuccess: () => {
void qc.invalidateQueries({ queryKey: ["admin", "keys"] });
// 归属变更会改成员「名下 Key 数」
void qc.invalidateQueries({ queryKey: qk.admin.members() });
},
});
}
@@ -122,6 +127,7 @@ export function useMembers() {
return useQuery({
queryKey: qk.admin.members(),
queryFn: fetchMembers,
staleTime: 0,
});
}
+1 -1
View File
@@ -46,7 +46,7 @@ function tipTitle(label: string, tip: string) {
}
const columns = [
{ title: "名称", key: "name", width: 140 },
{ title: "名称", key: "name", dataIndex: "name", width: 140 },
{ title: "备注", key: "remark" },
{ title: "状态", key: "status", width: 100 },
{