mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
feat: support more field in signup page
This commit is contained in:
@ -200,6 +200,7 @@ func (c *ApiController) Signup() {
|
|||||||
Type: userType,
|
Type: userType,
|
||||||
Password: authForm.Password,
|
Password: authForm.Password,
|
||||||
DisplayName: authForm.Name,
|
DisplayName: authForm.Name,
|
||||||
|
Gender: authForm.Gender,
|
||||||
Avatar: organization.DefaultAvatar,
|
Avatar: organization.DefaultAvatar,
|
||||||
Email: authForm.Email,
|
Email: authForm.Email,
|
||||||
Phone: authForm.Phone,
|
Phone: authForm.Phone,
|
||||||
|
@ -26,6 +26,7 @@ type AuthForm struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
FirstName string `json:"firstName"`
|
FirstName string `json:"firstName"`
|
||||||
LastName string `json:"lastName"`
|
LastName string `json:"lastName"`
|
||||||
|
Gender string `json:"gender"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"`
|
||||||
Affiliation string `json:"affiliation"`
|
Affiliation string `json:"affiliation"`
|
||||||
|
@ -634,43 +634,9 @@ class SignupPage extends React.Component {
|
|||||||
} else if (signupItem.name === "Agreement") {
|
} else if (signupItem.name === "Agreement") {
|
||||||
return AgreementModal.renderAgreementFormItem(application, required, tailFormItemLayout, this);
|
return AgreementModal.renderAgreementFormItem(application, required, tailFormItemLayout, this);
|
||||||
} else if (signupItem.name.startsWith("Text ")) {
|
} else if (signupItem.name.startsWith("Text ")) {
|
||||||
if (signupItem.type) {
|
return (
|
||||||
if (!signupItem.type || signupItem.type === "Input") {
|
<div dangerouslySetInnerHTML={{__html: signupItem.label}} />
|
||||||
return (
|
);
|
||||||
<Form.Item
|
|
||||||
name={signupItem.name.toLowerCase().replace(" ", "_")}
|
|
||||||
label={signupItem.label ? signupItem.label : signupItem.name}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: signupItem.required,
|
|
||||||
message: i18next.t(`signup:Please input your ${signupItem.label}!`),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Input placeholder={signupItem.placeholder} />
|
|
||||||
</Form.Item>
|
|
||||||
);
|
|
||||||
} else if (signupItem.type === "Single Choice" || signupItem.type === "Multiple Choices") {
|
|
||||||
return (
|
|
||||||
<Form.Item
|
|
||||||
name={signupItem.name.toLowerCase().replace(" ", "_")}
|
|
||||||
label={signupItem.label ? signupItem.label : signupItem.name}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: signupItem.required,
|
|
||||||
message: i18next.t(`Please select your ${signupItem.label}!`),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Select
|
|
||||||
mode={signupItem.type === "Multiple Choices" ? "multiple" : "single"}
|
|
||||||
placeholder={signupItem.placeholder}
|
|
||||||
options={signupItem.options.map(option => ({label: option, value: option}))}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (signupItem.name === "Signup button") {
|
} else if (signupItem.name === "Signup button") {
|
||||||
return (
|
return (
|
||||||
<Form.Item {...tailFormItemLayout}>
|
<Form.Item {...tailFormItemLayout}>
|
||||||
|
Reference in New Issue
Block a user