+6
-2
@@ -37,6 +37,12 @@ export default defineConfig({
|
|||||||
console.info('当前环境不支持 ServiceWorker');
|
console.info('当前环境不支持 ServiceWorker');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.location.protocol === 'file:') {
|
||||||
|
console.info('在file://协议下ServiceWorker不可用');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { registerSW } = await import('virtual:pwa-register');
|
const { registerSW } = await import('virtual:pwa-register');
|
||||||
const registration = await registerSW({
|
const registration = await registerSW({
|
||||||
@@ -156,8 +162,6 @@ export default defineConfig({
|
|||||||
purpose: 'maskable'
|
purpose: 'maskable'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
id: 'classworks',
|
|
||||||
scope: './',
|
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
{
|
{
|
||||||
name: '随机点名',
|
name: '随机点名',
|
||||||
|
|||||||
Reference in New Issue
Block a user