feat(infra): framework

This commit is contained in:
EYHN
2024-04-17 14:12:29 +08:00
parent ab17a05df3
commit 06fda3b62c
467 changed files with 9996 additions and 8697 deletions
+4 -1
View File
@@ -2,7 +2,6 @@ export * from './error';
export * from './fetcher';
export * from './graphql';
export * from './schema';
export * from './utils';
import { setupGlobal } from '@affine/env/global';
@@ -14,6 +13,10 @@ export function getBaseUrl(): string {
if (environment.isDesktop) {
return runtimeConfig.serverUrlPrefix;
}
if (typeof window === 'undefined') {
// is nodejs
return '';
}
const { protocol, hostname, port } = window.location;
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
}