From 83a12f86f4f963b8a1e6741fd18a5f9dcbd60eb8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 12 十月 2024 16:08:01 +0800
Subject: [PATCH] #
---
zy-acs-flow/src/page/login/Login.jsx | 44 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/zy-acs-flow/src/page/login/Login.jsx b/zy-acs-flow/src/page/login/Login.jsx
index bd2ad7e..c744003 100644
--- a/zy-acs-flow/src/page/login/Login.jsx
+++ b/zy-acs-flow/src/page/login/Login.jsx
@@ -1,7 +1,6 @@
import * as React from 'react';
import { useState } from 'react';
import { useLocation } from 'react-router-dom';
-
import {
Avatar,
Box,
@@ -19,6 +18,7 @@
useLogin,
useNotify,
} from 'react-admin';
+import { LOGIN_BACKGROUND } from '@/config/setting';
const Login = () => {
const [loading, setLoading] = useState(false);
@@ -30,6 +30,7 @@
const handleSubmit = (auth) => {
setLoading(true);
+ // js native confirm && root
login(
auth,
location.state ? (location.state).nextPathname : '/'
@@ -39,8 +40,8 @@
typeof error === 'string'
? error
: typeof error === 'undefined' || !error.message
- ? 'ra.auth.sign_in_error'
- : error.message,
+ ? 'ra.auth.sign_in_error'
+ : error.message,
{
type: 'error',
messageArgs: {
@@ -48,8 +49,8 @@
typeof error === 'string'
? error
: error && error.message
- ? error.message
- : undefined,
+ ? error.message
+ : undefined,
},
}
);
@@ -58,6 +59,7 @@
return (
<Form onSubmit={handleSubmit} noValidate>
+ {/* https://unsplash.com/ */}
<Box
sx={{
display: 'flex',
@@ -65,13 +67,39 @@
minHeight: '100vh',
alignItems: 'center',
justifyContent: 'flex-start',
- background: `url(/login_bg.jpg)`,
+ // justifyContent: 'center',
+ background: `url(/login_bg1.jpg)`,
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
}}
>
- {/* https://unsplash.com/ */}
- <Card sx={{ minWidth: 300, marginTop: '6em', backgroundColor: '#fff' }}>
+ <video
+ autoPlay
+ loop
+ muted
+ style={{
+ position: 'fixed',
+ top: 0,
+ left: 0,
+ width: '100%',
+ height: '100%',
+ // objectFit: 'cover',
+ // objectFit: 'contain',
+ objectFit: 'fill',
+ // objectFit: 'scale-down',
+ zIndex: 0,
+ }}
+ >
+ {LOGIN_BACKGROUND === 'media' && (
+ <source src="/login_bg1.mp4" type="video/mp4" />
+ )}
+ </video>
+
+ <Card sx={{
+ minWidth: 300,
+ marginTop: '6em',
+ zIndex: 1
+ }}>
<Box
sx={{
margin: '1em',
--
Gitblit v1.9.1