Commit 0d88c8a8 authored by GuanHua's avatar GuanHua

feat:把用户协议页面添加到白名单

parent 5622debe
...@@ -21,7 +21,8 @@ setup() ...@@ -21,7 +21,8 @@ setup()
const userLoginLists = [ const userLoginLists = [
'/user/login', '/user/login',
'/user/register', '/user/register',
'/user/forget' '/user/forget',
'/user/agreement'
] ]
// 商城相关路由 // 商城相关路由
......
...@@ -86,7 +86,7 @@ let timeChange: any; // 定时器 ...@@ -86,7 +86,7 @@ let timeChange: any; // 定时器
const actions = createFormActions() const actions = createFormActions()
const UserRegistry = () => { const UserRegistry = () => {
const [current, setCurrent] = useState(0) const [current, setCurrent] = useState(1)
const [subStep, setSubStep] = useState(false) const [subStep, setSubStep] = useState(false)
const [submitLoading, setSubmitLoading] = useState(false) const [submitLoading, setSubmitLoading] = useState(false)
const [agreementList, setAgreementList] = useState([]) const [agreementList, setAgreementList] = useState([])
...@@ -122,10 +122,12 @@ const UserRegistry = () => { ...@@ -122,10 +122,12 @@ const UserRegistry = () => {
const [asyncSchema, setAsyncSchema] = useState(() => { const [asyncSchema, setAsyncSchema] = useState(() => {
return schemas[`schema${current}`] return schemas[`schema${current}`]
}) })
useEffect(() => { useEffect(() => {
setAsyncSchema(schemas[`schema${current}`]) setAsyncSchema(schemas[`schema${current}`])
if (current === 2) runTimerJump() if (current === 2) runTimerJump()
}, [current, actions]) }, [current, actions])
useEffect(() => { useEffect(() => {
if (time === 0) { if (time === 0) {
clearInterval(timeChange) clearInterval(timeChange)
...@@ -134,6 +136,7 @@ const UserRegistry = () => { ...@@ -134,6 +136,7 @@ const UserRegistry = () => {
console.log('执行登录跳转!') console.log('执行登录跳转!')
} }
}, [time]) }, [time])
const runTimerJump = () => { const runTimerJump = () => {
timeChange = setInterval(() => setTime(t => --t), 1000) timeChange = setInterval(() => setTime(t => --t), 1000)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment