Compare commits

...

3 Commits

3 changed files with 13 additions and 2 deletions

View File

@ -639,7 +639,7 @@ func UpdateUser(id string, user *User, columns []string, isAdmin bool) (bool, er
if len(columns) == 0 {
columns = []string{
"owner", "display_name", "avatar", "first_name", "last_name",
"location", "address", "country_code", "region", "language", "affiliation", "title", "homepage", "bio", "tag", "language", "gender", "birthday", "education", "score", "karma", "ranking", "signup_application",
"location", "address", "country_code", "region", "language", "affiliation", "title", "id_card_type", "id_card", "homepage", "bio", "tag", "language", "gender", "birthday", "education", "score", "karma", "ranking", "signup_application",
"is_admin", "is_forbidden", "is_deleted", "hash", "is_default_avatar", "properties", "webauthnCredentials", "managedAccounts",
"signin_wrong_times", "last_signin_wrong_time", "groups", "access_key", "access_secret",
"github", "google", "qq", "wechat", "facebook", "dingtalk", "weibo", "gitee", "linkedin", "wecom", "lark", "gitlab", "adfs",

View File

@ -122,6 +122,17 @@ class UserEditPage extends React.Component {
this.setState({
applications: res.data || [],
});
const applications = res.data;
if (this.state.user) {
if (this.state.user.signupApplication === "" || applications.filter(application => application.name === this.state.user.signupApplication).length === 0) {
if (applications.length > 0) {
this.updateUserField("signupApplication", applications[0].name);
} else {
this.updateUserField("signupApplication", "");
}
}
}
});
}

View File

@ -70,7 +70,7 @@ class UserListPage extends BaseListPage {
password: "123",
passwordSalt: "",
displayName: `New User - ${randomName}`,
avatar: `${Setting.StaticBaseUrl}/img/casbin.svg`,
avatar: this.state.organization.defaultAvatar ?? `${Setting.StaticBaseUrl}/img/casbin.svg`,
email: `${randomName}@example.com`,
phone: Setting.getRandomNumber(),
countryCode: this.state.organization.countryCodes?.length > 0 ? this.state.organization.countryCodes[0] : "",