feat: 添加登录模板页面

This commit is contained in:
landaiqing
2024-07-10 14:06:17 +08:00
parent cba745729f
commit 69ad5b0c55
4 changed files with 14 additions and 4 deletions

View File

@@ -11,11 +11,18 @@ export default defineConfig({
layout: { layout: {
title: '五味子云存储', title: '五味子云存储',
}, },
base: '/',
browserslist: ['> 1%', 'last 2 versions'],
routes: [ routes: [
{ {
path: '/', path: '/',
redirect: '/login', redirect: '/login',
}, },
{
path: '/login',
layout: false,
component: './Login',
},
{ {
name: '首页', name: '首页',
path: '/home', path: '/home',

View File

@@ -2,13 +2,14 @@
// 全局初始化数据配置,用于 Layout 用户信息和权限初始化 // 全局初始化数据配置,用于 Layout 用户信息和权限初始化
// 更多信息见文档https://umijs.org/docs/api/runtime-config#getinitialstate // 更多信息见文档https://umijs.org/docs/api/runtime-config#getinitialstate
import logo from '@/assets/images/logo.png';
export async function getInitialState(): Promise<{ name: string }> { export async function getInitialState(): Promise<{ name: string }> {
return { name: '@umijs/max' }; return { name: '五味子云存储' };
} }
export const layout = () => { export const layout = () => {
return { return {
logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg', logo: logo,
menu: { menu: {
locale: false, locale: false,
}, },

View File

@@ -2,6 +2,7 @@ import Guide from '@/components/Guide';
import { trim } from '@/utils/format'; import { trim } from '@/utils/format';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import React from 'react';
import styles from './index.less'; import styles from './index.less';
const HomePage: React.FC = () => { const HomePage: React.FC = () => {

View File

@@ -17,7 +17,7 @@ import {
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { Divider, Space, Tabs, message } from 'antd'; import { Divider, Space, Tabs, message } from 'antd';
import type { CSSProperties } from 'react'; import type { CSSProperties } from 'react';
import { useState } from 'react'; import React, { useState } from 'react';
import { history } from 'umi'; import { history } from 'umi';
type LoginType = 'phone' | 'account'; type LoginType = 'phone' | 'account';
const iconStyles: CSSProperties = { const iconStyles: CSSProperties = {
@@ -26,7 +26,7 @@ const iconStyles: CSSProperties = {
verticalAlign: 'middle', verticalAlign: 'middle',
cursor: 'pointer', cursor: 'pointer',
}; };
export default () => { const Login: React.FC = () => {
// console.log(name); // console.log(name);
const items = [ const items = [
{ label: '账户密码登录', key: 'account' }, { label: '账户密码登录', key: 'account' },
@@ -249,3 +249,4 @@ export default () => {
</div> </div>
); );
}; };
export default Login;