瀏覽代碼

fix(api-port): Api port removed from Api request if === 80

Lorenzo Simone 6 年之前
父節點
當前提交
0b8f63a932
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      admin-ui/src/app/data/data.module.ts

+ 7 - 1
admin-ui/src/app/data/data.module.ts

@@ -29,7 +29,13 @@ export function createApollo(
 ): ApolloClientOptions<any> {
     const { apiHost, apiPort, adminApiPath, tokenMethod } = getAppConfig();
     const host = apiHost === 'auto' ? `${location.protocol}//${location.hostname}` : apiHost;
-    const port = apiPort === 'auto' ? (location.port === '' ? '' : `:${location.port}`) : `:${apiPort}`;
+    const port = apiPort
+        ? apiPort === 'auto'
+            ? location.port === ''
+                ? ''
+                : `:${location.port}`
+            : `:${apiPort}`
+        : '';
     const apolloCache = new InMemoryCache({
         fragmentMatcher: new IntrospectionFragmentMatcher({
             introspectionQueryResultData: introspectionResult,