fix:generateUrl

This commit is contained in:
shanhexi
2023-12-05 16:13:38 +08:00
parent ed91f7939e
commit 35992a1dee
3 changed files with 4 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ export enum ServiceStatus {
/**
* 轮询请求后端服务
*/
const usePollRequestService = ({ maxAttempts = 100, interval = 5000, loopService }: IProps) => {
const usePollRequestService = ({ maxAttempts = 200, interval = 100, loopService }: IProps) => {
const [serviceStatus, setServiceStatus] = useState<ServiceStatus>(ServiceStatus.PENDING);
const [attempts, setAttempts] = useState(0);
const [restart, setRestart] = useState(false);

View File

@@ -1,4 +1,4 @@
import createRequest from "./base";
import createRequest from './base';
const testService = createRequest<null, boolean>('/api/system', { errorLevel: false });
const systemStop = createRequest<void, void>('/api/system/stop', { errorLevel: false, method: 'post' });
const testApiSmooth = createRequest<void, void>('/api/system/get-version-a', { errorLevel: false, method: 'get' });
@@ -7,4 +7,4 @@ export default {
testService,
systemStop,
testApiSmooth,
}
};

View File

@@ -82,7 +82,7 @@ export function formatParams(obj: { [key: string]: any }) {
export function generateUrl(key: string) {
if (__ENV__ === 'desktop') {
return window.location.href + '/#/' + key;
return window.location.href.split('/#/')[0] + '/#/' + key;
}
return window.location.origin + '/' + key;
}