mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
Show resource list page to users.
This commit is contained in:
@ -321,13 +321,17 @@ class App extends Component {
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
);
|
||||
res.push(
|
||||
<Menu.Item key="/resources">
|
||||
<Link to="/resources">
|
||||
{i18next.t("general:Resources")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
);
|
||||
}
|
||||
|
||||
res.push(
|
||||
<Menu.Item key="/resources">
|
||||
<Link to="/resources">
|
||||
{i18next.t("general:Resources")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
);
|
||||
|
||||
if (Setting.isAdminUser(this.state.account)) {
|
||||
res.push(
|
||||
<Menu.Item key="/tokens">
|
||||
<Link to="/tokens">
|
||||
@ -336,13 +340,14 @@ class App extends Component {
|
||||
</Menu.Item>
|
||||
);
|
||||
res.push(
|
||||
<Menu.Item key="/records">
|
||||
<Link to="/records">
|
||||
{i18next.t("general:Records")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="/records">
|
||||
<Link to="/records">
|
||||
{i18next.t("general:Records")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
);
|
||||
}
|
||||
|
||||
res.push(
|
||||
<Menu.Item key="/swagger">
|
||||
<a target="_blank" rel="noreferrer" href={"/swagger"}>
|
||||
@ -350,6 +355,7 @@ class App extends Component {
|
||||
</a>
|
||||
</Menu.Item>
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ class ResourceListPage extends React.Component {
|
||||
}
|
||||
|
||||
getResources() {
|
||||
ResourceBackend.getResources("admin")
|
||||
ResourceBackend.getResources(this.props.account.owner, this.props.account.name)
|
||||
.then((res) => {
|
||||
this.setState({
|
||||
resources: res,
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
import * as Setting from "../Setting";
|
||||
|
||||
export function getResources(owner) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-resources?owner=${owner}`, {
|
||||
export function getResources(owner, user) {
|
||||
return fetch(`${Setting.ServerUrl}/api/get-resources?owner=${owner}&user=${user}`, {
|
||||
method: "GET",
|
||||
credentials: "include"
|
||||
}).then(res => res.json());
|
||||
|
Reference in New Issue
Block a user