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.Use(jwtMiddleware())
movie.GET("/", MovieList) movie.GET("/", MovieList)
eg.Run(":4444") eg.Run("0.0.0.0:4444")
} }

View File

@ -52,7 +52,7 @@ const Main = () => {
setLoading(true); setLoading(true);
try { try {
const response = await axios.get( 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) { if (response.status === 200) {
@ -74,7 +74,7 @@ const Main = () => {
} finally { } finally {
setLoading(false); setLoading(false);
} }
}, [config.Host, limit]); }, [window.location.origin, limit]);
useEffect(() => { useEffect(() => {
const currentCategory = params.lastCategory; const currentCategory = params.lastCategory;

View File

@ -23,7 +23,7 @@ function LoginForm() {
e.preventDefault(); e.preventDefault();
try { 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, username,
password, password,
}), { }), {

View File

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

View File

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