From 69ad5b0c55683ae35373d60cc140f5a4d82ee70d Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Wed, 10 Jul 2024 14:06:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .umirc.ts | 7 +++++++ src/app.ts | 5 +++-- src/pages/Home/index.tsx | 1 + src/pages/Login/index.tsx | 5 +++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.umirc.ts b/.umirc.ts index ec3d2c5..86da767 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -11,11 +11,18 @@ export default defineConfig({ layout: { title: '五味子云存储', }, + base: '/', + browserslist: ['> 1%', 'last 2 versions'], routes: [ { path: '/', redirect: '/login', }, + { + path: '/login', + layout: false, + component: './Login', + }, { name: '首页', path: '/home', diff --git a/src/app.ts b/src/app.ts index bb2b25f..8015d95 100644 --- a/src/app.ts +++ b/src/app.ts @@ -2,13 +2,14 @@ // 全局初始化数据配置,用于 Layout 用户信息和权限初始化 // 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate +import logo from '@/assets/images/logo.png'; export async function getInitialState(): Promise<{ name: string }> { - return { name: '@umijs/max' }; + return { name: '五味子云存储' }; } export const layout = () => { return { - logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg', + logo: logo, menu: { locale: false, }, diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 809f922..a07ee8c 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -2,6 +2,7 @@ import Guide from '@/components/Guide'; import { trim } from '@/utils/format'; import { PageContainer } from '@ant-design/pro-components'; import { useModel } from '@umijs/max'; +import React from 'react'; import styles from './index.less'; const HomePage: React.FC = () => { diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index 2aa13f4..7346119 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -17,7 +17,7 @@ import { } from '@ant-design/pro-components'; import { Divider, Space, Tabs, message } from 'antd'; import type { CSSProperties } from 'react'; -import { useState } from 'react'; +import React, { useState } from 'react'; import { history } from 'umi'; type LoginType = 'phone' | 'account'; const iconStyles: CSSProperties = { @@ -26,7 +26,7 @@ const iconStyles: CSSProperties = { verticalAlign: 'middle', cursor: 'pointer', }; -export default () => { +const Login: React.FC = () => { // console.log(name); const items = [ { label: '账户密码登录', key: 'account' }, @@ -249,3 +249,4 @@ export default () => { ); }; +export default Login;