mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
feat: click on the app card to log in automatically (#1049)
This commit is contained in:
@ -27,15 +27,23 @@ class SingleCard extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
wrappedAsSilentSigninLink(link) {
|
||||
if (link.startsWith("http")) {
|
||||
link += link.includes("?") ? "&silentSignin=1" : "?silentSignin=1";
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
renderCardMobile(logo, link, title, desc, time, isSingle) {
|
||||
const gridStyle = {
|
||||
width: "100vw",
|
||||
textAlign: "center",
|
||||
cursor: "pointer",
|
||||
};
|
||||
const silentSigninLink = this.wrappedAsSilentSigninLink(link);
|
||||
|
||||
return (
|
||||
<Card.Grid style={gridStyle} onClick={() => Setting.goToLinkSoft(this, link)}>
|
||||
<Card.Grid style={gridStyle} onClick={() => Setting.goToLinkSoft(this, silentSigninLink)}>
|
||||
<img src={logo} alt="logo" height={60} style={{marginBottom: "20px"}} />
|
||||
<Meta
|
||||
title={title}
|
||||
@ -46,6 +54,8 @@ class SingleCard extends React.Component {
|
||||
}
|
||||
|
||||
renderCard(logo, link, title, desc, time, isSingle) {
|
||||
const silentSigninLink = this.wrappedAsSilentSigninLink(link);
|
||||
|
||||
return (
|
||||
<Col style={{paddingLeft: "20px", paddingRight: "20px", paddingBottom: "20px", marginBottom: "20px"}} span={6}>
|
||||
<Card
|
||||
@ -53,7 +63,7 @@ class SingleCard extends React.Component {
|
||||
cover={
|
||||
<img alt="logo" src={logo} style={{width: "100%", height: "210px", objectFit: "scale-down"}} />
|
||||
}
|
||||
onClick={() => Setting.goToLinkSoft(this, link)}
|
||||
onClick={() => Setting.goToLinkSoft(this, silentSigninLink)}
|
||||
style={isSingle ? {width: "320px"} : {width: "100%"}}
|
||||
>
|
||||
<Meta title={title} description={desc} />
|
||||
|
Reference in New Issue
Block a user