feat: implement logout on 401 response and update query handling
refactor: replace Button with div for consistent styling in AIEditorLink refactor: update navigation handling in AppVersionList and remove LayoutMain wrapper refactor: remove unused LayoutMain imports and components across various pages fix: ensure user app list is set correctly in useUserAppStore fix: update login URL format in AuthProvider fix: adjust layout styles in EnvPage and other pages for better responsiveness chore: update route definitions and create new routes for apps, config, domain, flowme, org, remote, token, user, and users style: replace Button with div for delete confirmation in various components fix: ensure correct handling of user profile image source
This commit is contained in:
@@ -15,7 +15,7 @@ export const AuthProvider = ({ children, mustLogin }: Props) => {
|
||||
useEffect(() => {
|
||||
store.init()
|
||||
}, [])
|
||||
const loginUrl = '/root/login?redirect=' + encodeURIComponent(window.location.href);
|
||||
const loginUrl = '/root/login/?redirect=' + encodeURIComponent(window.location.href);
|
||||
if (mustLogin && !store.me) {
|
||||
return (
|
||||
<div className="w-full h-full min-h-screen flex items-center justify-center bg-background">
|
||||
@@ -27,13 +27,15 @@ export const AuthProvider = ({ children, mustLogin }: Props) => {
|
||||
<h2 className="text-xl font-semibold text-foreground">需要登录</h2>
|
||||
<p className="text-sm text-muted-foreground">请先登录以继续访问此页面</p>
|
||||
</div>
|
||||
<a
|
||||
href={loginUrl}
|
||||
<div
|
||||
className="inline-flex items-center justify-center gap-2 w-full px-6 py-2.5 rounded-lg bg-foreground text-background text-sm font-medium transition-opacity hover:opacity-80 active:opacity-70"
|
||||
onClick={() => {
|
||||
window.open(loginUrl, '_self')
|
||||
}}
|
||||
>
|
||||
<LogIn className="w-4 h-4" />
|
||||
立即登录
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user