From d14e77e0da0db122867500fecf6d0607ef4d3bd5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 26 十二月 2024 13:43:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
zy-acs-flow/src/map/header/FakeFab.jsx | 24 ++++++++++++++----------
1 files changed, 14 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..635c918 100644
--- a/zy-acs-flow/src/map/header/FakeFab.jsx
+++ b/zy-acs-flow/src/map/header/FakeFab.jsx
@@ -1,4 +1,5 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
+import { useTranslate } from "react-admin";
import {
Fab,
} from '@mui/material';
@@ -6,6 +7,7 @@
import { getFakeSign, setFakeSign } from "../http";
const FakeFab = (props) => {
+ const translate = useTranslate();
const [fakeRun, setFakeRun] = useState(false);
useEffect(() => {
@@ -17,15 +19,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 === 'xltys1995') {
+ pass = true;
+ } else {
+ pass = false;
+ if (!pwd) {
+ alert('Incorrect password');
+ }
+ }
+ }
if (pass) {
setFakeSign(!res, (updatedSign) => {
setFakeRun(updatedSign);
@@ -43,7 +47,7 @@
onClick={handleToggle}
>
<LensBlurIcon />
- {/* {translate('page.map.action.adapt')} */}
+ {translate('page.map.action.fake')}
</Fab>
</>
)
--
Gitblit v1.9.1