add
This commit is contained in:
parent
c031e4f1c1
commit
939a313c9e
|
@ -1,17 +1,25 @@
|
||||||
|
|
||||||
import { useCallback, useMemo } from "react";
|
import { useCallback, useMemo } from "react";
|
||||||
import { env } from "../env";
|
import { env } from "../env";
|
||||||
export function useLocalSettings() {
|
export function useLocalSettings() {
|
||||||
const getBaseUrl = useCallback((protocol: string, port: number) => {
|
const getBaseUrl = useCallback((protocol: string, port: number) => {
|
||||||
return `${protocol}://${env.SERVER_IP}:${port}`;
|
return `${protocol}://${env.SERVER_IP}:${port}`;
|
||||||
}, []);
|
}, []);
|
||||||
const tusUrl = useMemo(() => getBaseUrl('http', 8080), [getBaseUrl]);
|
const tusUrl = useMemo(() => getBaseUrl("http", 8080), [getBaseUrl]);
|
||||||
const apiUrl = useMemo(() => getBaseUrl('http', 3000), [getBaseUrl]);
|
const apiUrl = useMemo(
|
||||||
const websocketUrl = useMemo(() => getBaseUrl('ws', 3000), [getBaseUrl]);
|
() => getBaseUrl("http", parseInt(env.SERVER_PORT)),
|
||||||
const checkIsTusUrl = useCallback((url: string) => {
|
[getBaseUrl]
|
||||||
return url.startsWith(tusUrl)
|
);
|
||||||
}, [tusUrl])
|
const websocketUrl = useMemo(() => getBaseUrl("ws", 3000), [getBaseUrl]);
|
||||||
return {
|
const checkIsTusUrl = useCallback(
|
||||||
apiUrl, websocketUrl, checkIsTusUrl, tusUrl
|
(url: string) => {
|
||||||
}
|
return url.startsWith(tusUrl);
|
||||||
}
|
},
|
||||||
|
[tusUrl]
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
apiUrl,
|
||||||
|
websocketUrl,
|
||||||
|
checkIsTusUrl,
|
||||||
|
tusUrl,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ server {
|
||||||
internal;
|
internal;
|
||||||
# 代理到认证服务
|
# 代理到认证服务
|
||||||
proxy_pass http://${SERVER_IP}:${SERVER_PORT}/auth/file;
|
proxy_pass http://${SERVER_IP}:${SERVER_PORT}/auth/file;
|
||||||
|
|
||||||
# 请求优化:不传递请求体
|
# 请求优化:不传递请求体
|
||||||
proxy_pass_request_body off;
|
proxy_pass_request_body off;
|
||||||
proxy_set_header Content-Length "";
|
proxy_set_header Content-Length "";
|
||||||
|
|
Loading…
Reference in New Issue