From 9483baffba9a24a2a36fc8739fc65b59317d9142 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期四, 03 七月 2025 14:18:46 +0800 Subject: [PATCH] 队列拆分 --- zy-acs-flow/src/map/header/FakeFab.jsx | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/zy-acs-flow/src/map/header/FakeFab.jsx b/zy-acs-flow/src/map/header/FakeFab.jsx index f39f6d4..eb3f593 100644 --- a/zy-acs-flow/src/map/header/FakeFab.jsx +++ b/zy-acs-flow/src/map/header/FakeFab.jsx @@ -1,11 +1,14 @@ import React, { useState, useRef, useEffect, useMemo } from "react"; +import { useTranslate } from "react-admin"; import { Fab, } from '@mui/material'; import LensBlurIcon from '@mui/icons-material/LensBlur'; import { getFakeSign, setFakeSign } from "../http"; +import { VERIFY_PASSWORD } from '@/config/setting'; const FakeFab = (props) => { + const translate = useTranslate(); const [fakeRun, setFakeRun] = useState(false); useEffect(() => { @@ -17,15 +20,17 @@ const handleToggle = () => { getFakeSign(null, (res) => { let pass = true; - // if (!res) { - // const pwd = prompt("please enter password:"); - // if (pwd === 'xltys1995') { - // pass = true; - // } else { - // pass = false; - // alert('Incorrect password'); - // } - // } + if (!res) { + const pwd = prompt("please enter password:"); + if (pwd === VERIFY_PASSWORD) { + pass = true; + } else { + pass = false; + if (pwd) { + alert('Incorrect password'); + } + } + } if (pass) { setFakeSign(!res, (updatedSign) => { setFakeRun(updatedSign); @@ -43,7 +48,7 @@ onClick={handleToggle} > <LensBlurIcon /> - {/* {translate('page.map.action.adapt')} */} + {translate('page.map.action.fake')} </Fab> </> ) -- Gitblit v1.9.1