From ecd3b2965bd8766c44655ad6084e9274b9c088bf Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 20 九月 2024 08:58:27 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/config/setting.js    |    4 +++-
 zy-acs-flow/src/page/login/Login.jsx |   35 ++++++++++++++++++++++++++++-------
 zy-acs-flow/public/login_bg.mp4      |    0 
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/zy-acs-flow/public/login_bg.mp4 b/zy-acs-flow/public/login_bg.mp4
new file mode 100644
index 0000000..dfacba8
--- /dev/null
+++ b/zy-acs-flow/public/login_bg.mp4
Binary files differ
diff --git a/zy-acs-flow/src/config/setting.js b/zy-acs-flow/src/config/setting.js
index 6db058f..7b5f3e7 100644
--- a/zy-acs-flow/src/config/setting.js
+++ b/zy-acs-flow/src/config/setting.js
@@ -31,4 +31,6 @@
 
 export const OPERATE_MODE = 'undoable'; // pessimistic | optimistic(tip) | undoable
 
-export const EDIT_MODE = 'pessimistic'; // pessimistic | undoable
\ No newline at end of file
+export const EDIT_MODE = 'pessimistic'; // pessimistic | undoable
+
+export const LOGIN_BACKGROUND = 'image';  // image | media
\ No newline at end of file
diff --git a/zy-acs-flow/src/page/login/Login.jsx b/zy-acs-flow/src/page/login/Login.jsx
index bd4ab7e..ac08043 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);
@@ -39,8 +39,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 +48,8 @@
                             typeof error === 'string'
                                 ? error
                                 : error && error.message
-                                  ? error.message
-                                  : undefined,
+                                    ? error.message
+                                    : undefined,
                     },
                 }
             );
@@ -58,6 +58,7 @@
 
     return (
         <Form onSubmit={handleSubmit} noValidate>
+            {/* https://unsplash.com/ */}
             <Box
                 sx={{
                     display: 'flex',
@@ -70,8 +71,28 @@
                     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_bg.mp4" type="video/mp4" />
+                    )}
+                </video>
+                <Card sx={{ minWidth: 300, marginTop: '6em', zIndex: 1 }}>
                     <Box
                         sx={{
                             margin: '1em',

--
Gitblit v1.9.1