Skip to content

Commit

Permalink
auto login for nanrui
Browse files Browse the repository at this point in the history
  • Loading branch information
sjjian committed Apr 24, 2024
1 parent 6fe2ee1 commit 2038159
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ import useUserInfo from './hooks/useUserInfo';
import {
SQLE_DEFAULT_WEB_TITLE,
SQLE_REDIRECT_KEY_PARAMS_NAME,
SQLE_COOKIE_TOKEN_KEY_NAME,
} from './data/common';
import { useRequest } from 'ahooks';
import global from './api/global';
import { updateWebTitleAndLog } from './store/system';
import useNavigate from './hooks/useNavigate';
import { ThemeProvider } from '@mui/system';
import RouterAuth from './router/RouterAuth';
import { getCookie } from './utils/Common';
import { updateToken } from './store/user';

//fix https://github.com/actiontech/sqle/issues/1350
export const Wrapper: React.FC<{ children: ReactNode }> = ({ children }) => {
Expand All @@ -43,10 +46,13 @@ export const Wrapper: React.FC<{ children: ReactNode }> = ({ children }) => {

function App() {
const dispatch = useDispatch();
dispatch(updateToken({ token: getCookie(SQLE_COOKIE_TOKEN_KEY_NAME) }));

const token = useSelector<IReduxState, string>((state) => state.user.token);
const { antdLocale } = useLanguage();
const { currentThemeData } = useChangeTheme();
const { getUserInfo, getUserInfoLoading } = useUserInfo();

useRequest(() =>
global.getSQLEInfoV1().then((res) => {
const webTitle = res.data.data?.title ?? SQLE_DEFAULT_WEB_TITLE;
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const UI_VERSION = 'feature/issue-110 72a0e52';
export const UI_VERSION="temporary/nan-rui 6fe2ee16"

0 comments on commit 2038159

Please sign in to comment.