회원가입 시, 로딩 바 추가
This commit is contained in:
parent
82ab12632b
commit
08b2c36e4a
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useRef } from 'react'
|
||||
import { useRef, useState } from 'react'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
@ -8,7 +8,11 @@ import Cookies from 'js-cookie'
|
||||
|
||||
import { isObjectNotEmpty, inputTelNumberCheck, inputNumberCheck } from '@/util/common-utils'
|
||||
|
||||
import GlobalSpinner from '@/components/common/spinner/GlobalSpinner'
|
||||
|
||||
export default function Join() {
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
const { getMessage } = useMessage()
|
||||
const { promisePost } = useAxios()
|
||||
const router = useRouter()
|
||||
@ -152,6 +156,8 @@ export default function Join() {
|
||||
},
|
||||
}
|
||||
|
||||
setIsLoading(true)
|
||||
|
||||
await promisePost({ url: '/api/login/v1.0/user/join', data: param })
|
||||
.then((res) => {
|
||||
if (res) {
|
||||
@ -162,8 +168,10 @@ export default function Join() {
|
||||
alert(res.data.result.resultMsg)
|
||||
}
|
||||
}
|
||||
setIsLoading(false)
|
||||
})
|
||||
.catch((error) => {
|
||||
setIsLoading(false)
|
||||
alert(error.response.data.message)
|
||||
})
|
||||
}
|
||||
@ -171,6 +179,8 @@ export default function Join() {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{isLoading && <GlobalSpinner />}
|
||||
<div className="center-page-wrap">
|
||||
<div className="center-page-inner">
|
||||
<form onSubmit={joinProcess}>
|
||||
@ -443,5 +453,6 @@ export default function Join() {
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user