change to router
This commit is contained in:
@@ -1,21 +1,9 @@
|
||||
'use client';
|
||||
import { QueryClient } from '@kevisual/query'
|
||||
|
||||
export const getUrl = () => {
|
||||
if (typeof window === 'undefined') return '/client/router';
|
||||
const _url = new URL(location.href)
|
||||
const pathname = _url.pathname
|
||||
const [user, repo] = pathname.split('/').filter(Boolean)
|
||||
if (repo === 'v1') {
|
||||
return '/' + pathname;
|
||||
}
|
||||
return '/client/router'
|
||||
}
|
||||
import { QueryClient } from '@kevisual/query';
|
||||
|
||||
export const query = new QueryClient({
|
||||
url: '/api/router',
|
||||
});
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
url: getUrl(),
|
||||
url: '/client/router',
|
||||
});
|
||||
Reference in New Issue
Block a user