This commit is contained in:
eson 2024-06-12 12:51:12 +08:00
parent d1a9622d96
commit 7d814d7737
5 changed files with 6 additions and 6 deletions

View File

@ -34,5 +34,5 @@ func main() {
movie.Use(jwtMiddleware())
movie.GET("/", MovieList)
eg.Run(":4444")
eg.Run("0.0.0.0:4444")
}

View File

@ -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;

View File

@ -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,
}), {

View File

@ -38,7 +38,7 @@ const MovieCard = ({ movie, config }) => {
<CardMedia
component="img"
height="120"
image={`${config.Host}/res/${movie.image}`}
image={`${window.location.origin}/res/${movie.image}`}
/>
<CardContent>
<Typography>{truncateFilename(movie.filename, 15)}</Typography>

View File

@ -30,7 +30,7 @@ const VideoPlayer = () => {
{filename}
</Typography>
<ReactPlayer
url={`${config.Host}/res/${filename}`}
url={`${window.location.origin}/res/${filename}`}
controls
width="100%"
height="auto"