Commit 07956de3a9cbfd3f3f7356e40bff75f42604f5d7

Authored by 王强
1 parent 30de39f3

fix(*): 优化 弹窗监听唯一值 初始化处理

package.json
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 "dependencies": { 27 "dependencies": {
28 "@ant-design/cssinjs": "^1.21.1", 28 "@ant-design/cssinjs": "^1.21.1",
29 "@ant-design/icons": "^5.4.0", 29 "@ant-design/icons": "^5.4.0",
30 - "@feewee/h5app-common": "^0.1.97", 30 + "@feewee/h5app-common": "^0.1.107",
31 "@modern-js/plugin-polyfill": "~2.55.0", 31 "@modern-js/plugin-polyfill": "~2.55.0",
32 "@modern-js/runtime": "~2.55.0", 32 "@modern-js/runtime": "~2.55.0",
33 "ahooks": "^3.8.0", 33 "ahooks": "^3.8.0",
pnpm-lock.yaml
@@ -12,8 +12,8 @@ dependencies: @@ -12,8 +12,8 @@ dependencies:
12 specifier: ^5.4.0 12 specifier: ^5.4.0
13 version: 5.4.0(react-dom@18.3.1)(react@18.3.1) 13 version: 5.4.0(react-dom@18.3.1)(react@18.3.1)
14 '@feewee/h5app-common': 14 '@feewee/h5app-common':
15 - specifier: ^0.1.97  
16 - version: 0.1.97(antd@5.20.3)(react-dom@18.3.1)(react@18.3.1) 15 + specifier: ^0.1.107
  16 + version: 0.1.107(antd@5.20.3)(react-dom@18.3.1)(react@18.3.1)
17 '@modern-js/plugin-polyfill': 17 '@modern-js/plugin-polyfill':
18 specifier: ~2.55.0 18 specifier: ~2.55.0
19 version: 2.55.0 19 version: 2.55.0
@@ -3332,8 +3332,8 @@ packages: @@ -3332,8 +3332,8 @@ packages:
3332 - supports-color 3332 - supports-color
3333 dev: true 3333 dev: true
3334 3334
3335 - /@feewee/h5app-common@0.1.97(antd@5.20.3)(react-dom@18.3.1)(react@18.3.1):  
3336 - resolution: {integrity: sha512-+1toOU/GZhaqnCpLcBJ5Ymrr7Pb9uqrqAOSPGOchSNNaAcMexR6u30m/jNYajXVow98cOPh7zx7OMDbjtiWQuQ==} 3335 + /@feewee/h5app-common@0.1.107(antd@5.20.3)(react-dom@18.3.1)(react@18.3.1):
  3336 + resolution: {integrity: sha512-5yXePOzTixAEW/gQ+CJnK6fryH7cP481moMKSuuYwK2tlP2sU+BKtg+XopxLPDySpCuNBgT2OidsMq9BQiM9KQ==}
3337 engines: {node: '>=18', npm: '>=6.9.0'} 3337 engines: {node: '>=18', npm: '>=6.9.0'}
3338 peerDependencies: 3338 peerDependencies:
3339 antd: '>=5' 3339 antd: '>=5'
src/routes/layout.tsx
1 import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'; 1 import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
2 import { Outlet, useNavigate } from '@modern-js/runtime/router'; 2 import { Outlet, useNavigate } from '@modern-js/runtime/router';
3 import dayjs from 'dayjs'; 3 import dayjs from 'dayjs';
4 -import { ONE_SECOND, helper, localdb } from '@feewee/h5app-common'; 4 +import { ONE_SECOND, OnlyKey, helper, localdb, useOverlay } from '@feewee/h5app-common';
5 import { StyleProvider } from '@ant-design/cssinjs'; 5 import { StyleProvider } from '@ant-design/cssinjs';
6 import { getServerTime } from './service'; 6 import { getServerTime } from './service';
7 import 'dayjs/locale/zh-cn'; 7 import 'dayjs/locale/zh-cn';
@@ -54,6 +54,8 @@ export default function Layout() { @@ -54,6 +54,8 @@ export default function Layout() {
54 54
55 useEffect(() => { 55 useEffect(() => {
56 window.document.addEventListener('message', lisFn); 56 window.document.addEventListener('message', lisFn);
  57 + OnlyKey.clearOnlyKey();
  58 + useOverlay.clear();
57 59
58 return () => { 60 return () => {
59 window.document.removeEventListener('message', lisFn); 61 window.document.removeEventListener('message', lisFn);