From 7d814d773739a0533917c8cdb64ea6bb21a2cfc2 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Wed, 12 Jun 2024 12:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/main.go | 2 +- src/Main.jsx | 4 ++-- src/components/LoginForm.jsx | 2 +- src/components/MovieCard.jsx | 2 +- src/components/VideoPlayer.jsx | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/main.go b/server/main.go index 1c7785f..44e459b 100644 --- a/server/main.go +++ b/server/main.go @@ -34,5 +34,5 @@ func main() { movie.Use(jwtMiddleware()) movie.GET("/", MovieList) - eg.Run(":4444") + eg.Run("0.0.0.0:4444") } diff --git a/src/Main.jsx b/src/Main.jsx index fd1a5e1..59280df 100644 --- a/src/Main.jsx +++ b/src/Main.jsx @@ -52,7 +52,7 @@ const Main = () => { setLoading(true); try { const response = await axios.get( - `${config.Host}/movie/?page=${page}&limit=${limit}&category=${category}` + `${window.location.origin}/movie/?page=${page}&limit=${limit}&category=${category}` ); if (response.status === 200) { @@ -74,7 +74,7 @@ const Main = () => { } finally { setLoading(false); } - }, [config.Host, limit]); + }, [window.location.origin, limit]); useEffect(() => { const currentCategory = params.lastCategory; diff --git a/src/components/LoginForm.jsx b/src/components/LoginForm.jsx index 180f559..350d6b1 100644 --- a/src/components/LoginForm.jsx +++ b/src/components/LoginForm.jsx @@ -23,7 +23,7 @@ function LoginForm() { e.preventDefault(); try { - const response = await axios.post(`${config.Host}/api/login`, new URLSearchParams({ + const response = await axios.post(`${window.location.origin}/api/login`, new URLSearchParams({ username, password, }), { diff --git a/src/components/MovieCard.jsx b/src/components/MovieCard.jsx index fd34d47..9659948 100644 --- a/src/components/MovieCard.jsx +++ b/src/components/MovieCard.jsx @@ -38,7 +38,7 @@ const MovieCard = ({ movie, config }) => { {truncateFilename(movie.filename, 15)} diff --git a/src/components/VideoPlayer.jsx b/src/components/VideoPlayer.jsx index d54f5e1..25360e5 100644 --- a/src/components/VideoPlayer.jsx +++ b/src/components/VideoPlayer.jsx @@ -30,7 +30,7 @@ const VideoPlayer = () => { {filename}