Skip to content

Commit 35992a1

Browse files
committed
fix:generateUrl
1 parent ed91f79 commit 35992a1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

chat2db-client/src/hooks/usePollRequestService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export enum ServiceStatus {
1818
/**
1919
* 轮询请求后端服务
2020
*/
21-
const usePollRequestService = ({ maxAttempts = 100, interval = 5000, loopService }: IProps) => {
21+
const usePollRequestService = ({ maxAttempts = 200, interval = 100, loopService }: IProps) => {
2222
const [serviceStatus, setServiceStatus] = useState<ServiceStatus>(ServiceStatus.PENDING);
2323
const [attempts, setAttempts] = useState(0);
2424
const [restart, setRestart] = useState(false);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import createRequest from "./base";
1+
import createRequest from './base';
22
const testService = createRequest<null, boolean>('/api/system', { errorLevel: false });
33
const systemStop = createRequest<void, void>('/api/system/stop', { errorLevel: false, method: 'post' });
44
const testApiSmooth = createRequest<void, void>('/api/system/get-version-a', { errorLevel: false, method: 'get' });
@@ -7,4 +7,4 @@ export default {
77
testService,
88
systemStop,
99
testApiSmooth,
10-
}
10+
};

chat2db-client/src/utils/url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function formatParams(obj: { [key: string]: any }) {
8282

8383
export function generateUrl(key: string) {
8484
if (__ENV__ === 'desktop') {
85-
return window.location.href + '/#/' + key;
85+
return window.location.href.split('/#/')[0] + '/#/' + key;
8686
}
8787
return window.location.origin + '/' + key;
8888
}

0 commit comments

Comments
 (0)