1
1
import React from 'react' ;
2
2
import { LoginScreen } from './components/LoginScreen' ;
3
3
import { Dashboard } from './components/Dashboard' ;
4
+ import { DebugInfo } from './components/DebugInfo' ;
4
5
import { useAuth } from './hooks/useAuth' ;
5
6
import { GameShell } from '../../carrot/components/GameShell' ;
6
7
7
8
export const DemoWithBackend : React . FC = ( ) => {
8
9
const { user, isLoading } = useAuth ( ) ;
9
10
11
+ // 添加环境变量调试信息
12
+ React . useEffect ( ( ) => {
13
+ console . log ( 'DemoWithBackend Environment Variables:' , {
14
+ VITE_BACKEND_URL : import . meta. env . VITE_BACKEND_URL ,
15
+ VITE_PUBLIC_URL : import . meta. env . VITE_PUBLIC_URL ,
16
+ BASE_URL : import . meta. env . BASE_URL ,
17
+ MODE : import . meta. env . MODE ,
18
+ DEV : import . meta. env . DEV ,
19
+ window_location_origin : window . location . origin ,
20
+ window_location_href : window . location . href
21
+ } ) ;
22
+ } , [ ] ) ;
23
+
10
24
if ( isLoading ) {
11
25
return (
12
26
< GameShell orientation = "landscape" >
@@ -16,13 +30,15 @@ export const DemoWithBackend: React.FC = () => {
16
30
< p className = "text-gray-600" > 正在加载...</ p >
17
31
</ div >
18
32
</ div >
33
+ < DebugInfo />
19
34
</ GameShell >
20
35
) ;
21
36
}
22
37
23
38
return (
24
39
< GameShell orientation = "landscape" >
25
40
{ user ? < Dashboard /> : < LoginScreen /> }
41
+ < DebugInfo />
26
42
</ GameShell >
27
43
) ;
28
44
} ;
0 commit comments