|
@@ -16,6 +16,7 @@ import Footer from '@/components/Footer';
|
|
import { fakeAccountLogin, getFakeCaptcha, LoginParamsType } from '@/services/login';
|
|
import { fakeAccountLogin, getFakeCaptcha, LoginParamsType } from '@/services/login';
|
|
|
|
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
|
|
+import {selectNavList} from "@/services/user";
|
|
|
|
|
|
const LoginMessage: React.FC<{
|
|
const LoginMessage: React.FC<{
|
|
content: string;
|
|
content: string;
|
|
@@ -55,8 +56,35 @@ const Login: React.FC<{}> = () => {
|
|
if (userInfo) {
|
|
if (userInfo) {
|
|
setInitialState({
|
|
setInitialState({
|
|
...initialState,
|
|
...initialState,
|
|
|
|
+ settings: {
|
|
|
|
+ menu: {
|
|
|
|
+ loading: true,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
currentUser: userInfo,
|
|
currentUser: userInfo,
|
|
});
|
|
});
|
|
|
|
+ const menuData = await selectNavList();
|
|
|
|
+ menuData.data = [
|
|
|
|
+ {
|
|
|
|
+ path: '/welcome',
|
|
|
|
+ name: 'welcome',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'list.table-list',
|
|
|
|
+ path: '/order',
|
|
|
|
+ }
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ setInitialState({
|
|
|
|
+ ...initialState,
|
|
|
|
+ currentUser: userInfo,
|
|
|
|
+ settings: {
|
|
|
|
+ menu: {
|
|
|
|
+ loading: false,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ menuData:menuData.data
|
|
|
|
+ });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -64,9 +92,9 @@ const Login: React.FC<{}> = () => {
|
|
setSubmitting(true);
|
|
setSubmitting(true);
|
|
try {
|
|
try {
|
|
// 登录
|
|
// 登录
|
|
- const msg = await fakeAccountLogin({ ...values, type });
|
|
|
|
- message.success('登录成功!');
|
|
|
|
|
|
+ await fakeAccountLogin({ ...values, type });
|
|
await fetchUserInfo();
|
|
await fetchUserInfo();
|
|
|
|
+ message.success('登录成功!');
|
|
goto();
|
|
goto();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error,'error')
|
|
console.log(error,'error')
|