diff --git a/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx b/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
index dc4e8647..5f87cb67 100644
--- a/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
+++ b/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx
@@ -137,22 +137,7 @@ const Sidebar = ({ isPanel }: Props) => {
{
)}
- {/* powered by */}
- {isMobile && (
-
- {!appData?.custom_config?.remove_webapp_brand && (
-
-
{t('share.chat.poweredBy')}
- {appData?.custom_config?.replace_webapp_logo && (
-

- )}
- {!appData?.custom_config?.replace_webapp_logo && (
-
- )}
-
- )}
-
- )}
+
)
}
diff --git a/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx b/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx
index 4a08a4c0..993da623 100644
--- a/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx
+++ b/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx
@@ -2,36 +2,28 @@
import { useTranslation } from 'react-i18next'
import { Fragment, useState } from 'react'
import { useRouter } from 'next/navigation'
-import { useContextSelector } from 'use-context-selector'
import {
RiAccountCircleLine,
RiArrowRightUpLine,
- RiBookOpenLine,
- RiGithubLine,
RiGraduationCapFill,
RiInformation2Line,
RiLogoutBoxRLine,
- RiMap2Line,
RiSettings3Line,
- RiStarLine,
RiTShirt2Line,
} from '@remixicon/react'
import Link from 'next/link'
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
import Indicator from '../indicator'
import AccountAbout from '../account-about'
-import GithubStar from '../github-star'
-import Support from './support'
+
import Compliance from './compliance'
import PremiumBadge from '@/app/components/base/premium-badge'
-import { useGetDocLanguage } from '@/context/i18n'
import Avatar from '@/app/components/base/avatar'
import ThemeSwitcher from '@/app/components/base/theme-switcher'
import { logout } from '@/service/common'
-import AppContext, { useAppContext } from '@/context/app-context'
+import { useAppContext } from '@/context/app-context'
import { useProviderContext } from '@/context/provider-context'
import { useModalContext } from '@/context/modal-context'
-import { LicenseStatus } from '@/types/feature'
import { IS_CLOUD_EDITION } from '@/config'
import cn from '@/utils/classnames'
@@ -42,13 +34,11 @@ export default function AppSelector() {
`
const router = useRouter()
const [aboutVisible, setAboutVisible] = useState(false)
- const systemFeatures = useContextSelector(AppContext, v => v.systemFeatures)
const { t } = useTranslation()
const { userProfile, langeniusVersionInfo, isCurrentWorkspaceOwner } = useAppContext()
const { isEducationAccount } = useProviderContext()
const { setShowAccountSettingModal } = useModalContext()
- const docLanguage = useGetDocLanguage()
const handleLogout = async () => {
await logout({
@@ -128,49 +118,9 @@ export default function AppSelector() {
-
-
{IS_CLOUD_EDITION && isCurrentWorkspaceOwner &&
}
-
- {systemFeatures.license.status === LicenseStatus.NONE &&
}
{
document?.body?.getAttribute('data-public-site-about') !== 'hide' && (
- {/* powered by */}
- {!customConfig?.remove_webapp_brand && (
-
-
{t('share.chat.poweredBy')}
- {customConfig?.replace_webapp_logo && (
-

- )}
- {!customConfig?.replace_webapp_logo && (
-
- )}
-
- )}
+
{/* Result */}
{
data={appData?.site}
forceClose={isPanel && !panelVisible}
/>
- {/* powered by */}
-
- {!appData?.custom_config?.remove_webapp_brand && (
-
-
{t('share.chat.poweredBy')}
- {
- systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo
- ?

- : appData?.custom_config?.replace_webapp_logo
- ?

- :
- }
-
- )}
-
+ {/* 移除左下角 Powered by 区域 */}
{!!showConfirm && (
{
)}
- {/* powered by */}
- {isMobile && (
-
- {!appData?.custom_config?.remove_webapp_brand && (
-
-
{t('share.chat.poweredBy')}
- {
- systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo
- ?

- : appData?.custom_config?.replace_webapp_logo
- ?

- :
- }
-
- )}
-
- )}
+ {/* 移除移动端左下角 Powered by 区域 */}
)
}
diff --git a/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx b/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx
new file mode 100644
index 00000000..4a2f3b88
--- /dev/null
+++ b/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx
@@ -0,0 +1,80 @@
+'use client'
+import { useEffect, useRef } from 'react'
+
+/**
+ * IframePostMessage
+ * 页面加载完成后向父页面发送一次消息,并每 5 秒发送一次。
+ * 仅当当前窗口运行在 iframe 中时才发送。
+ */
+const IframePostMessage = () => {
+ const initializedRef = useRef(false)
+
+ /**
+ * sendMessage
+ * 向父页面发送消息的函数:收集当前页面的 localStorage 全量键值并发送。
+ * 如果不在 iframe 环境中则不发送。
+ */
+ const sendMessage = () => {
+ try {
+ if (typeof window === 'undefined') return
+ // 只在 iframe 环境下发送
+ if (window.parent === window) return
+ // 收集 localStorage 全量数据
+ const localStorageData: Record = {}
+ try {
+ const { localStorage } = window
+ for (let i = 0; i < localStorage.length; i++) {
+ const key = localStorage.key(i)
+ if (!key) continue
+ localStorageData[key] = localStorage.getItem(key)
+ }
+ }
+ catch {
+ // 可能因浏览器隐私设置导致不可访问 localStorage
+ }
+ window.parent.postMessage(
+ {
+ type: 'dify-localstorage',
+ status: 1,
+ message: '将智能体本地缓存发送给父页面!',
+ data: localStorageData,
+ },
+ '*',
+ )
+ }
+ catch {
+ // 忽略跨域或其他运行时错误
+ }
+ }
+
+ useEffect(() => {
+ if (initializedRef.current) return
+ initializedRef.current = true
+
+ let timer: number | undefined
+
+ const init = () => {
+ sendMessage()
+ timer = window.setInterval(sendMessage, 5000)
+ }
+
+ if (document.readyState === 'loading') {
+ const onReady = () => {
+ init()
+ document.removeEventListener('DOMContentLoaded', onReady)
+ }
+ document.addEventListener('DOMContentLoaded', onReady)
+ }
+ else {
+ init()
+ }
+
+ return () => {
+ if (timer) window.clearInterval(timer)
+ }
+ }, [])
+
+ return null
+}
+
+export default IframePostMessage
\ No newline at end of file
diff --git a/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx b/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx
index ec0bc2f2..4b77b5b7 100644
--- a/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx
+++ b/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx
@@ -5,22 +5,17 @@ import { useRouter } from 'next/navigation'
import {
RiAccountCircleLine,
RiArrowRightUpLine,
- RiBookOpenLine,
- RiGithubLine,
RiGraduationCapFill,
RiInformation2Line,
RiLogoutBoxRLine,
- RiMap2Line,
RiSettings3Line,
- RiStarLine,
RiTShirt2Line,
} from '@remixicon/react'
import Link from 'next/link'
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
import Indicator from '../indicator'
import AccountAbout from '../account-about'
-import GithubStar from '../github-star'
-import Support from './support'
+// Removed: GithubStar, Support
import Compliance from './compliance'
import PremiumBadge from '@/app/components/base/premium-badge'
import Avatar from '@/app/components/base/avatar'
@@ -133,49 +128,11 @@ export default function AppSelector() {
{!systemFeatures.branding.enabled && <>
-
-
+ {/* 移除:帮助文档与支持按钮 */}
{IS_CLOUD_EDITION && isCurrentWorkspaceOwner &&
}
-
-
+ {/* 移除:路线图与 GitHub 按钮 */}
{
document?.body?.getAttribute('data-public-site-about') !== 'hide' && (
- {/* powered by */}
- {!customConfig?.remove_webapp_brand && (
-
-
{t('share.chat.poweredBy')}
- {
- systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo
- ?

- : customConfig?.replace_webapp_logo
- ?

- :
- }
-
- )}
+ {/* 移除左下角 Powered by 区域 */}
{/* Result */}
+