Fix can not autoload in production mode bug
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
PERMISSION_USER_NOT_FOUND,
|
||||
SYSTEM_INVALID_CAPTCHA_CODE
|
||||
} from '@/constants/common.constants'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { r_auth_forget, r_auth_retrieve } from '@/services/auth'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -45,7 +44,7 @@ const Forget = () => {
|
||||
const [captchaCode, setCaptchaCode] = useState('')
|
||||
const [retrieveCaptchaCode, setRetrieveCaptchaCode] = useState('')
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (!isSending) {
|
||||
setCaptchaCode('')
|
||||
turnstileRef.current?.reset()
|
||||
@@ -53,7 +52,7 @@ const Forget = () => {
|
||||
}
|
||||
}, [isSending])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (!isChanging) {
|
||||
setRetrieveCaptchaCode('')
|
||||
retrieveTurnstileRef.current?.reset()
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
PERMISSION_USERNAME_NOT_FOUND,
|
||||
SYSTEM_INVALID_CAPTCHA_CODE
|
||||
} from '@/constants/common.constants'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { getUserInfo, setToken } from '@/util/auth'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { r_auth_login } from '@/services/auth'
|
||||
@@ -33,7 +32,7 @@ const SignIn = () => {
|
||||
const [isSigningIn, setIsSigningIn] = useState(false)
|
||||
const [captchaCode, setCaptchaCode] = useState('')
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (!isSigningIn) {
|
||||
setCaptchaCode('')
|
||||
turnstileRef.current?.reset()
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
SYSTEM_INVALID_CAPTCHA_CODE,
|
||||
SYSTEM_MATCH_SENSITIVE_WORD
|
||||
} from '@/constants/common.constants'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { getLoginStatus, setToken } from '@/util/auth'
|
||||
import { r_auth_register, r_auth_resend } from '@/services/auth'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
@@ -32,7 +31,7 @@ const SignUp = () => {
|
||||
const [isSending, setIsSending] = useState(false)
|
||||
const [captchaCode, setCaptchaCode] = useState('')
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (!isSigningUp) {
|
||||
setCaptchaCode('')
|
||||
turnstileRef.current?.reset()
|
||||
@@ -40,7 +39,7 @@ const SignUp = () => {
|
||||
}
|
||||
}, [isSigningUp])
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (location.pathname !== '/register') {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
PERMISSION_VERIFY_SUCCESS,
|
||||
SYSTEM_MATCH_SENSITIVE_WORD
|
||||
} from '@/constants/common.constants'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { getLoginStatus, getUserInfo, requestUserInfo } from '@/util/auth'
|
||||
import { getRedirectUrl } from '@/util/route'
|
||||
import { r_auth_resend, r_auth_verify } from '@/services/auth'
|
||||
@@ -26,7 +25,7 @@ const Verify = () => {
|
||||
const [avatar, setAvatar] = useState('')
|
||||
const [isVerifying, setIsVerifying] = useState(false)
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
if (location.pathname !== '/verify') {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import '@/assets/css/pages/sign.scss'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
import FitCenter from '@/components/common/FitCenter'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -16,7 +15,7 @@ const Sign = () => {
|
||||
|
||||
const leftPage = ['register', 'verify', 'forget']
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
useEffect(() => {
|
||||
lastPage.current = currentPage.current
|
||||
currentPage.current = match.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user