You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by le...@apache.org on 2023/02/13 02:43:24 UTC

[inlong] branch master updated: [INLONG-7360][Dashboard] env.local variable can not work (#7361)

This is an automated email from the ASF dual-hosted git repository.

leezng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ef55e578 [INLONG-7360][Dashboard] env.local variable can not work (#7361)
4ef55e578 is described below

commit 4ef55e578ec9de9d282b97162b4dbbcc698ba532
Author: Daniel <le...@apache.org>
AuthorDate: Mon Feb 13 10:43:19 2023 +0800

    [INLONG-7360][Dashboard] env.local variable can not work (#7361)
---
 inlong-dashboard/craco.config.ts |  1 +
 inlong-dashboard/src/App.tsx     | 31 ++++---------------------------
 inlong-dashboard/vite.config.ts  |  1 +
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/inlong-dashboard/craco.config.ts b/inlong-dashboard/craco.config.ts
index dddaa85e5..8feaa6265 100644
--- a/inlong-dashboard/craco.config.ts
+++ b/inlong-dashboard/craco.config.ts
@@ -23,6 +23,7 @@ import AntdDayjsWebpackPlugin from 'antd-dayjs-webpack-plugin';
 import type { CracoConfig } from 'craco__craco';
 import dotenv from 'dotenv';
 
+dotenv.config({ path: '.env.local' });
 dotenv.config();
 
 const config: CracoConfig = {
diff --git a/inlong-dashboard/src/App.tsx b/inlong-dashboard/src/App.tsx
index 8e86e418a..5859bbe4a 100644
--- a/inlong-dashboard/src/App.tsx
+++ b/inlong-dashboard/src/App.tsx
@@ -17,16 +17,12 @@
  * under the License.
  */
 
+/**
+ * No UI, No API
+ */
 import React, { Suspense, lazy, useEffect, useCallback } from 'react';
 import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom';
-import {
-  useLocation,
-  useHistory,
-  useDispatch,
-  UseRequestProvider,
-  useSelector,
-  useRequest,
-} from '@/hooks';
+import { useLocation, useHistory, useDispatch, UseRequestProvider, useSelector } from '@/hooks';
 import { Provider } from 'react-redux';
 import routes, { RouteProps } from '@/configs/routes';
 import { State } from '@/models';
@@ -78,25 +74,6 @@ const App = () => {
 
   const locale = useSelector<State, State['locale']>(state => state.locale);
 
-  useRequest(
-    {
-      url: '/user/currentUser',
-      method: 'POST',
-    },
-    {
-      onSuccess: result => {
-        dispatch({
-          type: 'setUserInfo',
-          payload: {
-            userName: result.name,
-            userId: result.userId,
-            roles: result.roles,
-          },
-        });
-      },
-    },
-  );
-
   const setCurrentMenu = useCallback(
     pathname => {
       dispatch({
diff --git a/inlong-dashboard/vite.config.ts b/inlong-dashboard/vite.config.ts
index a1a9339d0..d56f799bd 100644
--- a/inlong-dashboard/vite.config.ts
+++ b/inlong-dashboard/vite.config.ts
@@ -28,6 +28,7 @@ import eslintPlugin from 'vite-plugin-eslint';
 import ResolveEnvPlugin from './scripts/vite-plugin-resolve-env';
 import dotenv from 'dotenv';
 
+dotenv.config({ path: '.env.local' });
 dotenv.config();
 
 export default defineConfig({