mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Replace "register" with "sign up".
This commit is contained in:
@ -33,7 +33,7 @@ import HomePage from "./basic/HomePage";
|
||||
import CustomGithubCorner from "./CustomGithubCorner";
|
||||
|
||||
import * as Auth from "./auth/Auth";
|
||||
import RegisterPage from "./auth/RegisterPage";
|
||||
import SignupPage from "./auth/SignupPage";
|
||||
import ResultPage from "./auth/ResultPage";
|
||||
import LoginPage from "./auth/LoginPage";
|
||||
import SelfLoginPage from "./auth/SelfLoginPage";
|
||||
@ -94,7 +94,7 @@ class App extends Component {
|
||||
this.setState({ selectedMenuKey: 4 });
|
||||
} else if (uri.includes('tokens')) {
|
||||
this.setState({ selectedMenuKey: 5 });
|
||||
} else if (uri.includes('register')) {
|
||||
} else if (uri.includes('signup')) {
|
||||
this.setState({ selectedMenuKey: 100 });
|
||||
} else if (uri.includes('login')) {
|
||||
this.setState({ selectedMenuKey: 101 });
|
||||
@ -214,8 +214,8 @@ class App extends Component {
|
||||
} else if (this.state.account === null) {
|
||||
res.push(
|
||||
<Menu.Item key="100" style={{float: 'right', marginRight: '20px'}}>
|
||||
<Link to="/register">
|
||||
{i18next.t("account:Register")}
|
||||
<Link to="/signup">
|
||||
{i18next.t("account:Sign Up")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
);
|
||||
@ -314,7 +314,7 @@ class App extends Component {
|
||||
|
||||
isStartPages() {
|
||||
return window.location.pathname.startsWith('/login') ||
|
||||
window.location.pathname.startsWith('/register') ||
|
||||
window.location.pathname.startsWith('/signup') ||
|
||||
window.location.pathname === '/';
|
||||
}
|
||||
|
||||
@ -344,7 +344,7 @@ class App extends Component {
|
||||
</Menu>
|
||||
</Header>
|
||||
<Switch>
|
||||
<Route exact path="/register" render={(props) => this.renderHomeIfLoggedIn(<RegisterPage {...props} />)}/>
|
||||
<Route exact path="/signup" render={(props) => this.renderHomeIfLoggedIn(<SignupPage {...props} />)}/>
|
||||
<Route exact path="/result" render={(props) => this.renderHomeIfLoggedIn(<ResultPage {...props} />)}/>
|
||||
<Route exact path="/login" render={(props) => this.renderHomeIfLoggedIn(<SelfLoginPage {...props} />)}/>
|
||||
<Route exact path="/callback" component={AuthCallback}/>
|
||||
|
@ -22,8 +22,8 @@ export function getAccount(accessToken) {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function register(values) {
|
||||
return fetch(`${authConfig.serverUrl}/api/register`, {
|
||||
export function signup(values) {
|
||||
return fetch(`${authConfig.serverUrl}/api/signup`, {
|
||||
method: 'POST',
|
||||
credentials: "include",
|
||||
body: JSON.stringify(values),
|
||||
|
@ -210,7 +210,7 @@ class LoginPage extends React.Component {
|
||||
!application.enableSignUp ? null : (
|
||||
<div style={{float: "right"}}>
|
||||
{i18next.t("login:No account yet?")}
|
||||
<Link to={"/register"}>
|
||||
<Link to={"/signup"}>
|
||||
{i18next.t("login:sign up now")}
|
||||
</Link>
|
||||
</div>
|
||||
@ -250,7 +250,7 @@ class LoginPage extends React.Component {
|
||||
<br/>
|
||||
<div style={{float: "right"}}>
|
||||
No account yet?
|
||||
<Link to={"/register"}>
|
||||
<Link to={"/signup"}>
|
||||
sign up now
|
||||
</Link>
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@ class ResultPage extends React.Component {
|
||||
<div>
|
||||
<Result
|
||||
status="success"
|
||||
title="Your account is registered"
|
||||
title="Your account is created"
|
||||
subTitle="Please click the below button to login"
|
||||
extra={[
|
||||
<Link to="/login">
|
||||
|
@ -52,7 +52,7 @@ const tailFormItemLayout = {
|
||||
},
|
||||
};
|
||||
|
||||
class RegisterPage extends React.Component {
|
||||
class SignupPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@ -63,12 +63,12 @@ class RegisterPage extends React.Component {
|
||||
}
|
||||
|
||||
onFinish(values) {
|
||||
AuthBackend.register(values)
|
||||
AuthBackend.signup(values)
|
||||
.then((res) => {
|
||||
if (res.status === 'ok') {
|
||||
this.props.history.push('/result');
|
||||
} else {
|
||||
Setting.showMessage("error", `Failed to register: ${res.msg}`);
|
||||
Setting.showMessage("error", `Failed to sign up: ${res.msg}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -95,7 +95,7 @@ class RegisterPage extends React.Component {
|
||||
<Form
|
||||
{...formItemLayout}
|
||||
ref={this.form}
|
||||
name="register"
|
||||
name="signup"
|
||||
onFinish={(values) => this.onFinish(values)}
|
||||
onFinishFailed={(errorInfo) => this.onFinishFailed(errorInfo.values, errorInfo.errorFields, errorInfo.outOfDate)}
|
||||
initialValues={{
|
||||
@ -249,4 +249,4 @@ class RegisterPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default RegisterPage;
|
||||
export default SignupPage;
|
@ -58,8 +58,8 @@ export function renderMessageLarge(ths, msg) {
|
||||
<Button key="home" onClick={() => Setting.goToLinkSoft(ths, "/")}>
|
||||
Home
|
||||
</Button>,
|
||||
<Button type="primary" key="register" onClick={() => Setting.goToLinkSoft(ths, "/register")}>
|
||||
Register
|
||||
<Button type="primary" key="signup" onClick={() => Setting.goToLinkSoft(ths, "/signup")}>
|
||||
Sign Up
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
|
@ -48,7 +48,7 @@
|
||||
"Settings for your account": "Settings for your account",
|
||||
"Login": "Login",
|
||||
"Logout": "Logout",
|
||||
"Register": "Register"
|
||||
"Sign Up": "Sign Up"
|
||||
},
|
||||
"organization":
|
||||
{
|
||||
|
@ -48,7 +48,7 @@
|
||||
"Settings for your account": "账户设置选项",
|
||||
"Login": "登录",
|
||||
"Logout": "登出",
|
||||
"Register": "注册"
|
||||
"Sign Up": "注册"
|
||||
},
|
||||
"organization":
|
||||
{
|
||||
|
Reference in New Issue
Block a user