Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
feat: update login form
Browse files Browse the repository at this point in the history
  • Loading branch information
pdsuwwz committed Nov 29, 2021
1 parent ec974e9 commit bd1c8dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "git+https://github.com/pdsuwwz/vite-react-starter.git"
},
"scripts": {
"serve": "vite --host",
"dev": "vite --host",
"build": "tsc && vite build",
"preview": "vite preview --host",
"lint": "tsc --pretty && eslint ./src --ext .js,.jsx,.tsx,.ts",
Expand Down
21 changes: 11 additions & 10 deletions src/modules/UserAccount/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@/modules/UserAccount/styles/login.scss'
import Footer from '@/components/Footer'
import config from '@/config'
import { Button, Input, Form } from 'antd'
import { useHistory, useLocation } from 'react-router-dom'
import { useHistory } from 'react-router-dom'

import {
LockOutlined,
Expand All @@ -19,12 +19,16 @@ import { RespData } from '@/utils/request'
import { useAppDispatch } from '@/store'
import TodoModule from '@/modules/UserAccount/store'

export interface FormProps {
email: string,
password: string
}


const LoginPage: React.FC = () => {
const history = useHistory()
const dispatch = useAppDispatch()
const location = useLocation()
const [form] = Form.useForm()
const [form] = Form.useForm<FormProps>()
const [loading, setLoading] = useState(false)

const handleSubmit = async () => {
Expand All @@ -42,13 +46,10 @@ const LoginPage: React.FC = () => {
}

useEffect(() => {
if (config.isDevelopment) {
form.setFieldsValue({
email: '[email protected]',
userName: 'admin',
password: ''
})
}
form.setFieldsValue({
email: '[email protected]',
password: ''
})
}, [form])


Expand Down

0 comments on commit bd1c8dc

Please sign in to comment.