完善角色权限与数据隔离
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
updateChannel, updateCustomerTag, updateStaff, updateTenantSettings, uploadImage,
|
||||
type Channel, type CustomerTag, type StaffUser, type TenantSettings, type WorkHours, type WelcomeSegment,
|
||||
} from '@/services/api'
|
||||
import { useAuth } from '@/stores/auth'
|
||||
import { useAuth, usePermission } from '@/stores/auth'
|
||||
import MarkdownEditor from '@/components/common/MarkdownEditor'
|
||||
import RichTextEditor from '@/components/common/RichTextEditor'
|
||||
|
||||
@@ -143,8 +143,8 @@ const tabItems: { key: string; label: string; desc: string; icon: ReactNode }[]
|
||||
|
||||
const Settings = () => {
|
||||
const { user } = useAuth()
|
||||
const isAdmin = user?.role === 'admin'
|
||||
const canViewStaff = user?.role === 'admin' || user?.role === 'supervisor'
|
||||
const isAdmin = usePermission('settings.basic')
|
||||
const canViewStaff = usePermission('settings.staff')
|
||||
|
||||
const [activeTab, setActiveTab] = useState('basic')
|
||||
const [basicForm] = Form.useForm()
|
||||
|
||||
Reference in New Issue
Block a user