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
4fee20ec
Commit
4fee20ec
authored
Apr 08, 2026
by
陈曦
Browse files
去除版本在页面的上的展示
parent
2b4c7986
Changes
12
Hide whitespace changes
Inline
Side-by-side
backend/cmd/server/main.go
View file @
4fee20ec
...
@@ -64,7 +64,7 @@ func main() {
...
@@ -64,7 +64,7 @@ func main() {
flag
.
Parse
()
flag
.
Parse
()
if
*
showVersion
{
if
*
showVersion
{
log
.
Printf
(
"
Sub2
API %s (commit: %s, built: %s)
\n
"
,
Version
,
Commit
,
Date
)
log
.
Printf
(
"
Traffic
API %s (commit: %s, built: %s)
\n
"
,
Version
,
Commit
,
Date
)
return
return
}
}
...
@@ -114,7 +114,7 @@ func runSetupServer() {
...
@@ -114,7 +114,7 @@ func runSetupServer() {
// This allows users to run setup on a different address if needed
// This allows users to run setup on a different address if needed
addr
:=
config
.
GetServerAddress
()
addr
:=
config
.
GetServerAddress
()
log
.
Printf
(
"Setup wizard available at http://%s"
,
addr
)
log
.
Printf
(
"Setup wizard available at http://%s"
,
addr
)
log
.
Println
(
"Complete the setup wizard to configure
Sub2
API"
)
log
.
Println
(
"Complete the setup wizard to configure
Traffic
API"
)
server
:=
&
http
.
Server
{
server
:=
&
http
.
Server
{
Addr
:
addr
,
Addr
:
addr
,
...
...
backend/internal/service/auth_service.go
View file @
4fee20ec
...
@@ -271,7 +271,7 @@ func (s *AuthService) SendVerifyCode(ctx context.Context, email string) error {
...
@@ -271,7 +271,7 @@ func (s *AuthService) SendVerifyCode(ctx context.Context, email string) error {
}
}
// 获取网站名称
// 获取网站名称
siteName
:=
"
Sub2
API"
siteName
:=
"
Traffic
API"
if
s
.
settingService
!=
nil
{
if
s
.
settingService
!=
nil
{
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
}
}
...
@@ -314,7 +314,7 @@ func (s *AuthService) SendVerifyCodeAsync(ctx context.Context, email string) (*S
...
@@ -314,7 +314,7 @@ func (s *AuthService) SendVerifyCodeAsync(ctx context.Context, email string) (*S
}
}
// 获取网站名称
// 获取网站名称
siteName
:=
"
Sub2
API"
siteName
:=
"
Traffic
API"
if
s
.
settingService
!=
nil
{
if
s
.
settingService
!=
nil
{
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
}
}
...
@@ -962,7 +962,7 @@ func (s *AuthService) preparePasswordReset(ctx context.Context, email, frontendB
...
@@ -962,7 +962,7 @@ func (s *AuthService) preparePasswordReset(ctx context.Context, email, frontendB
}
}
// Get site name
// Get site name
siteName
:=
"
Sub2
API"
siteName
:=
"
Traffic
API"
if
s
.
settingService
!=
nil
{
if
s
.
settingService
!=
nil
{
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
siteName
=
s
.
settingService
.
GetSiteName
(
ctx
)
}
}
...
...
backend/internal/service/setting_service.go
View file @
4fee20ec
...
@@ -194,7 +194,7 @@ func (s *SettingService) GetPublicSettings(ctx context.Context) (*PublicSettings
...
@@ -194,7 +194,7 @@ func (s *SettingService) GetPublicSettings(ctx context.Context) (*PublicSettings
TotpEnabled
:
settings
[
SettingKeyTotpEnabled
]
==
"true"
,
TotpEnabled
:
settings
[
SettingKeyTotpEnabled
]
==
"true"
,
TurnstileEnabled
:
settings
[
SettingKeyTurnstileEnabled
]
==
"true"
,
TurnstileEnabled
:
settings
[
SettingKeyTurnstileEnabled
]
==
"true"
,
TurnstileSiteKey
:
settings
[
SettingKeyTurnstileSiteKey
],
TurnstileSiteKey
:
settings
[
SettingKeyTurnstileSiteKey
],
SiteName
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteName
,
"
Sub2
API"
),
SiteName
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteName
,
"
Traffic
API"
),
SiteLogo
:
settings
[
SettingKeySiteLogo
],
SiteLogo
:
settings
[
SettingKeySiteLogo
],
SiteSubtitle
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteSubtitle
,
"Subscription to API Conversion Platform"
),
SiteSubtitle
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteSubtitle
,
"Subscription to API Conversion Platform"
),
APIBaseURL
:
settings
[
SettingKeyAPIBaseURL
],
APIBaseURL
:
settings
[
SettingKeyAPIBaseURL
],
...
@@ -757,7 +757,7 @@ func (s *SettingService) IsTotpEncryptionKeyConfigured() bool {
...
@@ -757,7 +757,7 @@ func (s *SettingService) IsTotpEncryptionKeyConfigured() bool {
func
(
s
*
SettingService
)
GetSiteName
(
ctx
context
.
Context
)
string
{
func
(
s
*
SettingService
)
GetSiteName
(
ctx
context
.
Context
)
string
{
value
,
err
:=
s
.
settingRepo
.
GetValue
(
ctx
,
SettingKeySiteName
)
value
,
err
:=
s
.
settingRepo
.
GetValue
(
ctx
,
SettingKeySiteName
)
if
err
!=
nil
||
value
==
""
{
if
err
!=
nil
||
value
==
""
{
return
"
Sub2
API"
return
"
Traffic
API"
}
}
return
value
return
value
}
}
...
@@ -813,7 +813,7 @@ func (s *SettingService) InitializeDefaultSettings(ctx context.Context) error {
...
@@ -813,7 +813,7 @@ func (s *SettingService) InitializeDefaultSettings(ctx context.Context) error {
SettingKeyEmailVerifyEnabled
:
"false"
,
SettingKeyEmailVerifyEnabled
:
"false"
,
SettingKeyRegistrationEmailSuffixWhitelist
:
"[]"
,
SettingKeyRegistrationEmailSuffixWhitelist
:
"[]"
,
SettingKeyPromoCodeEnabled
:
"true"
,
// 默认启用优惠码功能
SettingKeyPromoCodeEnabled
:
"true"
,
// 默认启用优惠码功能
SettingKeySiteName
:
"
Sub2
API"
,
SettingKeySiteName
:
"
Traffic
API"
,
SettingKeySiteLogo
:
""
,
SettingKeySiteLogo
:
""
,
SettingKeyPurchaseSubscriptionEnabled
:
"false"
,
SettingKeyPurchaseSubscriptionEnabled
:
"false"
,
SettingKeyPurchaseSubscriptionURL
:
""
,
SettingKeyPurchaseSubscriptionURL
:
""
,
...
@@ -872,7 +872,7 @@ func (s *SettingService) parseSettings(settings map[string]string) *SystemSettin
...
@@ -872,7 +872,7 @@ func (s *SettingService) parseSettings(settings map[string]string) *SystemSettin
TurnstileEnabled
:
settings
[
SettingKeyTurnstileEnabled
]
==
"true"
,
TurnstileEnabled
:
settings
[
SettingKeyTurnstileEnabled
]
==
"true"
,
TurnstileSiteKey
:
settings
[
SettingKeyTurnstileSiteKey
],
TurnstileSiteKey
:
settings
[
SettingKeyTurnstileSiteKey
],
TurnstileSecretKeyConfigured
:
settings
[
SettingKeyTurnstileSecretKey
]
!=
""
,
TurnstileSecretKeyConfigured
:
settings
[
SettingKeyTurnstileSecretKey
]
!=
""
,
SiteName
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteName
,
"
Sub2
API"
),
SiteName
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteName
,
"
Traffic
API"
),
SiteLogo
:
settings
[
SettingKeySiteLogo
],
SiteLogo
:
settings
[
SettingKeySiteLogo
],
SiteSubtitle
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteSubtitle
,
"Subscription to API Conversion Platform"
),
SiteSubtitle
:
s
.
getStringOrDefault
(
settings
,
SettingKeySiteSubtitle
,
"Subscription to API Conversion Platform"
),
APIBaseURL
:
settings
[
SettingKeyAPIBaseURL
],
APIBaseURL
:
settings
[
SettingKeyAPIBaseURL
],
...
...
backend/internal/service/totp_service.go
View file @
4fee20ec
...
@@ -83,7 +83,7 @@ const (
...
@@ -83,7 +83,7 @@ const (
totpLoginTTL
=
5
*
time
.
Minute
totpLoginTTL
=
5
*
time
.
Minute
totpAttemptsTTL
=
15
*
time
.
Minute
totpAttemptsTTL
=
15
*
time
.
Minute
maxTotpAttempts
=
5
maxTotpAttempts
=
5
totpIssuer
=
"
Sub2
API"
totpIssuer
=
"
Traffic
API"
)
)
// TotpService handles TOTP operations
// TotpService handles TOTP operations
...
...
backend/internal/setup/cli.go
View file @
4fee20ec
...
@@ -51,7 +51,7 @@ func RunCLI() error {
...
@@ -51,7 +51,7 @@ func RunCLI() error {
fmt
.
Println
()
fmt
.
Println
()
fmt
.
Println
(
"╔═══════════════════════════════════════════╗"
)
fmt
.
Println
(
"╔═══════════════════════════════════════════╗"
)
fmt
.
Println
(
"║
Sub2
API Installation Wizard
║"
)
fmt
.
Println
(
"║
Traffic
API Installation Wizard ║"
)
fmt
.
Println
(
"╚═══════════════════════════════════════════╝"
)
fmt
.
Println
(
"╚═══════════════════════════════════════════╝"
)
fmt
.
Println
()
fmt
.
Println
()
...
...
backend/migrations/091_rename_sub2api_to_trafficapi.sql
0 → 100644
View file @
4fee20ec
-- 将默认站点名称从 "Sub2API" 更新为 "TrafficAPI"
-- 仅更新仍为旧默认值的记录,不覆盖管理员自定义的站点名称
UPDATE
settings
SET
value
=
'TrafficAPI'
,
updated_at
=
NOW
()
WHERE
key
=
'site_name'
AND
value
=
'Sub2API'
;
frontend/index.html
View file @
4fee20ec
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<meta
charset=
"UTF-8"
/>
<meta
charset=
"UTF-8"
/>
<link
rel=
"icon"
type=
"image/png"
href=
"/logo.png"
/>
<link
rel=
"icon"
type=
"image/png"
href=
"/logo.png"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
Sub2
API - AI API Gateway
</title>
<title>
Traffic
API - AI API Gateway
</title>
</head>
</head>
<body>
<body>
<div
id=
"app"
></div>
<div
id=
"app"
></div>
...
...
frontend/src/api/index.ts
View file @
4fee20ec
/**
/**
* API Client for
Sub2
API Backend
* API Client for
Traffic
API Backend
* Central export point for all API modules
* Central export point for all API modules
*/
*/
...
...
frontend/src/components/layout/AppSidebar.vue
View file @
4fee20ec
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
{{
siteName
}}
{{
siteName
}}
</span>
</span>
<!-- Version Badge -->
<!-- Version Badge -->
<VersionBadge
:version=
"siteVersion"
/>
<!--
<VersionBadge
:version=
"siteVersion"
/>
-->
</div>
</div>
</transition>
</transition>
</div>
</div>
...
@@ -151,7 +151,6 @@ import { computed, h, onMounted, ref, watch } from 'vue'
...
@@ -151,7 +151,6 @@ import { computed, h, onMounted, ref, watch } from 'vue'
import
{
useRoute
}
from
'
vue-router
'
import
{
useRoute
}
from
'
vue-router
'
import
{
useI18n
}
from
'
vue-i18n
'
import
{
useI18n
}
from
'
vue-i18n
'
import
{
useAdminSettingsStore
,
useAppStore
,
useAuthStore
,
useOnboardingStore
}
from
'
@/stores
'
import
{
useAdminSettingsStore
,
useAppStore
,
useAuthStore
,
useOnboardingStore
}
from
'
@/stores
'
import
VersionBadge
from
'
@/components/common/VersionBadge.vue
'
import
{
sanitizeSvg
}
from
'
@/utils/sanitize
'
import
{
sanitizeSvg
}
from
'
@/utils/sanitize
'
interface
NavItem
{
interface
NavItem
{
...
@@ -178,7 +177,6 @@ const isDark = ref(document.documentElement.classList.contains('dark'))
...
@@ -178,7 +177,6 @@ const isDark = ref(document.documentElement.classList.contains('dark'))
// Site settings from appStore (cached, no flicker)
// Site settings from appStore (cached, no flicker)
const
siteName
=
computed
(()
=>
appStore
.
siteName
)
const
siteName
=
computed
(()
=>
appStore
.
siteName
)
const
siteLogo
=
computed
(()
=>
appStore
.
siteLogo
)
const
siteLogo
=
computed
(()
=>
appStore
.
siteLogo
)
const
siteVersion
=
computed
(()
=>
appStore
.
siteVersion
)
const
settingsLoaded
=
computed
(()
=>
appStore
.
publicSettingsLoaded
)
const
settingsLoaded
=
computed
(()
=>
appStore
.
publicSettingsLoaded
)
// SVG Icon Components
// SVG Icon Components
...
...
frontend/src/router/index.ts
View file @
4fee20ec
/**
/**
* Vue Router configuration for
Sub2
API frontend
* Vue Router configuration for
Traffic
API frontend
* Defines all application routes with lazy loading and navigation guards
* Defines all application routes with lazy loading and navigation guards
*/
*/
...
...
frontend/src/styles/onboarding.css
View file @
4fee20ec
/*
Sub2
API Interactive Tour Styles - DOM Restructured Version */
/*
Traffic
API Interactive Tour Styles - DOM Restructured Version */
/* 1. Overlay & Highlight */
/* 1. Overlay & Highlight */
.driver-overlay
{
.driver-overlay
{
...
...
frontend/src/types/index.ts
View file @
4fee20ec
/**
/**
* Core Type Definitions for
Sub2
API Frontend
* Core Type Definitions for
Traffic
API Frontend
*/
*/
// ==================== Common Types ====================
// ==================== Common Types ====================
...
...
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