diff --git a/src/components/pages/CompanyPermissionsPage.tsx b/src/components/pages/CompanyPermissionsPage.tsx index 577d323..93964ff 100644 --- a/src/components/pages/CompanyPermissionsPage.tsx +++ b/src/components/pages/CompanyPermissionsPage.tsx @@ -527,7 +527,7 @@ function CreateUserForm({ roles, onClose }: { roles: Role[]; onClose: () => void })) } - const shouldShowProvinces = formData.role && formData.role !== "admin" + const shouldShowProvinces = formData.role && formData.role !== "admin" && formData.role !== "merchant" return (
diff --git a/src/components/pages/MallsPage.tsx b/src/components/pages/MallsPage.tsx index ada3304..57de6cc 100644 --- a/src/components/pages/MallsPage.tsx +++ b/src/components/pages/MallsPage.tsx @@ -94,6 +94,7 @@ export default function MallsPage() { const [provinces, setProvinces] = useState([]) const [mallUsers, setMallUsers] = useState([]) const [loading, setLoading] = useState(false) + const [userRole, setUserRole] = useState("") const [newMall, setNewMall] = useState({ name: "", address: "", @@ -102,6 +103,18 @@ export default function MallsPage() { description: "", }) + // 获取用户角色 + const fetchUserRole = async () => { + try { + const response = await apiGet('/back/getUserRole') + if (response.code === 200) { + setUserRole(response.data || "") + } + } catch (error) { + console.error('获取用户角色失败:', error) + } + } + // 获取商场列表 const fetchMalls = async () => { try { @@ -160,6 +173,7 @@ export default function MallsPage() { // 页面加载时获取数据 useEffect(() => { + fetchUserRole() fetchProvinces() fetchMalls() }, []) @@ -250,108 +264,110 @@ export default function MallsPage() {

商场管理

管理商场信息、查看商户和设备分布

- - - - - - - 添加新商场 - 填写商场基本信息,选择对应省份和商场账号 - -
-
- - setNewMall({ ...newMall, name: e.target.value })} - placeholder="请输入商场名称" - /> -
-
- - setNewMall({ ...newMall, address: e.target.value })} - placeholder="请输入详细地址" - /> -
-
- - -
-
- - -
-
- -