diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 08823d9..5415454 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -60,7 +60,7 @@ const useAuthStore = create((set, get) => ({ } } const token = await fetchLoginToken() - console.info('token: ' + token) + appendRequestParams('token', token) const fetchUrl = prepareUrl(HT_HOST + '/service-CooperateSOA/GetLinkManInfo') .append('token', token) diff --git a/src/views/App.jsx b/src/views/App.jsx index e4deb94..09f296a 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -16,6 +16,7 @@ import enLocale from 'antd/locale/en_US'; import 'dayjs/locale/zh-cn'; import { BUILD_VERSION, } from '@/config'; import useNoticeStore from '@/stores/Notice'; +import useAuthStore from '@/stores/Auth' const { Header, Content, Footer } = Layout; const { Title } = Typography; @@ -26,10 +27,13 @@ function App() { const [password, setPassword] = useState(''); const { authStore } = useStore(); const { notification } = AntApp.useApp(); - const login = toJS(authStore.login); + + const loginUser = useAuthStore((state) => state.loginUser) + + // const login = toJS(authStore.login); const noticeUnRead = useNoticeStore((state) => state.noticeUnRead); const href = useHref(); - const loginToken = login.token; + const loginToken = loginUser.token; const navigate = useNavigate(); const location = useLocation(); @@ -44,7 +48,7 @@ function App() { }, [location]); const onSubmit = () => { - authStore.valdateUserPassword(login.username, password) + authStore.valdateUserPassword(loginUser.username, password) .then(() => { authStore.fetchUserDetail() .catch(ex => { @@ -96,7 +100,7 @@ function App() { closable={false} maskClosable={false} footer={null} - open={login.timeout} + open={loginUser.timeout} >