Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
c7b42148
Unverified
Commit
c7b42148
authored
Feb 11, 2026
by
Wesley Liddick
Committed by
GitHub
Feb 11, 2026
Browse files
Merge pull request #559 from wucm667/fix/auth-page-logo
fix: 修复登录/注册页面自定义 Logo 不显示及闪烁问题
parents
bc1abb6a
ef2c35db
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/layout/AuthLayout.vue
View file @
c7b42148
...
...
@@ -29,17 +29,19 @@
<!-- Logo/Brand -->
<div
class=
"mb-8 text-center"
>
<!-- Custom Logo or Default Logo -->
<div
class=
"mb-4 inline-flex h-16 w-16 items-center justify-center overflow-hidden rounded-2xl shadow-lg shadow-primary-500/30"
>
<img
:src=
"siteLogo || '/logo.png'"
alt=
"Logo"
class=
"h-full w-full object-contain"
/>
</div>
<h1
class=
"text-gradient mb-2 text-3xl font-bold"
>
{{
siteName
}}
</h1>
<p
class=
"text-sm text-gray-500 dark:text-dark-400"
>
{{
siteSubtitle
}}
</p>
<template
v-if=
"settingsLoaded"
>
<div
class=
"mb-4 inline-flex h-16 w-16 items-center justify-center overflow-hidden rounded-2xl shadow-lg shadow-primary-500/30"
>
<img
:src=
"siteLogo || '/logo.png'"
alt=
"Logo"
class=
"h-full w-full object-contain"
/>
</div>
<h1
class=
"text-gradient mb-2 text-3xl font-bold"
>
{{
siteName
}}
</h1>
<p
class=
"text-sm text-gray-500 dark:text-dark-400"
>
{{
siteSubtitle
}}
</p>
</
template
>
</div>
<!-- Card Container -->
...
...
@@ -61,25 +63,21 @@
</template>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
onMounted
}
from
'
vue
'
import
{
getPublicSettings
}
from
'
@/
api/auth
'
import
{
computed
,
onMounted
}
from
'
vue
'
import
{
useAppStore
}
from
'
@/
stores
'
import
{
sanitizeUrl
}
from
'
@/utils/url
'
const
siteName
=
ref
(
'
Sub2API
'
)
const
siteLogo
=
ref
(
''
)
const
siteSubtitle
=
ref
(
'
Subscription to API Conversion Platform
'
)
const
appStore
=
useAppStore
()
const
siteName
=
computed
(()
=>
appStore
.
siteName
||
'
Sub2API
'
)
const
siteLogo
=
computed
(()
=>
sanitizeUrl
(
appStore
.
siteLogo
||
''
,
{
allowRelative
:
true
,
allowDataUrl
:
true
}))
const
siteSubtitle
=
computed
(()
=>
appStore
.
cachedPublicSettings
?.
site_subtitle
||
'
Subscription to API Conversion Platform
'
)
const
settingsLoaded
=
computed
(()
=>
appStore
.
publicSettingsLoaded
)
const
currentYear
=
computed
(()
=>
new
Date
().
getFullYear
())
onMounted
(
async
()
=>
{
try
{
const
settings
=
await
getPublicSettings
()
siteName
.
value
=
settings
.
site_name
||
'
Sub2API
'
siteLogo
.
value
=
sanitizeUrl
(
settings
.
site_logo
||
''
,
{
allowRelative
:
true
})
siteSubtitle
.
value
=
settings
.
site_subtitle
||
'
Subscription to API Conversion Platform
'
}
catch
(
error
)
{
console
.
error
(
'
Failed to load public settings:
'
,
error
)
}
onMounted
(()
=>
{
appStore
.
fetchPublicSettings
()
})
</
script
>
...
...
frontend/src/utils/url.ts
View file @
c7b42148
...
...
@@ -6,6 +6,7 @@
*/
type
SanitizeOptions
=
{
allowRelative
?:
boolean
allowDataUrl
?:
boolean
}
export
function
sanitizeUrl
(
value
:
string
,
options
:
SanitizeOptions
=
{}):
string
{
...
...
@@ -18,6 +19,11 @@ export function sanitizeUrl(value: string, options: SanitizeOptions = {}): strin
return
trimmed
}
// 允许 data:image/ 开头的 data URL(仅限图片类型)
if
(
options
.
allowDataUrl
&&
trimmed
.
startsWith
(
'
data:image/
'
))
{
return
trimmed
}
// 只接受绝对 URL,不使用 base URL 来避免相对路径被解析为当前域名
// 检查是否以 http:// 或 https:// 开头
if
(
!
trimmed
.
match
(
/^https
?
:
\/\/
/i
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment