mirror of https://github.com/langgenius/dify.git
Merge branch 'e-0154' into deploy/enterprise
This commit is contained in:
commit
c7fd73d330
|
@ -6,7 +6,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
|
||||||
<div>
|
<div>
|
||||||
### 鉴权
|
### 鉴权
|
||||||
|
|
||||||
Dify Service API 使用 `API-Key` 进行鉴权。
|
Service API 使用 `API-Key` 进行鉴权。
|
||||||
|
|
||||||
建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。
|
建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ const LogoSite: FC<LogoSiteProps> = ({
|
||||||
|
|
||||||
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
||||||
if (systemFeatures.branding.enabled)
|
if (systemFeatures.branding.enabled)
|
||||||
src = systemFeatures.branding.login_page_logo
|
src = systemFeatures.branding.workspace_logo
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<img
|
<img
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
|
||||||
### 鉴权
|
### 鉴权
|
||||||
|
|
||||||
|
|
||||||
Dify Service API 使用 `API-Key` 进行鉴权。
|
Service API 使用 `API-Key` 进行鉴权。
|
||||||
<i>**强烈建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。**</i>
|
<i>**强烈建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。**</i>
|
||||||
所有 API 请求都应在 **`Authorization`** HTTP Header 中包含您的 `API-Key`,如下所示:
|
所有 API 请求都应在 **`Authorization`** HTTP Header 中包含您的 `API-Key`,如下所示:
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ Workflow 应用无会话支持,适合用于翻译/文章写作/总结 AI 等
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
Dify Service API 使用 `API-Key` 进行鉴权。
|
Service API 使用 `API-Key` 进行鉴权。
|
||||||
<i>**强烈建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。**</i>
|
<i>**强烈建议开发者把 `API-Key` 放在后端存储,而非分享或者放在客户端存储,以免 `API-Key` 泄露,导致财产损失。**</i>
|
||||||
所有 API 请求都应在 **`Authorization`** HTTP Header 中包含您的 `API-Key`,如下所示:
|
所有 API 请求都应在 **`Authorization`** HTTP Header 中包含您的 `API-Key`,如下所示:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
'use client'
|
||||||
|
import type { FC } from 'react'
|
||||||
|
import classNames from '@/utils/classnames'
|
||||||
|
import { useSelector } from '@/context/app-context'
|
||||||
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
|
|
||||||
|
type LoginLogoProps = {
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const LoginLogo: FC<LoginLogoProps> = ({
|
||||||
|
className,
|
||||||
|
}) => {
|
||||||
|
const { systemFeatures } = useGlobalPublicStore()
|
||||||
|
const { theme } = useSelector((s) => {
|
||||||
|
return {
|
||||||
|
theme: s.theme,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let src = theme === 'light' ? '/logo/logo-site.png' : `/logo/logo-site-${theme}.png`
|
||||||
|
if (systemFeatures.branding.enabled)
|
||||||
|
src = systemFeatures.branding.login_page_logo
|
||||||
|
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
src={src}
|
||||||
|
className={classNames('block w-auto h-10', className)}
|
||||||
|
alt='logo'
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LoginLogo
|
|
@ -1,17 +1,17 @@
|
||||||
'use client'
|
'use client'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
import LoginLogo from './LoginLogo'
|
||||||
import Select from '@/app/components/base/select/locale'
|
import Select from '@/app/components/base/select/locale'
|
||||||
import { languages } from '@/i18n/language'
|
import { languages } from '@/i18n/language'
|
||||||
import { type Locale } from '@/i18n'
|
import { type Locale } from '@/i18n'
|
||||||
import I18n from '@/context/i18n'
|
import I18n from '@/context/i18n'
|
||||||
import LogoSite from '@/app/components/base/logo/logo-site'
|
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const { locale, setLocaleOnClient } = useContext(I18n)
|
const { locale, setLocaleOnClient } = useContext(I18n)
|
||||||
|
|
||||||
return <div className='flex items-center justify-between p-6 w-full'>
|
return <div className='flex items-center justify-between p-6 w-full'>
|
||||||
<LogoSite />
|
<LoginLogo />
|
||||||
<Select
|
<Select
|
||||||
value={locale}
|
value={locale}
|
||||||
items={languages.filter(item => item.supported)}
|
items={languages.filter(item => item.supported)}
|
||||||
|
|
Loading…
Reference in New Issue