|
@@ -1,5 +1,5 @@
|
|
import { createContext, useEffect, useState } from 'react';
|
|
import { createContext, useEffect, useState } from 'react';
|
|
-import { MILVUS_CLIENT_ID, LAST_TIME_ADDRESS, LOGIN_USERNAME } from '@/consts';
|
|
|
|
|
|
+import { MILVUS_CLIENT_ID, LOGIN_USERNAME } from '@/consts';
|
|
import { AuthContextType } from './Types';
|
|
import { AuthContextType } from './Types';
|
|
|
|
|
|
export const authContext = createContext<AuthContextType>({
|
|
export const authContext = createContext<AuthContextType>({
|
|
@@ -19,7 +19,7 @@ const { Provider } = authContext;
|
|
export const AuthProvider = (props: { children: React.ReactNode }) => {
|
|
export const AuthProvider = (props: { children: React.ReactNode }) => {
|
|
// get milvus address from local storage
|
|
// get milvus address from local storage
|
|
const [address, setAddress] = useState<string>(
|
|
const [address, setAddress] = useState<string>(
|
|
- window.localStorage.getItem(LAST_TIME_ADDRESS) || ''
|
|
|
|
|
|
+ window.localStorage.getItem(MILVUS_CLIENT_ID) || ''
|
|
);
|
|
);
|
|
// get login username from local storage
|
|
// get login username from local storage
|
|
const [username, setUsername] = useState<string>(
|
|
const [username, setUsername] = useState<string>(
|