mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +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>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<OpenTour />
|
<OpenTour />
|
||||||
{Setting.isAdminUser(this.state.account) && !Setting.isMobile() &&
|
{Setting.isAdminUser(this.state.account) && !Setting.isMobile() && (this.state.uri.indexOf("/trees") === -1) &&
|
||||||
<OrganizationSelect
|
<OrganizationSelect
|
||||||
initValue={Setting.getOrganization()}
|
initValue={Setting.getOrganization()}
|
||||||
withAll={true}
|
withAll={true}
|
||||||
|
@ -25,6 +25,7 @@ class BaseListPage extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
classes: props,
|
classes: props,
|
||||||
|
organizationName: this.props.match?.params.organizationName || Setting.getRequestOrganization(this.props.account),
|
||||||
data: [],
|
data: [],
|
||||||
pagination: {
|
pagination: {
|
||||||
current: 1,
|
current: 1,
|
||||||
@ -39,6 +40,10 @@ class BaseListPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleOrganizationChange = () => {
|
handleOrganizationChange = () => {
|
||||||
|
this.setState({
|
||||||
|
organizationName: this.props.match?.params.organizationName || Setting.getRequestOrganization(this.props.account),
|
||||||
|
});
|
||||||
|
|
||||||
const {pagination} = this.state;
|
const {pagination} = this.state;
|
||||||
this.fetch({pagination});
|
this.fetch({pagination});
|
||||||
};
|
};
|
||||||
|
@ -30,7 +30,6 @@ class UserListPage extends BaseListPage {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
...this.state,
|
...this.state,
|
||||||
organizationName: this.props.organizationName ?? this.props.match?.params.organizationName ?? this.props.account.owner,
|
|
||||||
organization: null,
|
organization: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -62,7 +61,7 @@ class UserListPage extends BaseListPage {
|
|||||||
|
|
||||||
newUser() {
|
newUser() {
|
||||||
const randomName = Setting.getRandomName();
|
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 {
|
return {
|
||||||
owner: owner,
|
owner: owner,
|
||||||
name: `user_${randomName}`,
|
name: `user_${randomName}`,
|
||||||
@ -85,7 +84,7 @@ class UserListPage extends BaseListPage {
|
|||||||
score: this.state.organization.initScore,
|
score: this.state.organization.initScore,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
properties: {},
|
properties: {},
|
||||||
signupApplication: "app-built-in",
|
signupApplication: this.state.organization.defaultApplication,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user