Anna Ho 2 年之前
父節點
當前提交
4a5bbac698
共有 8 個文件被更改,包括 59 次插入16 次删除
  1. +1
    -1
      src/assets/style/styles.css
  2. +3
    -3
      src/layout/MainLayout/index.js
  3. +1
    -1
      src/pages/authentication/AuthWrapper.js
  4. +6
    -3
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  5. +10
    -1
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  6. +9
    -1
      src/pages/authentication/auth-forms/CustomFormWizard.js
  7. +13
    -1
      src/pages/authentication/auth-forms/PasswordAlertDialog.js
  8. +16
    -5
      src/pages/gldDashboard/index.js

+ 1
- 1
src/assets/style/styles.css 查看文件

@@ -1,5 +1,5 @@
body{
padding-top: 43px;
padding-top: 53px;
font-family: 微軟正黑體;
}
/* main{


+ 3
- 3
src/layout/MainLayout/index.js 查看文件

@@ -4,7 +4,7 @@ import { useDispatch, useSelector } from 'react-redux';

// material-ui
import { useTheme } from '@mui/material/styles';
import { Box, Toolbar, useMediaQuery } from '@mui/material';
import { Box, useMediaQuery } from '@mui/material';
// import { Toolbar, useMediaQuery } from '@mui/material';

// project import
@@ -17,7 +17,7 @@ import Footer from 'components/cards/AuthFooter';

// types
import { openDrawer } from 'store/reducers/menu';
// import "assets/style/styles.css";
import "assets/style/styles.css";


// ==============================|| MAIN LAYOUT ||============================== //
@@ -54,7 +54,7 @@ const MainLayout = () => {
<Header/>
{/* <Drawer open={open} handleDrawerToggle={handleDrawerToggle} /> */}
<div style={{ width: '100%', flexGrow: 1, p: { xs: 2, sm: 3 } }}>
<Toolbar />
{/* <Toolbar /> */}
{/* <Breadcrumbs navigation={navigation} title /> */}
<Outlet />
</div>


+ 1
- 1
src/pages/authentication/AuthWrapper.js 查看文件

@@ -20,7 +20,7 @@ const BackgroundHead = {
width: '100%',
height: '100%',
backgroundSize:'cover'
}
}

// ==============================|| AUTHENTICATION - WRAPPER ||============================== //



+ 6
- 3
src/pages/authentication/auth-forms/AuthLoginCustom.js 查看文件

@@ -57,6 +57,7 @@ const AuthLoginCustom = () => {
const [isValid, setisValid] = useState(false);
const [open, setOpen] = React.useState(false);
const [isButtonDisabled, setIsButtonDisabled] = useState(true);
const [errorMassage, setErrorMassage] = useState('');

const handleMouseDownPassword = (event) => {
event.preventDefault();
@@ -68,7 +69,7 @@ const AuthLoginCustom = () => {
useJwt
.login({username: values.username, password: values.password})
.then((response) => {
console.log("123")
// console.log("123")
const userData = {
id: response.data.id,
fullenName: response.data.name,
@@ -87,8 +88,10 @@ const AuthLoginCustom = () => {
})
.catch((error) => {
// setSuccess(false)
setOpen(true)
console.error(error)
console.error(error.response.data.error)
setErrorMassage(error.response.data.error)
setOpen(true)
console.log("321")
});
}else{
@@ -271,7 +274,7 @@ const AuthLoginCustom = () => {
</Stack>
</Grid>
</Grid>
<PasswordAlertDialog open={open} handleClose={handleClose}/>
<PasswordAlertDialog open={open} handleClose={handleClose} errorMassage={errorMassage}/>
</form>
</FormikProvider>
);


+ 10
- 1
src/pages/authentication/auth-forms/BusCustomFormWizard.js 查看文件

@@ -117,7 +117,8 @@ const BusCustomFormWizard = (props) => {
fileList.length!==0&&
handlePassword(data.password)&&
handleEmail(data.email)&&
handlePhone(data.phone)
handlePhone(data.phone)&&
handleUserName(data.username)
)
{
setisValid(true)
@@ -307,6 +308,14 @@ const BusCustomFormWizard = (props) => {
}
}

function handleUserName(username) {
if (username.length < 6) {
return false;
} else {
return true;
}
}

function handlePassword(password) {
let new_pass = password;
// regular expressions to validate password


+ 9
- 1
src/pages/authentication/auth-forms/CustomFormWizard.js 查看文件

@@ -123,7 +123,7 @@ const CustomFormWizard = (props) => {
handleEmail(data.email)&&
handleIdNo(data.idNo,selectedIdDocType.type)&&
handle8Digi(data.phone)&&
handle8Digi(data.username)
handle6Digi(data.username)
)
{
setisValid(true)
@@ -317,6 +317,14 @@ const CustomFormWizard = (props) => {
}
}

function handle6Digi(value) {
if (value.length < 6) {
return false;
} else {
return true;
}
}

function handleIdNo(idNo,selectedIdDocType) {
var upperCase = /[A-Z]/g;
if (!idNo.match(upperCase)&&selectedIdDocType=="HKID") {


+ 13
- 1
src/pages/authentication/auth-forms/PasswordAlertDialog.js 查看文件

@@ -28,7 +28,19 @@ const PasswordAlertDialog = (props) => {
<DialogTitle id="alert-dialog-title">
<Stack mt={1} mr={4} direction="row" justifyContent="flex-start" alignItems="center" spacing={2}>
<CancelOutlinedIcon color="error" sx={{width:"35px",height:"40px"}}/>
<Typography display="inline" variant="h4">用戶名或密碼錯誤</Typography>
{props.errorMassage==='ACCOUNT_LOCKED_ERROR'?
<Stack direction="column">
<Typography display="inline">
帳戶將被封鎖
</Typography>
<Typography display="inline">
帳戶連續五次登入錯誤,請與系統管理員聯絡
</Typography>
</Stack>:
<Typography display="inline">
用戶名或密碼錯誤
</Typography>
}
</Stack>
</DialogTitle>
<DialogContent>


+ 16
- 5
src/pages/gldDashboard/index.js 查看文件

@@ -17,22 +17,33 @@ import {
// TextField,
Typography
} from '@mui/material';
import { Stack } from '../../../node_modules/@mui/material/index';

// project import
// import Loadable from 'components/Loadable';
// import { lazy } from 'react';
// import backbroundImg from 'assets/images/bg_ml.jpg'


// ==============================|| DASHBOARD - DEFAULT ||============================== //

const DashboardDefault = () => {
const userData = JSON.parse(localStorage.getItem("userData"));

const BackgroundHead = {
backgroundColor: '#0d47a1',
width: '100%',
height: '100%',
backgroundSize:'cover'
}
return (
<Grid container rowSpacing={4.5} columnSpacing={2.75} sx={{minHeight: '80vh'}}>
<Grid item xs={12} ml={2} mt={1}>
<Typography variant="h5">Moring, {userData.fullenName}</Typography>
</Grid>
<Grid container sx={{minHeight: '85vh'}}>
<div style={BackgroundHead}>
<Grid item xs={12} ml={2} height='60px'>
<Stack direction="row" justifyContent="flex-start" alignItems="center">
<Typography color='#FFF'variant="h4">Moring, {userData.fullenName}</Typography>
</Stack>
</Grid>
</div>
</Grid>
);


Loading…
取消
儲存