1.添加移动端用户的检测工具类,移动端用户只能访问对话页面。
2.评查点列表添加文档属性类型字段。 3.优化dify的对话侧边栏的显示效果。 4.评查点规则添加使用文档属性类型的输入框。添加多实体开关的操作开关。
This commit is contained in:
@@ -9,6 +9,7 @@ interface LayoutProps {
|
||||
children: React.ReactNode;
|
||||
userRole?: UserRole;
|
||||
frontendJWT?: string;
|
||||
isMobile?: boolean; // 是否为移动端设备(服务端通过 User-Agent 检测)
|
||||
}
|
||||
|
||||
// 添加一个接口表示路由handle可能包含的属性
|
||||
@@ -23,7 +24,7 @@ interface Match {
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
export function Layout({ children, userRole = 'developer' as UserRole, frontendJWT = '' }: LayoutProps) {
|
||||
export function Layout({ children, userRole = 'developer' as UserRole, frontendJWT = '', isMobile = false }: LayoutProps) {
|
||||
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
||||
const [effectiveUserRole, setEffectiveUserRole] = useState<UserRole>(userRole);
|
||||
const [effectiveFrontendJWT, setEffectiveFrontendJWT] = useState<string>(frontendJWT);
|
||||
@@ -32,10 +33,12 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ
|
||||
|
||||
// 检查当前路径是否应该隐藏侧边栏
|
||||
const noLayoutPaths = ['/login', '/'];
|
||||
const shouldHideSidebar = noLayoutPaths.includes(location.pathname);
|
||||
// 移动端设备强制隐藏侧边栏
|
||||
const shouldHideSidebar = isMobile || noLayoutPaths.includes(location.pathname);
|
||||
|
||||
// 检查当前路由是否应该隐藏默认面包屑
|
||||
const shouldHideBreadcrumb = shouldHideSidebar || matches.some(match =>
|
||||
// 移动端设备强制隐藏面包屑(避免显示首页链接)
|
||||
const shouldHideBreadcrumb = isMobile || shouldHideSidebar || matches.some(match =>
|
||||
match.handle && match.handle.hideBreadcrumb === true
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user