mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-10 10:15:19 +08:00
Compare commits
4 Commits
revert-361
...
v1.854.0
Author | SHA1 | Date | |
---|---|---|---|
85ca318e2f | |||
9032865e60 | |||
5692522ee0 | |||
cb1882e589 |
@ -249,6 +249,10 @@ func (c *ApiController) Signup() {
|
|||||||
user.Groups = []string{invitation.SignupGroup}
|
user.Groups = []string{invitation.SignupGroup}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if application.DefaultGroup != "" && user.Groups == nil {
|
||||||
|
user.Groups = []string{application.DefaultGroup}
|
||||||
|
}
|
||||||
|
|
||||||
affected, err := object.AddUser(user)
|
affected, err := object.AddUser(user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.ResponseError(err.Error())
|
c.ResponseError(err.Error())
|
||||||
|
@ -986,6 +986,18 @@ func (c *ApiController) Login() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if authForm.Language != "" {
|
||||||
|
user := c.getCurrentUser()
|
||||||
|
if user != nil {
|
||||||
|
user.Language = authForm.Language
|
||||||
|
_, err = object.UpdateUser(user.GetId(), user, []string{"language"}, user.IsAdmin)
|
||||||
|
if err != nil {
|
||||||
|
c.ResponseError(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
c.Data["json"] = resp
|
c.Data["json"] = resp
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ func (c *ApiController) SendVerificationCode() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
sendResp = object.SendVerificationCodeToEmail(organization, user, provider, clientIp, vform.Dest, c.GetAcceptLanguage())
|
sendResp = object.SendVerificationCodeToEmail(organization, user, provider, clientIp, vform.Dest)
|
||||||
case object.VerifyTypePhone:
|
case object.VerifyTypePhone:
|
||||||
if vform.Method == LoginVerification || vform.Method == ForgetVerification {
|
if vform.Method == LoginVerification || vform.Method == ForgetVerification {
|
||||||
if user != nil && util.GetMaskedPhone(user.Phone) == vform.Dest {
|
if user != nil && util.GetMaskedPhone(user.Phone) == vform.Dest {
|
||||||
@ -304,7 +304,7 @@ func (c *ApiController) SendVerificationCode() {
|
|||||||
c.ResponseError(fmt.Sprintf(c.T("verification:Phone number is invalid in your region %s"), vform.CountryCode))
|
c.ResponseError(fmt.Sprintf(c.T("verification:Phone number is invalid in your region %s"), vform.CountryCode))
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
sendResp = object.SendVerificationCodeToPhone(organization, user, provider, clientIp, phone, c.GetAcceptLanguage())
|
sendResp = object.SendVerificationCodeToPhone(organization, user, provider, clientIp, phone)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ type AuthForm struct {
|
|||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"`
|
||||||
Affiliation string `json:"affiliation"`
|
Affiliation string `json:"affiliation"`
|
||||||
IdCard string `json:"idCard"`
|
IdCard string `json:"idCard"`
|
||||||
|
Language string `json:"language"`
|
||||||
Region string `json:"region"`
|
Region string `json:"region"`
|
||||||
InvitationCode string `json:"invitationCode"`
|
InvitationCode string `json:"invitationCode"`
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ type Application struct {
|
|||||||
Description string `xorm:"varchar(100)" json:"description"`
|
Description string `xorm:"varchar(100)" json:"description"`
|
||||||
Organization string `xorm:"varchar(100)" json:"organization"`
|
Organization string `xorm:"varchar(100)" json:"organization"`
|
||||||
Cert string `xorm:"varchar(100)" json:"cert"`
|
Cert string `xorm:"varchar(100)" json:"cert"`
|
||||||
|
DefaultGroup string `xorm:"varchar(100)" json:"defaultGroup"`
|
||||||
HeaderHtml string `xorm:"mediumtext" json:"headerHtml"`
|
HeaderHtml string `xorm:"mediumtext" json:"headerHtml"`
|
||||||
EnablePassword bool `json:"enablePassword"`
|
EnablePassword bool `json:"enablePassword"`
|
||||||
EnableSignUp bool `json:"enableSignUp"`
|
EnableSignUp bool `json:"enableSignUp"`
|
||||||
@ -97,29 +98,30 @@ type Application struct {
|
|||||||
IsShared bool `json:"isShared"`
|
IsShared bool `json:"isShared"`
|
||||||
IpRestriction string `json:"ipRestriction"`
|
IpRestriction string `json:"ipRestriction"`
|
||||||
|
|
||||||
ClientId string `xorm:"varchar(100)" json:"clientId"`
|
ClientId string `xorm:"varchar(100)" json:"clientId"`
|
||||||
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
|
ClientSecret string `xorm:"varchar(100)" json:"clientSecret"`
|
||||||
RedirectUris []string `xorm:"varchar(1000)" json:"redirectUris"`
|
RedirectUris []string `xorm:"varchar(1000)" json:"redirectUris"`
|
||||||
TokenFormat string `xorm:"varchar(100)" json:"tokenFormat"`
|
TokenFormat string `xorm:"varchar(100)" json:"tokenFormat"`
|
||||||
TokenSigningMethod string `xorm:"varchar(100)" json:"tokenSigningMethod"`
|
TokenSigningMethod string `xorm:"varchar(100)" json:"tokenSigningMethod"`
|
||||||
TokenFields []string `xorm:"varchar(1000)" json:"tokenFields"`
|
TokenFields []string `xorm:"varchar(1000)" json:"tokenFields"`
|
||||||
ExpireInHours int `json:"expireInHours"`
|
ExpireInHours int `json:"expireInHours"`
|
||||||
RefreshExpireInHours int `json:"refreshExpireInHours"`
|
RefreshExpireInHours int `json:"refreshExpireInHours"`
|
||||||
SignupUrl string `xorm:"varchar(200)" json:"signupUrl"`
|
SignupUrl string `xorm:"varchar(200)" json:"signupUrl"`
|
||||||
SigninUrl string `xorm:"varchar(200)" json:"signinUrl"`
|
SigninUrl string `xorm:"varchar(200)" json:"signinUrl"`
|
||||||
ForgetUrl string `xorm:"varchar(200)" json:"forgetUrl"`
|
ForgetUrl string `xorm:"varchar(200)" json:"forgetUrl"`
|
||||||
AffiliationUrl string `xorm:"varchar(100)" json:"affiliationUrl"`
|
AffiliationUrl string `xorm:"varchar(100)" json:"affiliationUrl"`
|
||||||
IpWhitelist string `xorm:"varchar(200)" json:"ipWhitelist"`
|
IpWhitelist string `xorm:"varchar(200)" json:"ipWhitelist"`
|
||||||
TermsOfUse string `xorm:"varchar(100)" json:"termsOfUse"`
|
TermsOfUse string `xorm:"varchar(100)" json:"termsOfUse"`
|
||||||
SignupHtml string `xorm:"mediumtext" json:"signupHtml"`
|
SignupHtml string `xorm:"mediumtext" json:"signupHtml"`
|
||||||
SigninHtml string `xorm:"mediumtext" json:"signinHtml"`
|
SigninHtml string `xorm:"mediumtext" json:"signinHtml"`
|
||||||
ThemeData *ThemeData `xorm:"json" json:"themeData"`
|
ThemeData *ThemeData `xorm:"json" json:"themeData"`
|
||||||
FooterHtml string `xorm:"mediumtext" json:"footerHtml"`
|
FooterHtml string `xorm:"mediumtext" json:"footerHtml"`
|
||||||
FormCss string `xorm:"text" json:"formCss"`
|
FormCss string `xorm:"text" json:"formCss"`
|
||||||
FormCssMobile string `xorm:"text" json:"formCssMobile"`
|
FormCssMobile string `xorm:"text" json:"formCssMobile"`
|
||||||
FormOffset int `json:"formOffset"`
|
FormOffset int `json:"formOffset"`
|
||||||
FormSideHtml string `xorm:"mediumtext" json:"formSideHtml"`
|
FormSideHtml string `xorm:"mediumtext" json:"formSideHtml"`
|
||||||
FormBackgroundUrl string `xorm:"varchar(200)" json:"formBackgroundUrl"`
|
FormBackgroundUrl string `xorm:"varchar(200)" json:"formBackgroundUrl"`
|
||||||
|
FormBackgroundUrlMobile string `xorm:"varchar(200)" json:"formBackgroundUrlMobile"`
|
||||||
|
|
||||||
FailedSigninLimit int `json:"failedSigninLimit"`
|
FailedSigninLimit int `json:"failedSigninLimit"`
|
||||||
FailedSigninFrozenTime int `json:"failedSigninFrozenTime"`
|
FailedSigninFrozenTime int `json:"failedSigninFrozenTime"`
|
||||||
|
@ -60,7 +60,7 @@ type VerificationRecord struct {
|
|||||||
IsUsed bool `xorm:"notnull" json:"isUsed"`
|
IsUsed bool `xorm:"notnull" json:"isUsed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsAllowSend(user *User, remoteAddr, recordType, lang string) error {
|
func IsAllowSend(user *User, remoteAddr, recordType string) error {
|
||||||
var record VerificationRecord
|
var record VerificationRecord
|
||||||
record.RemoteAddr = remoteAddr
|
record.RemoteAddr = remoteAddr
|
||||||
record.Type = recordType
|
record.Type = recordType
|
||||||
@ -78,15 +78,10 @@ func IsAllowSend(user *User, remoteAddr, recordType, lang string) error {
|
|||||||
return errors.New("you can only send one code in 60s")
|
return errors.New("you can only send one code in 60s")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = checkSigninErrorTimes(user, lang)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendVerificationCodeToEmail(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string, lang string) error {
|
func SendVerificationCodeToEmail(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string) error {
|
||||||
sender := organization.DisplayName
|
sender := organization.DisplayName
|
||||||
title := provider.Title
|
title := provider.Title
|
||||||
|
|
||||||
@ -104,7 +99,7 @@ func SendVerificationCodeToEmail(organization *Organization, user *User, provide
|
|||||||
}
|
}
|
||||||
content = strings.Replace(content, "%{user.friendlyName}", userString, 1)
|
content = strings.Replace(content, "%{user.friendlyName}", userString, 1)
|
||||||
|
|
||||||
err := IsAllowSend(user, remoteAddr, provider.Category, lang)
|
err := IsAllowSend(user, remoteAddr, provider.Category)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -122,8 +117,8 @@ func SendVerificationCodeToEmail(organization *Organization, user *User, provide
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendVerificationCodeToPhone(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string, lang string) error {
|
func SendVerificationCodeToPhone(organization *Organization, user *User, provider *Provider, remoteAddr string, dest string) error {
|
||||||
err := IsAllowSend(user, remoteAddr, provider.Category, lang)
|
err := IsAllowSend(user, remoteAddr, provider.Category)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Switch, Upload} from "antd";
|
import {Button, Card, Col, ConfigProvider, Input, InputNumber, Popover, Radio, Result, Row, Select, Space, Switch, Upload} from "antd";
|
||||||
import {CopyOutlined, LinkOutlined, UploadOutlined} from "@ant-design/icons";
|
import {CopyOutlined, HolderOutlined, LinkOutlined, UploadOutlined, UsergroupAddOutlined} from "@ant-design/icons";
|
||||||
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
import * as ApplicationBackend from "./backend/ApplicationBackend";
|
||||||
import * as CertBackend from "./backend/CertBackend";
|
import * as CertBackend from "./backend/CertBackend";
|
||||||
import * as Setting from "./Setting";
|
import * as Setting from "./Setting";
|
||||||
@ -36,6 +36,7 @@ import ThemeEditor from "./common/theme/ThemeEditor";
|
|||||||
|
|
||||||
import SigninTable from "./table/SigninTable";
|
import SigninTable from "./table/SigninTable";
|
||||||
import Editor from "./common/Editor";
|
import Editor from "./common/Editor";
|
||||||
|
import * as GroupBackend from "./backend/GroupBackend";
|
||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
||||||
@ -116,6 +117,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
UNSAFE_componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getApplication();
|
this.getApplication();
|
||||||
this.getOrganizations();
|
this.getOrganizations();
|
||||||
|
this.getGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplication() {
|
getApplication() {
|
||||||
@ -167,6 +169,17 @@ class ApplicationEditPage extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getGroups() {
|
||||||
|
GroupBackend.getGroups(this.state.organizationName)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.status === "ok") {
|
||||||
|
this.setState({
|
||||||
|
groups: res.data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getCerts(application) {
|
getCerts(application) {
|
||||||
let owner = application.organization;
|
let owner = application.organization;
|
||||||
if (application.isShared) {
|
if (application.isShared) {
|
||||||
@ -469,6 +482,31 @@ class ApplicationEditPage extends React.Component {
|
|||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("ldap:Default group"), i18next.t("ldap:Default group - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22}>
|
||||||
|
<Select virtual={false} style={{width: "100%"}} value={this.state.application.defaultGroup ?? []} onChange={(value => {
|
||||||
|
this.updateApplicationField("defaultGroup", value);
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<Option key={""} value={""}>
|
||||||
|
<Space>
|
||||||
|
{i18next.t("general:Default")}
|
||||||
|
</Space>
|
||||||
|
</Option>
|
||||||
|
{
|
||||||
|
this.state.groups?.map((group) => <Option key={group.name} value={`${group.owner}/${group.name}`}>
|
||||||
|
<Space>
|
||||||
|
{group.type === "Physical" ? <UsergroupAddOutlined /> : <HolderOutlined />}
|
||||||
|
{group.displayName}
|
||||||
|
</Space>
|
||||||
|
</Option>)
|
||||||
|
}
|
||||||
|
</Select>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Row style={{marginTop: "20px"}} >
|
<Row style={{marginTop: "20px"}} >
|
||||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
|
||||||
{Setting.getLabel(i18next.t("application:Enable signup"), i18next.t("application:Enable signup - Tooltip"))} :
|
{Setting.getLabel(i18next.t("application:Enable signup"), i18next.t("application:Enable signup - Tooltip"))} :
|
||||||
@ -804,6 +842,33 @@ class ApplicationEditPage extends React.Component {
|
|||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("application:Background URL Mobile"), i18next.t("application:Background URL Mobile - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} : {}}>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{Setting.getLabel(i18next.t("general:URL"), i18next.t("general:URL - Tooltip"))} :
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<Input prefix={<LinkOutlined />} value={this.state.application.formBackgroundUrlMobile} onChange={e => {
|
||||||
|
this.updateApplicationField("formBackgroundUrlMobile", e.target.value);
|
||||||
|
}} />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style={{marginTop: "20px"}} >
|
||||||
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
|
{i18next.t("general:Preview")}:
|
||||||
|
</Col>
|
||||||
|
<Col span={22} >
|
||||||
|
<a target="_blank" rel="noreferrer" href={this.state.application.formBackgroundUrlMobile}>
|
||||||
|
<img src={this.state.application.formBackgroundUrlMobile} alt={this.state.application.formBackgroundUrlMobile} height={90} style={{marginBottom: "20px"}} />
|
||||||
|
</a>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
|
||||||
{Setting.getLabel(i18next.t("application:Custom CSS"), i18next.t("application:Custom CSS - Tooltip"))} :
|
{Setting.getLabel(i18next.t("application:Custom CSS"), i18next.t("application:Custom CSS - Tooltip"))} :
|
||||||
|
@ -109,7 +109,7 @@ class EntryPage extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<CustomHead headerHtml={this.state.application?.headerHtml} />
|
<CustomHead headerHtml={this.state.application?.headerHtml} />
|
||||||
<div className={`${isDarkMode ? "loginBackgroundDark" : "loginBackground"}`}
|
<div className={`${isDarkMode ? "loginBackgroundDark" : "loginBackground"}`}
|
||||||
style={{backgroundImage: Setting.inIframe() || Setting.isMobile() ? null : `url(${this.state.application?.formBackgroundUrl})`}}>
|
style={{backgroundImage: Setting.inIframe() ? null : (Setting.isMobile() ? `url(${this.state.application?.formBackgroundUrlMobile})` : `url(${this.state.application?.formBackgroundUrl})`)}}>
|
||||||
<Spin size="large" spinning={this.state.application === undefined && this.state.pricing === undefined} tip={i18next.t("login:Loading")}
|
<Spin size="large" spinning={this.state.application === undefined && this.state.pricing === undefined} tip={i18next.t("login:Loading")}
|
||||||
style={{width: "100%", margin: "0 auto", position: "absolute"}} />
|
style={{width: "100%", margin: "0 auto", position: "absolute"}} />
|
||||||
<Switch>
|
<Switch>
|
||||||
|
@ -61,6 +61,7 @@ class LoginPage extends React.Component {
|
|||||||
isTermsOfUseVisible: false,
|
isTermsOfUseVisible: false,
|
||||||
termsOfUseContent: "",
|
termsOfUseContent: "",
|
||||||
orgChoiceMode: new URLSearchParams(props.location?.search).get("orgChoiceMode") ?? null,
|
orgChoiceMode: new URLSearchParams(props.location?.search).get("orgChoiceMode") ?? null,
|
||||||
|
userLang: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.state.type === "cas" && props.match?.params.casApplicationName !== undefined) {
|
if (this.state.type === "cas" && props.match?.params.casApplicationName !== undefined) {
|
||||||
@ -415,6 +416,7 @@ class LoginPage extends React.Component {
|
|||||||
|
|
||||||
login(values) {
|
login(values) {
|
||||||
// here we are supposed to determine whether Casdoor is working as an OAuth server or CAS server
|
// here we are supposed to determine whether Casdoor is working as an OAuth server or CAS server
|
||||||
|
values["language"] = this.state.userLang ?? "";
|
||||||
if (this.state.type === "cas") {
|
if (this.state.type === "cas") {
|
||||||
// CAS
|
// CAS
|
||||||
const casParams = Util.getCasParameters();
|
const casParams = Util.getCasParameters();
|
||||||
@ -566,7 +568,7 @@ class LoginPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div key={resultItemKey} className="login-languages">
|
<div key={resultItemKey} className="login-languages">
|
||||||
<div dangerouslySetInnerHTML={{__html: ("<style>" + signinItem.customCss?.replaceAll("<style>", "").replaceAll("</style>", "") + "</style>")}} />
|
<div dangerouslySetInnerHTML={{__html: ("<style>" + signinItem.customCss?.replaceAll("<style>", "").replaceAll("</style>", "") + "</style>")}} />
|
||||||
<LanguageSelect languages={application.organizationObj.languages} />
|
<LanguageSelect languages={application.organizationObj.languages} onClick={key => {this.setState({userLang: key});}} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (signinItem.name === "Signin methods") {
|
} else if (signinItem.name === "Signin methods") {
|
||||||
@ -805,7 +807,6 @@ class LoginPage extends React.Component {
|
|||||||
<Form
|
<Form
|
||||||
name="normal_login"
|
name="normal_login"
|
||||||
initialValues={{
|
initialValues={{
|
||||||
|
|
||||||
organization: application.organization,
|
organization: application.organization,
|
||||||
application: application.name,
|
application: application.name,
|
||||||
autoSignin: true,
|
autoSignin: true,
|
||||||
|
@ -30,6 +30,7 @@ class LanguageSelect extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
classes: props,
|
classes: props,
|
||||||
languages: props.languages ?? Setting.Countries.map(item => item.key),
|
languages: props.languages ?? Setting.Countries.map(item => item.key),
|
||||||
|
onClick: props.onClick,
|
||||||
};
|
};
|
||||||
|
|
||||||
Setting.Countries.forEach((country) => {
|
Setting.Countries.forEach((country) => {
|
||||||
@ -50,6 +51,9 @@ class LanguageSelect extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
const languageItems = this.getOrganizationLanguages(this.state.languages);
|
const languageItems = this.getOrganizationLanguages(this.state.languages);
|
||||||
const onClick = (e) => {
|
const onClick = (e) => {
|
||||||
|
if (typeof this.state.onClick === "function") {
|
||||||
|
this.state.onClick(e.key);
|
||||||
|
}
|
||||||
Setting.setLanguage(e.key);
|
Setting.setLanguage(e.key);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user