mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-04 12:56:14 +08:00
fix login redirect state error when no r param is supplied
This commit is contained in:
parent
426fb005c8
commit
ce64995e47
1 changed files with 3 additions and 2 deletions
|
@ -1,13 +1,14 @@
|
|||
import { useSearchParams } from 'react-router-dom'
|
||||
import { ReactComponent as Logo } from '../../assets/logo.svg'
|
||||
import { env } from '../../config/env'
|
||||
import Button from '../../ui/Button'
|
||||
import './Auth.css'
|
||||
|
||||
export default function Login() {
|
||||
const [searchParams] = useSearchParams()
|
||||
|
||||
const handleRedirect = () => {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
window.location.href = `${env.api.baseURL}/auth/login?r=${urlParams.get('r')}`
|
||||
window.location.href = `${env.api.baseURL}/auth/login?r=${searchParams.get('r') ?? '/'}`
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue