mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2026-03-13 09:02:05 +08:00
fix:generateUrl
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user