Просмотр исходного кода

fix: 内部应用token及nginx配置

wzyyy 3 лет назад
Родитель
Сommit
cc0c978c97
2 измененных файлов с 7 добавлено и 0 удалено
  1. 3 0
      docker/nginx.conf
  2. 4 0
      src/pages/iframe/index.tsx

+ 3 - 0
docker/nginx.conf

@@ -36,3 +36,6 @@ server {
         client_max_body_size    500m;
     }
 }
+http {
+    server_tokens off;
+}

+ 4 - 0
src/pages/iframe/index.tsx

@@ -2,6 +2,7 @@ import { PageContainer } from '@ant-design/pro-layout';
 import { useEffect, useState } from 'react';
 import { useLocation } from 'umi';
 import { service } from '../system/Apply';
+import Token from '@/utils/token';
 
 const Iframe = () => {
   const [iframeUrl, setIframeUrl] = useState<string>('');
@@ -20,6 +21,9 @@ const Iframe = () => {
         const urlStandalone = `${res.result.page.baseUrl}/api/application/sso/${appId}/login?redirect=${menuUrl}?layout=false`;
         setIframeUrl(urlStandalone);
         // console.log(urlStandalone);
+      } else if (res.result.provider === 'internal-integrated') {
+        const tokenUrl = `${res.result.page.baseUrl}?X-Access-Token=${Token.get()}`;
+        setIframeUrl(tokenUrl);
       } else {
         const urlOther = `${res.result.page.baseUrl}/${menuUrl}`;
         setIframeUrl(urlOther);