File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11VITE_BASE_URL = /api
22
3+ # =======Production environment variables=======
4+ SERVER_URL = https://dev.eigent.ai
35VITE_PROXY_URL = https://dev.eigent.ai
6+ VITE_SITE_URL = https://www.eigent.ai
47VITE_USE_LOCAL_PROXY = false
58
9+ # =======Local environment variables=======
610# VITE_PROXY_URL=http://localhost:3001
711# VITE_USE_LOCAL_PROXY=true
812
Original file line number Diff line number Diff line change @@ -289,6 +289,16 @@ export async function startBackend(
289289 }
290290 }
291291
292+ // In dev mode, also check .env.development for SERVER_URL
293+ if ( ! resolvedServerUrl && devServerUrl ) {
294+ const devEnvPath = path . join ( app . getAppPath ( ) , '.env.development' ) ;
295+ const devFileServerUrl = readEnvValue ( devEnvPath , 'SERVER_URL' ) ;
296+ if ( devFileServerUrl ) {
297+ resolvedServerUrl = devFileServerUrl ;
298+ resolvedSource = `dev env file SERVER_URL (${ devEnvPath } )` ;
299+ }
300+ }
301+
292302 if ( ! resolvedServerUrl && process . env . SERVER_URL ) {
293303 resolvedServerUrl = process . env . SERVER_URL ;
294304 resolvedSource = 'process.env SERVER_URL' ;
Original file line number Diff line number Diff line change 1313// ========= Copyright 2025-2026 @ Eigent.ai All Rights Reserved. =========
1414
1515import i18n from '@/i18n' ;
16+ import { SITE_URL } from '@/lib' ;
1617import { toast } from 'sonner' ;
1718
1819export function showCreditsToast ( ) {
@@ -22,7 +23,7 @@ export function showCreditsToast() {
2223 { i18n . t ( 'chat.you-ve-reached-the-limit-of-your-current-plan' ) }
2324 < a
2425 className = "cursor-pointer underline"
25- onClick = { ( ) => ( window . location . href = 'https://www.eigent.ai/ pricing' ) }
26+ onClick = { ( ) => ( window . location . href = ` ${ SITE_URL } / pricing` ) }
2627 >
2728 { i18n . t ( 'chat.upgrade' ) }
2829 </ a > { ' ' }
Original file line number Diff line number Diff line change 1313// ========= Copyright 2025-2026 @ Eigent.ai All Rights Reserved. =========
1414
1515import i18n from '@/i18n' ;
16+ import { SITE_URL } from '@/lib' ;
1617import { toast } from 'sonner' ;
1718
1819export function showStorageToast ( ) {
@@ -25,7 +26,7 @@ export function showStorageToast() {
2526 Please{ ' ' }
2627 < a
2728 className = "cursor-pointer underline"
28- onClick = { ( ) => ( window . location . href = 'https://www.eigent.ai/ pricing' ) }
29+ onClick = { ( ) => ( window . location . href = ` ${ SITE_URL } / pricing` ) }
2930 >
3031 { i18n . t ( 'chat.upgrade' ) }
3132 </ a > { ' ' }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import EndNoticeDialog from '@/components/Dialog/EndNotice';
2525import { Button } from '@/components/ui/button' ;
2626import { TooltipSimple } from '@/components/ui/tooltip' ;
2727import useChatStoreAdapter from '@/hooks/useChatStoreAdapter' ;
28+ import { SITE_URL } from '@/lib' ;
2829import { share } from '@/lib/share' ;
2930import { useAuthStore } from '@/store/authStore' ;
3031import { useInstallationUI } from '@/store/installationStore' ;
@@ -113,7 +114,7 @@ function HeaderWin() {
113114 try {
114115 const res : any = await proxyFetchGet ( '/api/v1/user/invite_code' ) ;
115116 if ( res ?. invite_code ) {
116- const inviteLink = `https://www.eigent.ai /signup?invite_code=${ res . invite_code } ` ;
117+ const inviteLink = `${ SITE_URL } /signup?invite_code=${ res . invite_code } ` ;
117118 await navigator . clipboard . writeText ( inviteLink ) ;
118119 toast . success ( t ( 'layout.invitation-link-copied' ) ) ;
119120 } else {
Original file line number Diff line number Diff line change 1414
1515import { getAuthStore } from '@/store/authStore' ;
1616
17+ export const SITE_URL =
18+ import . meta. env . VITE_SITE_URL || 'https://www.eigent.ai' ;
19+
1720export function getProxyBaseURL ( ) {
1821 const isDev = import . meta. env . DEV ;
1922
Original file line number Diff line number Diff line change 1313// ========= Copyright 2025-2026 @ Eigent.ai All Rights Reserved. =========
1414
1515import { proxyFetchPost } from '@/api/http' ;
16+ import { SITE_URL } from '@/lib' ;
1617import { toast } from 'sonner' ;
1718
1819export const share = async ( taskId : string ) => {
1920 try {
2021 const res = await proxyFetchPost ( `/api/v1/chat/share` , {
2122 task_id : taskId ,
2223 } ) ;
23- const shareLink = `${ import . meta. env . VITE_USE_LOCAL_PROXY === 'true' ? 'eigent://callback' : 'https://www.eigent.ai/ download' } ?share_token=${ res . share_token } __${ taskId } ` ;
24+ const shareLink = `${ import . meta. env . VITE_USE_LOCAL_PROXY === 'true' ? 'eigent://callback' : ` ${ SITE_URL } / download` } ?share_token=${ res . share_token } __${ taskId } ` ;
2425 navigator . clipboard
2526 . writeText ( shareLink )
2627 . then ( ( ) => {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
3737 SelectTrigger ,
3838 SelectValue ,
3939} from '@/components/ui/select' ;
40+ import { SITE_URL } from '@/lib' ;
4041import { INIT_PROVODERS } from '@/lib/llm' ;
4142import { useAuthStore } from '@/store/authStore' ;
4243import { Provider } from '@/types' ;
@@ -1200,7 +1201,7 @@ export default function SettingModels() {
12001201 </ span >
12011202 < span
12021203 onClick = { ( ) => {
1203- window . location . href = `https://www.eigent.ai /pricing` ;
1204+ window . location . href = `${ SITE_URL } /pricing` ;
12041205 } }
12051206 className = "cursor-pointer text-body-sm text-text-label underline"
12061207 >
@@ -1223,7 +1224,7 @@ export default function SettingModels() {
12231224 </ div >
12241225 < Button
12251226 onClick = { ( ) => {
1226- window . location . href = `https://www.eigent.ai /dashboard` ;
1227+ window . location . href = `${ SITE_URL } /dashboard` ;
12271228 } }
12281229 variant = "primary"
12291230 size = "sm"
You can’t perform that action at this time.
0 commit comments