diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index 93dfa6c6..554a0ddd 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -103,7 +103,7 @@ Notes:
- `name` / `title` / `description` / `url` / `accentColor`
- `author`: `{ name, url, avatar }`
-- `social`: `{ github?, twitter?, rss? }`
+- `social`: `{ github?, twitter? }`
- `feed`: supports `folo.challenge.feedId` and `userId`
- `map`: map providers, e.g. `["maplibre"]`
- `mapStyle`: `builtin` or provider-specific style
diff --git a/apps/web/src/modules/gallery/MasonryHeaderMasonryItem.tsx b/apps/web/src/modules/gallery/MasonryHeaderMasonryItem.tsx
index e7aa0ab8..2da18600 100644
--- a/apps/web/src/modules/gallery/MasonryHeaderMasonryItem.tsx
+++ b/apps/web/src/modules/gallery/MasonryHeaderMasonryItem.tsx
@@ -41,6 +41,7 @@ export const MasonryHeaderMasonryItem = ({ style, className }: { style?: React.C
siteConfig.social && siteConfig.social.twitter
? resolveSocialUrl(siteConfig.social.twitter, { baseUrl: 'https://twitter.com/', stripAt: true })
: undefined
+ const hasRss = true
return (
{siteConfig.name}
{/* Social media links */}
- {siteConfig.social && (
+ {(githubUrl || twitterUrl || hasRss) && (
+
+ {/* Auth Section - Only show when useCloud is true */}
+ {injectConfig.useCloud && (
+
+ {sessionUser ? : }
+
+ )}
)
}
@@ -143,3 +162,138 @@ const MobileViewButton = ({
>
)
}
+
+// 登录按钮
+const LoginButton = () => {
+ const { t } = useTranslation()
+ const [isOpen, setIsOpen] = useState(false)
+ const { data: socialProviders } = useQuery({
+ queryKey: ['socialProviders'],
+ queryFn: authApi.getSocialProviders,
+ enabled: isOpen,
+ })
+
+ const handleSignIn = async (provider: string) => {
+ try {
+ const { url } = await authApi.signInSocial(provider)
+ window.location.href = url
+ } catch (error) {
+ console.error('Sign in failed:', error)
+ }
+ }
+
+ return (
+
+
+
+
+
+ {t('comments.chooseProvider')}
+
+ {socialProviders?.providers.map((provider) => (
+ handleSignIn(provider.id)}
+ icon={}
+ >
+ {t('comments.signInWith', { provider: provider.name })}
+
+ ))}
+
+
+ )
+}
+
+// 登录平台图标
+const LoginPlatformIcon = ({ provider }: { provider: string }) => {
+ switch (provider) {
+ case 'github': {
+ return
+ }
+ case 'google': {
+ return (
+
+ )
+ }
+ default: {
+ return
+ }
+ }
+}
+
+// 用户菜单按钮
+const UserMenuButton = ({
+ user,
+}: {
+ user: { id: string; name?: string | null; image?: string | null; role?: string | null }
+}) => {
+ const { t } = useTranslation()
+ const isAdmin = user.role === 'admin' || user.role === 'superadmin'
+
+ // 如果是 admin,点击头像直接导航到 dashboard
+ if (isAdmin) {
+ return (
+
+ )
+ }
+
+ // 非 admin 用户显示菜单
+ return (
+
+
+
+
+
+
+
{user.name || user.id}
+
+
+ {
+ // TODO: Implement sign out
+ window.location.reload()
+ }}
+ icon={}
+ >
+ {t('action.signOut')}
+
+
+
+ )
+}
diff --git a/be/apps/core/src/locales/ui-schema/en.ts b/be/apps/core/src/locales/ui-schema/en.ts
index b813ac3e..59126647 100644
--- a/be/apps/core/src/locales/ui-schema/en.ts
+++ b/be/apps/core/src/locales/ui-schema/en.ts
@@ -149,11 +149,6 @@ const enUiSchema = {
title: 'GitHub',
helper: 'Supports full URLs or usernames.',
},
- rss: {
- title: 'Expose RSS feed',
- description: 'Enable to publish an RSS endpoint on the public site.',
- helper: 'Visitors can subscribe to the latest photos via RSS.',
- },
},
},
},
diff --git a/be/apps/core/src/locales/ui-schema/zh-CN.ts b/be/apps/core/src/locales/ui-schema/zh-CN.ts
index 691933d5..5c230fea 100644
--- a/be/apps/core/src/locales/ui-schema/zh-CN.ts
+++ b/be/apps/core/src/locales/ui-schema/zh-CN.ts
@@ -148,11 +148,6 @@ const zhCnUiSchema = {
title: 'GitHub',
helper: '支持完整链接或用户名。',
},
- rss: {
- title: '生成 RSS 订阅源',
- description: '启用后将在前台站点暴露 RSS 订阅入口。',
- helper: '开启后访客可通过 RSS 订阅最新照片。',
- },
},
},
},
diff --git a/be/apps/core/src/modules/configuration/setting/setting.constant.ts b/be/apps/core/src/modules/configuration/setting/setting.constant.ts
index 51d92388..7d435d20 100644
--- a/be/apps/core/src/modules/configuration/setting/setting.constant.ts
+++ b/be/apps/core/src/modules/configuration/setting/setting.constant.ts
@@ -134,25 +134,6 @@ export const DEFAULT_SETTING_DEFINITIONS = {
isSensitive: false,
schema: z.string().trim(),
},
- 'site.social.rss': {
- isSensitive: false,
- schema: z
- .string()
- .trim()
- .transform((value) => value.toLowerCase())
- .superRefine((value, ctx) => {
- if (value.length === 0) {
- return
- }
-
- if (value !== 'true' && value !== 'false') {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: 'RSS toggle must be either "true" or "false"',
- })
- }
- }),
- },
'site.feed.folo.challenge.feedId': {
isSensitive: false,
schema: z.string().trim(),
diff --git a/be/apps/core/src/modules/configuration/site-setting/site-setting.service.ts b/be/apps/core/src/modules/configuration/site-setting/site-setting.service.ts
index 04db1a19..d669e6c1 100644
--- a/be/apps/core/src/modules/configuration/site-setting/site-setting.service.ts
+++ b/be/apps/core/src/modules/configuration/site-setting/site-setting.service.ts
@@ -1,7 +1,7 @@
import { authUsers } from '@afilmory/db'
import { DbAccessor } from 'core/database/database.provider'
import { BizException, ErrorCode } from 'core/errors'
-import { normalizeStringToUndefined, parseBoolean } from 'core/helpers/normalize.helper'
+import { normalizeStringToUndefined } from 'core/helpers/normalize.helper'
import { requireTenantContext } from 'core/modules/platform/tenant/tenant.context'
import { asc, eq, sql } from 'drizzle-orm'
import { injectable } from 'tsyringe'
@@ -309,7 +309,6 @@ interface SiteConfigAuthor {
interface SiteConfigSocial {
twitter?: string
github?: string
- rss?: boolean
}
interface SiteConfigFeed {
@@ -408,11 +407,6 @@ function buildSocialConfig(values: SiteSettingValueMap): SiteConfig['social'] |
social.github = value
})
- const rss = parseBoolean(values['site.social.rss'])
- if (typeof rss === 'boolean') {
- social.rss = rss
- }
-
return Object.keys(social).length > 0 ? social : undefined
}
diff --git a/be/apps/core/src/modules/configuration/site-setting/site-setting.type.ts b/be/apps/core/src/modules/configuration/site-setting/site-setting.type.ts
index 529f0c24..eb56dbfb 100644
--- a/be/apps/core/src/modules/configuration/site-setting/site-setting.type.ts
+++ b/be/apps/core/src/modules/configuration/site-setting/site-setting.type.ts
@@ -10,7 +10,6 @@ export const SITE_SETTING_KEYS = [
'site.accentColor',
'site.social.twitter',
'site.social.github',
- 'site.social.rss',
'site.feed.folo.challenge.feedId',
'site.feed.folo.challenge.userId',
'site.map.providers',
diff --git a/be/apps/core/src/modules/configuration/site-setting/site-setting.ui-schema.ts b/be/apps/core/src/modules/configuration/site-setting/site-setting.ui-schema.ts
index a3388684..c4cb00db 100644
--- a/be/apps/core/src/modules/configuration/site-setting/site-setting.ui-schema.ts
+++ b/be/apps/core/src/modules/configuration/site-setting/site-setting.ui-schema.ts
@@ -128,18 +128,6 @@ export function createSiteSettingUiSchema(t: UiSchemaTFunction): UiSchemaDefault Site