mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix return error
This commit is contained in:
parent
fab1326cd8
commit
fac79cb091
@ -6,10 +6,6 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<link rel="prefetch" href="/nuxt.sw.js">
|
<link rel="prefetch" href="/nuxt.sw.js">
|
||||||
<script>
|
<script>
|
||||||
if (location.host !== 'localhost' && location.protocol === 'http:') {
|
|
||||||
return location.replace(location.href.replace('http://', 'https://'))
|
|
||||||
}
|
|
||||||
|
|
||||||
async function reload() {
|
async function reload() {
|
||||||
const html = await fetch(window.location.href).then(r => r.text())
|
const html = await fetch(window.location.href).then(r => r.text())
|
||||||
if (html.includes('<!-- SW_INIT-->')) {
|
if (html.includes('<!-- SW_INIT-->')) {
|
||||||
@ -31,7 +27,11 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (location.host !== 'localhost' && location.protocol === 'http:') {
|
||||||
|
location.replace(location.href.replace('http://', 'https://'))
|
||||||
|
} else {
|
||||||
register()
|
register()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user