From af35c9281d8e9ec79560c9a2d5f571f4af4e1e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 4 Jun 2026 16:12:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor(customer):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E5=92=8C?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=AD=97=E6=AE=B5=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除新增客户页面对手机号的必填和格式校验 - 修改手机号字段标签为“手机号/微信号”,取消必填和长度限制 - 新增判断当前用户是否为超级管理员逻辑 - 抽取并统一构建客户查询参数方法,根据权限动态设置筛选条件 - 优化客户列表数据获取逻辑,支持超级管理员查看全部客户 - 调整依赖项,更新使用了新构建的查询参数函数 - 增强状态统计接口参数构建,统一调用参数生成函数 - 优化副作用 Hook 依赖,保证数据加载时机正确 --- src/pages/user/components/UserCard.tsx | 5 ++++- src/pages/user/components/UserCell.tsx | 10 +++++++--- src/pages/user/user.scss | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/pages/user/components/UserCard.tsx b/src/pages/user/components/UserCard.tsx index 1decac6..3dae761 100644 --- a/src/pages/user/components/UserCard.tsx +++ b/src/pages/user/components/UserCard.tsx @@ -168,7 +168,10 @@ function UserCard() { isLoggedIn ? ( ) : ( - ) diff --git a/src/pages/user/components/UserCell.tsx b/src/pages/user/components/UserCell.tsx index 3bd0bef..6f40805 100644 --- a/src/pages/user/components/UserCell.tsx +++ b/src/pages/user/components/UserCell.tsx @@ -6,7 +6,7 @@ import {ArrowRight, LogisticsError} from '@nutui/icons-react-taro' import {useUser} from '@/hooks/useUser' const UserCell = () => { - const {logoutUser} = useUser(); + const {logoutUser, isAdmin} = useUser(); const onLogout = () => { Taro.showModal({ @@ -28,15 +28,19 @@ const UserCell = () => { <> + {isAdmin() && ( 后台管理 + } align="center" - extra={} + extra={} onClick={() => Taro.reLaunch({url: '/pages/index/index'})} /> + )}