From 7e7044ceb0f568c187675f18fcc629978d6814eb Mon Sep 17 00:00:00 2001 From: luishou Date: Mon, 14 Sep 2026 11:53:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(birthday):=20=E6=8F=90=E9=86=92=E9=A1=B5?= =?UTF-8?q?=E5=85=A8=E5=91=98=E5=B1=95=E7=A4=BA=E6=98=8E=E6=96=87=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生日提醒用于联系商户,不再按角色脱敏;商户管理列表权限保持不变。 Co-authored-by: Cursor --- .../customers/birthday/birthday-list.tsx | 23 ++++++------------- .../(dashboard)/customers/birthday/page.tsx | 6 +---- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/app/(dashboard)/customers/birthday/birthday-list.tsx b/src/app/(dashboard)/customers/birthday/birthday-list.tsx index 8ca4ec8..1abf59f 100644 --- a/src/app/(dashboard)/customers/birthday/birthday-list.tsx +++ b/src/app/(dashboard)/customers/birthday/birthday-list.tsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState, type ReactNode } from "react"; import { Columns3, RotateCcw } from "lucide-react"; -import { fmtDate, maskPhone } from "@/lib/utils"; +import { fmtDate } from "@/lib/utils"; import { lunarBirthdaySolarThisYear } from "@/lib/lunar"; import { Card } from "@/components/ui/card"; import { Table, THead, TR, TH, TD } from "@/components/ui/table"; @@ -192,14 +192,7 @@ function ColumnPicker({ ); } -export function BirthdayList({ - rows, - isAdmin, -}: { - rows: BirthdayRow[]; - /** 与商户列表一致:仅管理员看明文手机号 */ - isAdmin: boolean; -}) { +export function BirthdayList({ rows }: { rows: BirthdayRow[] }) { const [visible, setVisible] = useState(defaultBirthdayColumns); const [ready, setReady] = useState(false); @@ -223,9 +216,7 @@ export function BirthdayList({ const colSpan = Math.max(1, ordered.length); function phoneFor(v?: string | null) { - const value = v?.trim() || ""; - if (!value) return ""; - return isAdmin ? value : maskPhone(value); + return v?.trim() || ""; } return ( @@ -265,13 +256,13 @@ export function BirthdayList({ ) : col.key === "balanceUser" ? ( ) : ( renderCell(col.key, row) @@ -316,13 +307,13 @@ export function BirthdayList({ ) : col.key === "balanceUser" ? ( ) : ( renderCell(col.key, row) diff --git a/src/app/(dashboard)/customers/birthday/page.tsx b/src/app/(dashboard)/customers/birthday/page.tsx index 4a103ee..4eadcab 100644 --- a/src/app/(dashboard)/customers/birthday/page.tsx +++ b/src/app/(dashboard)/customers/birthday/page.tsx @@ -1,7 +1,5 @@ import { Prisma } from "@prisma/client"; import { prisma } from "@/lib/prisma"; -import { auth } from "@/lib/auth"; -import { isSuperAdmin } from "@/lib/acl"; import { birthdayMatchLists } from "@/lib/lunar"; import { Card } from "@/components/ui/card"; import { BirthdayControl } from "./birthday-control"; @@ -20,8 +18,6 @@ export default async function BirthdayPage({ }: { searchParams: Promise<{ mode?: string; date?: string }>; }) { - const session = await auth(); - const isAdmin = isSuperAdmin(session?.user?.roles); const sp = await searchParams; const mode = sp.mode === "week" ? "week" : "today"; const dateStr = sp.date ?? ""; @@ -67,7 +63,7 @@ export default async function BirthdayPage({ - + ); }