Commit 77752f72 authored by GuanHua's avatar GuanHua

fix: 注册页面开启saas多租户是只有一个会员类型时自动跳转下一步实现

parent dea09c15
...@@ -116,14 +116,33 @@ const UserRegistry = () => { ...@@ -116,14 +116,33 @@ const UserRegistry = () => {
label: item.memberTypeName label: item.memberTypeName
} }
}); });
}); });
if (res.data.length === 1) {
const dataItem = res.data[0]
actions.setFieldValue('typeId', dataItem.memberTypeId)
if (dataItem.businessTypes && dataItem.businessTypes.length > 0) {
actions.setFieldState('businessTypeId', state => {
state.props.enum = dataItem.businessTypes.map(v => ({
label: v.businessTypeName,
value: v.businessTypeId
}))
})
if (dataItem.businessTypes.length === 1) {
const businessTypeItem = dataItem.businessTypes[0]
actions.setFieldValue('businessTypeId', businessTypeItem.businessTypeId)
nextStepAction()
}
}
}
useType.current = res.data as unknown as UseTypeItem[] useType.current = res.data as unknown as UseTypeItem[]
// setUseType(res.data as unknown as UseTypeItem[]) // setUseType(res.data as unknown as UseTypeItem[])
} }
} }
useEffect(() => { useEffect(() => {
if (redirect) { if (redirect && current === 1) {
const redirectUrl = decodeURIComponent(Base64.decode(redirect)) const redirectUrl = decodeURIComponent(Base64.decode(redirect))
// 判断来源是自营商城时从链接获取自营商城的memberId // 判断来源是自营商城时从链接获取自营商城的memberId
if (source && source === 'own') { if (source && source === 'own') {
...@@ -132,7 +151,9 @@ const UserRegistry = () => { ...@@ -132,7 +151,9 @@ const UserRegistry = () => {
return return
} }
} }
}, [current])
useEffect(() => {
useType.current = GlobalConfig.userRegister.useType useType.current = GlobalConfig.userRegister.useType
// setUseType(GlobalConfig.userRegister.useType) // setUseType(GlobalConfig.userRegister.useType)
fetchAgreement() fetchAgreement()
......
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