From 21b80e79792b800eb3e409340d31be1354878a24 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 17 六月 2025 12:03:34 +0800
Subject: [PATCH] 1
---
zy-acs-flow/src/map/header/FakeFab.jsx | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/zy-acs-flow/src/map/header/FakeFab.jsx b/zy-acs-flow/src/map/header/FakeFab.jsx
index c26bf57..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(() => {
@@ -16,9 +19,23 @@
const handleToggle = () => {
getFakeSign(null, (res) => {
- setFakeSign(!res, (updatedSign) => {
- setFakeRun(updatedSign);
- });
+ let pass = true;
+ 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);
+ });
+ }
});
}
@@ -31,7 +48,7 @@
onClick={handleToggle}
>
<LensBlurIcon />
- {/* {translate('page.map.action.adapt')} */}
+ {translate('page.map.action.fake')}
</Fab>
</>
)
--
Gitblit v1.9.1