mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Move result page into entry page
This commit is contained in:
parent
bf6d5e529b
commit
69ee6a6f7e
@ -62,7 +62,6 @@ import * as Conf from "./Conf";
|
|||||||
|
|
||||||
import * as Auth from "./auth/Auth";
|
import * as Auth from "./auth/Auth";
|
||||||
import EntryPage from "./EntryPage";
|
import EntryPage from "./EntryPage";
|
||||||
import ResultPage from "./auth/ResultPage";
|
|
||||||
import * as AuthBackend from "./auth/AuthBackend";
|
import * as AuthBackend from "./auth/AuthBackend";
|
||||||
import AuthCallback from "./auth/AuthCallback";
|
import AuthCallback from "./auth/AuthCallback";
|
||||||
import LanguageSelect from "./common/select/LanguageSelect";
|
import LanguageSelect from "./common/select/LanguageSelect";
|
||||||
@ -517,8 +516,6 @@ class App extends Component {
|
|||||||
renderRouter() {
|
renderRouter() {
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)} />
|
|
||||||
<Route exact path="/result/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)} />
|
|
||||||
<Route exact path="/" render={(props) => this.renderLoginIfNotLoggedIn(<HomePage account={this.state.account} {...props} />)} />
|
<Route exact path="/" render={(props) => this.renderLoginIfNotLoggedIn(<HomePage account={this.state.account} {...props} />)} />
|
||||||
<Route exact path="/account" render={(props) => this.renderLoginIfNotLoggedIn(<AccountPage account={this.state.account} {...props} />)} />
|
<Route exact path="/account" render={(props) => this.renderLoginIfNotLoggedIn(<AccountPage account={this.state.account} {...props} />)} />
|
||||||
<Route exact path="/organizations" render={(props) => this.renderLoginIfNotLoggedIn(<OrganizationListPage account={this.state.account} {...props} />)} />
|
<Route exact path="/organizations" render={(props) => this.renderLoginIfNotLoggedIn(<OrganizationListPage account={this.state.account} {...props} />)} />
|
||||||
@ -665,6 +662,7 @@ class App extends Component {
|
|||||||
window.location.pathname.startsWith("/login") ||
|
window.location.pathname.startsWith("/login") ||
|
||||||
window.location.pathname.startsWith("/forget") ||
|
window.location.pathname.startsWith("/forget") ||
|
||||||
window.location.pathname.startsWith("/prompt") ||
|
window.location.pathname.startsWith("/prompt") ||
|
||||||
|
window.location.pathname.startsWith("/result") ||
|
||||||
window.location.pathname.startsWith("/cas") ||
|
window.location.pathname.startsWith("/cas") ||
|
||||||
window.location.pathname.startsWith("/auto-signup");
|
window.location.pathname.startsWith("/auto-signup");
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import LoginPage from "./auth/LoginPage";
|
|||||||
import SelfForgetPage from "./auth/SelfForgetPage";
|
import SelfForgetPage from "./auth/SelfForgetPage";
|
||||||
import ForgetPage from "./auth/ForgetPage";
|
import ForgetPage from "./auth/ForgetPage";
|
||||||
import PromptPage from "./auth/PromptPage";
|
import PromptPage from "./auth/PromptPage";
|
||||||
|
import ResultPage from "./auth/ResultPage";
|
||||||
import CasLogout from "./auth/CasLogout";
|
import CasLogout from "./auth/CasLogout";
|
||||||
import {authConfig} from "./auth/Auth";
|
import {authConfig} from "./auth/Auth";
|
||||||
|
|
||||||
@ -54,10 +55,6 @@ class EntryPage extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplicationObj() {
|
|
||||||
return this.state.application || null;
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const onUpdateApplication = (application) => {
|
const onUpdateApplication = (application) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
@ -84,6 +81,8 @@ class EntryPage extends React.Component {
|
|||||||
<Route exact path="/forget/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ForgetPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/forget/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ForgetPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/prompt" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/prompt" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/prompt/:applicationName" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/prompt/:applicationName" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
|
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
|
<Route exact path="/result/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/cas/:owner/:casApplicationName/logout" render={(props) => this.renderHomeIfLoggedIn(<CasLogout {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
<Route exact path="/cas/:owner/:casApplicationName/logout" render={(props) => this.renderHomeIfLoggedIn(<CasLogout {...this.props} application={this.state.application} onUpdateApplication={onUpdateApplication} {...props} />)} />
|
||||||
<Route exact path="/cas/:owner/:casApplicationName/login" render={(props) => {return (<LoginPage {...this.props} application={this.state.application} type={"cas"} mode={"signin"} onUpdateApplication={onUpdateApplication} {...props} />);}} />
|
<Route exact path="/cas/:owner/:casApplicationName/login" render={(props) => {return (<LoginPage {...this.props} application={this.state.application} type={"cas"} mode={"signin"} onUpdateApplication={onUpdateApplication} {...props} />);}} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Result, Spin} from "antd";
|
import {Button, Card, Result, Spin} from "antd";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import {authConfig} from "./Auth";
|
import {authConfig} from "./Auth";
|
||||||
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
||||||
@ -44,12 +44,17 @@ class ResultPage extends React.Component {
|
|||||||
|
|
||||||
ApplicationBackend.getApplication("admin", this.state.applicationName)
|
ApplicationBackend.getApplication("admin", this.state.applicationName)
|
||||||
.then((application) => {
|
.then((application) => {
|
||||||
|
this.onUpdateApplication(application);
|
||||||
this.setState({
|
this.setState({
|
||||||
application: application,
|
application: application,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onUpdateApplication(application) {
|
||||||
|
this.props.onUpdateApplication(application);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const application = this.state.application;
|
const application = this.state.application;
|
||||||
|
|
||||||
@ -62,27 +67,37 @@ class ResultPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style={{display: "flex", flex: "1", justifyContent: "center"}}>
|
||||||
{
|
<Card>
|
||||||
Setting.renderHelmet(application)
|
<div style={{marginTop: "30px", marginBottom: "30px", textAlign: "center"}}>
|
||||||
}
|
{
|
||||||
<Result
|
Setting.renderHelmet(application)
|
||||||
status="success"
|
}
|
||||||
title={i18next.t("signup:Your account has been created!")}
|
{
|
||||||
subTitle={i18next.t("signup:Please click the below button to sign in")}
|
Setting.renderLogo(application)
|
||||||
extra={[
|
}
|
||||||
<Button type="primary" key="login" onClick={() => {
|
{
|
||||||
const linkInStorage = sessionStorage.getItem("signinUrl");
|
Setting.renderHelmet(application)
|
||||||
if (linkInStorage !== null && linkInStorage !== "") {
|
}
|
||||||
Setting.goToLink(linkInStorage);
|
<Result
|
||||||
} else {
|
status="success"
|
||||||
Setting.redirectToLoginPage(application, this.props.history);
|
title={i18next.t("signup:Your account has been created!")}
|
||||||
}
|
subTitle={i18next.t("signup:Please click the below button to sign in")}
|
||||||
}}>
|
extra={[
|
||||||
{i18next.t("login:Sign In")}
|
<Button type="primary" key="login" onClick={() => {
|
||||||
</Button>,
|
const linkInStorage = sessionStorage.getItem("signinUrl");
|
||||||
]}
|
if (linkInStorage !== null && linkInStorage !== "") {
|
||||||
/>
|
Setting.goToLink(linkInStorage);
|
||||||
|
} else {
|
||||||
|
Setting.redirectToLoginPage(application, this.props.history);
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
{i18next.t("login:Sign In")}
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user