change to next
This commit is contained in:
13
backup/web/src/modules/basename.ts
Normal file
13
backup/web/src/modules/basename.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// @ts-ignore
|
||||
export const basename = BASE_NAME;
|
||||
|
||||
console.log(basename);
|
||||
|
||||
export const wrapBasename = (path: string) => {
|
||||
const hasEnd = path.endsWith('/')
|
||||
if (basename) {
|
||||
return `${basename}${path}` + (hasEnd ? '' : '/');
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
19
backup/web/src/modules/query.ts
Normal file
19
backup/web/src/modules/query.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { QueryClient } from '@kevisual/query'
|
||||
|
||||
const getUrl = () => {
|
||||
const host = window.location.host
|
||||
const isKevisual = host.includes('kevisual');
|
||||
if (isKevisual) {
|
||||
return '/api/router'
|
||||
}
|
||||
|
||||
return '/client/router'
|
||||
}
|
||||
|
||||
export const query = new QueryClient({
|
||||
url: '/api/router',
|
||||
});
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
url: getUrl(),
|
||||
});
|
||||
Reference in New Issue
Block a user