陈帅 6 anni fa
parent
commit
46d8462caa
2 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 1 1
      src/defaultSettings.js
  2. 5 2
      src/global.js

+ 1 - 1
src/defaultSettings.js

@@ -10,7 +10,7 @@ module.exports = {
     disableLocal: false,
     disableLocal: false,
   },
   },
   title: 'Ant Design Pro',
   title: 'Ant Design Pro',
-  pwa: true,
+  pwa: false,
   // Your custom iconfont Symbol script Url
   // Your custom iconfont Symbol script Url
   // eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
   // eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
   // 注意:如果需要图标多色,Iconfont 图标项目里要进行批量去色处理
   // 注意:如果需要图标多色,Iconfont 图标项目里要进行批量去色处理

+ 5 - 2
src/global.js

@@ -3,8 +3,6 @@ import { notification, Button, message } from 'antd';
 import { formatMessage } from 'umi-plugin-react/locale';
 import { formatMessage } from 'umi-plugin-react/locale';
 import defaultSettings from './defaultSettings';
 import defaultSettings from './defaultSettings';
 
 
-window.React = React;
-
 const { pwa } = defaultSettings;
 const { pwa } = defaultSettings;
 // if pwa is true
 // if pwa is true
 if (pwa) {
 if (pwa) {
@@ -58,4 +56,9 @@ if (pwa) {
       onClose: async () => {},
       onClose: async () => {},
     });
     });
   });
   });
+} else if ('serviceWorker' in navigator) {
+  // eslint-disable-next-line compat/compat
+  navigator.serviceWorker.ready.then(registration => {
+    registration.unregister();
+  });
 }
 }