登录页面修正

This commit is contained in:
qianhao.xu 2024-05-14 09:01:32 +08:00
parent 4618d989b4
commit 7bde6a3acb
5 changed files with 6 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -3,10 +3,12 @@ import type { AppRouteModule } from '/@/router/types';
import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
//todo 父子路由 与父子组件
const dashboard: AppRouteModule = {
path: '/dashboard',
name: 'Dashboard',
component: LAYOUT,
//todo 重定向到 仪表板/analysis
redirect: '/dashboard/analysis',
meta: {
orderNo: 10,

View File

@ -95,6 +95,7 @@ export const useUserStore = defineStore({
// save token
this.setToken(token);
//todo 跳转 数据
return this.afterLoginAction(goHome);
} catch (error) {
return Promise.reject(error);
@ -118,6 +119,7 @@ export const useUserStore = defineStore({
router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw);
permissionStore.setDynamicAddedRoute(true);
}
// console.log("userInfo",userInfo);
goHome && (await router.replace(userInfo?.homePath || PageEnum.BASE_HOME));
}
return userInfo;

View File

@ -134,11 +134,13 @@
if (!data) return;
try {
loading.value = true;
//todo
const userInfo = await userStore.login({
password: data.password,
username: data.account,
mode: 'none', //
});
if (userInfo) {
notification.success({
message: t('sys.login.loginSuccessTitle'),