mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: add users with correct application (#2570)
This commit is contained in:
parent
e3f28e8b4c
commit
369de36987
@ -392,7 +392,7 @@ class App extends Component {
|
||||
</div>
|
||||
</Tooltip>
|
||||
<OpenTour />
|
||||
{Setting.isAdminUser(this.state.account) && !Setting.isMobile() &&
|
||||
{Setting.isAdminUser(this.state.account) && !Setting.isMobile() && (this.state.uri.indexOf("/trees") === -1) &&
|
||||
<OrganizationSelect
|
||||
initValue={Setting.getOrganization()}
|
||||
withAll={true}
|
||||
|
@ -25,6 +25,7 @@ class BaseListPage extends React.Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
organizationName: this.props.match?.params.organizationName || Setting.getRequestOrganization(this.props.account),
|
||||
data: [],
|
||||
pagination: {
|
||||
current: 1,
|
||||
@ -39,6 +40,10 @@ class BaseListPage extends React.Component {
|
||||
}
|
||||
|
||||
handleOrganizationChange = () => {
|
||||
this.setState({
|
||||
organizationName: this.props.match?.params.organizationName || Setting.getRequestOrganization(this.props.account),
|
||||
});
|
||||
|
||||
const {pagination} = this.state;
|
||||
this.fetch({pagination});
|
||||
};
|
||||
|
@ -30,7 +30,6 @@ class UserListPage extends BaseListPage {
|
||||
super(props);
|
||||
this.state = {
|
||||
...this.state,
|
||||
organizationName: this.props.organizationName ?? this.props.match?.params.organizationName ?? this.props.account.owner,
|
||||
organization: null,
|
||||
};
|
||||
}
|
||||
@ -62,7 +61,7 @@ class UserListPage extends BaseListPage {
|
||||
|
||||
newUser() {
|
||||
const randomName = Setting.getRandomName();
|
||||
const owner = Setting.isDefaultOrganizationSelected(this.props.account) ? this.state.organizationName : Setting.getRequestOrganization(this.props.account);
|
||||
const owner = (Setting.isDefaultOrganizationSelected(this.props.account) || this.props.groupName) ? this.state.organizationName : Setting.getRequestOrganization(this.props.account);
|
||||
return {
|
||||
owner: owner,
|
||||
name: `user_${randomName}`,
|
||||
@ -85,7 +84,7 @@ class UserListPage extends BaseListPage {
|
||||
score: this.state.organization.initScore,
|
||||
isDeleted: false,
|
||||
properties: {},
|
||||
signupApplication: "app-built-in",
|
||||
signupApplication: this.state.organization.defaultApplication,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user