Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
fix: remeber on login by default
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed May 7, 2024
1 parent 0224c5a commit a6b7453
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const LoginForm: React.FC = () => {
const defUsername = localStorage.getItem('currentUsername')
const [username, setUsername] = useState(defUsername ?? '')
const [password, setPassword] = useState('')
const [remember, setRemember] = useState(false)
const [remember, setRemember] = useState(true)
const navigate = useNavigate()
const { run: login } = useRequest(
async () => {
const from = searchParams.get('from') ?? '/'
return Backend.auth.v1AuthLoginCreate(
{
username,
password
// remember
password,
remember
},
{
redirect_url: `${DOMAIN_HOST}${from}`
Expand Down Expand Up @@ -115,6 +115,7 @@ const LoginForm: React.FC = () => {
<Form.Check
type='checkbox'
label='Remember me'
checked
onChange={() => {
setRemember(!remember)
}}
Expand Down

0 comments on commit a6b7453

Please sign in to comment.