|
|
@ -4,10 +4,11 @@ import { useRegisterSW } from 'virtual:pwa-register/react';
|
|
|
|
// import { pwaInfo } from 'virtual:pwa-info';
|
|
|
|
// import { pwaInfo } from 'virtual:pwa-info';
|
|
|
|
|
|
|
|
|
|
|
|
import { BUILD_VERSION, BUILD_DATE } from '@/config'
|
|
|
|
import { BUILD_VERSION, BUILD_DATE } from '@/config'
|
|
|
|
|
|
|
|
import { Alert } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(pwaInfo, 'pwaInfo');
|
|
|
|
// console.log(pwaInfo, 'pwaInfo');
|
|
|
|
|
|
|
|
|
|
|
|
function ReloadPrompt({ force }) {
|
|
|
|
function ReloadPrompt({ force, ...props }) {
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
offlineReady: [offlineReady, setOfflineReady],
|
|
|
|
offlineReady: [offlineReady, setOfflineReady],
|
|
|
@ -57,13 +58,14 @@ function ReloadPrompt({ force }) {
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{/* {offlineReady && (<span>{APP_VERSION}</span>) } */}
|
|
|
|
{/* {offlineReady && (<span>{APP_VERSION}</span>) } */}
|
|
|
|
{(force || needRefresh) && (
|
|
|
|
{(force || needRefresh) && (
|
|
|
|
<a
|
|
|
|
<Alert {...props} banner closable={false}
|
|
|
|
|
|
|
|
message={<a
|
|
|
|
className=' text-sky-600 pr-2'
|
|
|
|
className=' text-sky-600 pr-2'
|
|
|
|
onClick={() => {
|
|
|
|
onClick={() => {
|
|
|
|
needRefresh ? updateServiceWorker(true) : forceReload()
|
|
|
|
needRefresh ? updateServiceWorker(true) : forceReload()
|
|
|
|
}}>
|
|
|
|
}}>
|
|
|
|
系统更新{needRefresh && '🚀'}
|
|
|
|
{force ? '系统更新' : `新版本发布了,点击👉马上更新`}{needRefresh && '🚀'}
|
|
|
|
</a>
|
|
|
|
</a>} type="info" showIcon icon={'🎉'} />
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
|
|
|
|
|
|
|
|