Improve jump links.

This commit is contained in:
Yang Luo
2021-06-14 23:23:59 +08:00
parent a7912eecc1
commit c122e89fc1
2 changed files with 22 additions and 6 deletions

View File

@ -262,6 +262,12 @@ export function goToLogin(ths, application) {
return;
}
if (!application.enablePassword && window.location.pathname.includes("/signup/oauth/authorize")) {
const link = window.location.href.replace("/signup/oauth/authorize", "/login/oauth/authorize");
goToLink(link);
return;
}
if (authConfig.appName === application.name) {
goToLinkSoft(ths, "/login");
} else {
@ -278,6 +284,12 @@ export function goToSignup(ths, application) {
return;
}
if (!application.enablePassword && window.location.pathname.includes("/login/oauth/authorize")) {
const link = window.location.href.replace("/login/oauth/authorize", "/signup/oauth/authorize");
goToLink(link);
return;
}
if (authConfig.appName === application.name) {
goToLinkSoft(ths, "/signup");
} else {

View File

@ -14,7 +14,6 @@
import React from "react";
import {Alert, Button, message, Result} from "antd";
import * as Setting from "../Setting";
export function showMessage(type, text) {
if (type === "success") {
@ -55,12 +54,17 @@ export function renderMessageLarge(ths, msg) {
title="There was a problem signing you in.."
subTitle={msg}
extra={[
<Button key="home" onClick={() => Setting.goToLinkSoft(ths, "/")}>
Home
</Button>,
<Button type="primary" key="signup" onClick={() => Setting.goToLinkSoft(ths, "/signup")}>
Sign Up
<Button type="primary" key="back" onClick={() => {
window.history.go(-2);
}}>
Back
</Button>,
// <Button key="home" onClick={() => Setting.goToLinkSoft(ths, "/")}>
// Home
// </Button>,
// <Button type="primary" key="signup" onClick={() => Setting.goToLinkSoft(ths, "/signup")}>
// Sign Up
// </Button>,
]}
>
</Result>