diff --git a/src/lang/enUS.ts b/src/lang/enUS.ts index 7da8baf..ad2b8c8 100644 --- a/src/lang/enUS.ts +++ b/src/lang/enUS.ts @@ -29,6 +29,7 @@ export const enUS = { description: 'Unlock AI, ER diagrams, bulk import/export, cross-engine migration, SSH tunnels and the MCP bridge.', cta: 'Upgrade', refresh: 'Refresh entitlements', + startFree: 'Start free', versionPermanent: 'Subscribed versions are permanently usable, even offline.', versionLockedOut: 'This release requires an active subscription to unlock. Renew to unlock it permanently.', }, diff --git a/src/lang/zhCN.ts b/src/lang/zhCN.ts index b42dfd8..f086981 100644 --- a/src/lang/zhCN.ts +++ b/src/lang/zhCN.ts @@ -29,6 +29,7 @@ export const zhCN = { description: '解锁 AI、ER 图、批量导入导出、跨引擎迁移、SSH 隧道与 MCP bridge。', cta: '升级', refresh: '刷新权益', + startFree: '免费开始', versionPermanent: '订阅期内发布的版本永久可用,支持离线。', versionLockedOut: '当前版本需要有效订阅解锁,续订后可永久解锁。', }, diff --git a/src/utils/authService.ts b/src/utils/authService.ts index 499ab71..45fd1fd 100644 --- a/src/utils/authService.ts +++ b/src/utils/authService.ts @@ -1,19 +1,13 @@ import { openUrl } from '@tauri-apps/plugin-opener' const GEEKFUN_BASE_URL = 'https://console-geekfun.wentsen.com' -const GEEKFUN_LOCAL_URL = 'http://localhost:5174' - -function getGeekfunUrl(): string { - const isDev = import.meta.env.DEV - return isDev ? GEEKFUN_LOCAL_URL : GEEKFUN_BASE_URL -} export async function openLoginUrl(): Promise { - const loginUrl = `${getGeekfunUrl()}/login?source=sqlkit` + const loginUrl = `${GEEKFUN_BASE_URL}/login?source=sqlkit` await openUrl(loginUrl) } export async function openRegisterUrl(): Promise { - const registerUrl = `${getGeekfunUrl()}/register?source=sqlkit` + const registerUrl = `${GEEKFUN_BASE_URL}/register?source=sqlkit` await openUrl(registerUrl) } diff --git a/src/views/setting/plan-section.vue b/src/views/setting/plan-section.vue index 9353dba..2cc403b 100644 --- a/src/views/setting/plan-section.vue +++ b/src/views/setting/plan-section.vue @@ -9,7 +9,7 @@ import { openUpgradeDialog } from '@/components/upgrade' import { useAccountStore } from '@/store/accountStore' import { useDeviceStore } from '@/store/deviceStore' import { useEntitlementStore } from '@/store/entitlementStore' -import { openLoginUrl } from '@/utils/authService' +import { openLoginUrl, openRegisterUrl } from '@/utils/authService' const { t } = useI18n() const entitlementStore = useEntitlementStore() @@ -18,7 +18,8 @@ const deviceStore = useDeviceStore() const refreshing = ref(false) onMounted(() => { - entitlementStore.refreshEntitlement(false) + if (accountStore.isLoggedIn) + entitlementStore.refreshEntitlement(false) }) const versionStateText = computed(() => { @@ -52,6 +53,10 @@ async function handleLogin() { await openLoginUrl() } +async function handleStartFree() { + await openRegisterUrl() +} + // Entitlements are account-scoped: the cached view and the device lease must // never outlive the account session on this machine. async function handleLogout() { @@ -83,18 +88,39 @@ async function handleLogout() {

{{ t('plan.section.cancelScheduled') }}

-

+

{{ t('plan.section.checkFailed') }}

- - +