diff --git a/dist.rar b/dist-pc.rar similarity index 79% rename from dist.rar rename to dist-pc.rar index 7d7e65e..c2db38d 100644 Binary files a/dist.rar and b/dist-pc.rar differ diff --git a/src/router/index.js b/src/router/index.js index 02507ee..2c8b93d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,27 +80,26 @@ router.beforeEach((to, from, next) => { if (to.meta.title) { document.title = to.meta.title; } - let link = document.querySelector("link[rel='canonical']") + let link = document.querySelector("link[rel='canonical']"); if (!link) { - link = document.createElement('link') - link.rel = 'canonical' - document.head.appendChild(link) + link = document.createElement("link"); + link.rel = "canonical"; + document.head.appendChild(link); } - link.href = to.meta.canonical - - let alternateLink = document.querySelector("link[rel='alternate']") + link.href = to.meta.canonical; + + let alternateLink = document.querySelector("link[rel='alternate']"); if (!alternateLink) { - alternateLink = document.createElement('link') - alternateLink.rel = 'alternate' - alternateLink.media = 'only screen and (max-width: 640px)' - document.head.appendChild(alternateLink) + alternateLink = document.createElement("link"); + alternateLink.rel = "alternate"; + alternateLink.media = "only screen and (max-width: 640px)"; + document.head.appendChild(alternateLink); } - alternateLink.href = to.meta.alternate + alternateLink.href = to.meta.alternate; next(); // 如果是 PC 设备,继续导航 } else { - window.location.href = `https://m.counterfire.games?code=${ - to.query.code ? to.query.code : "" + window.location.href = `https://m.counterfire.games${ to.query.code ? '?code=' + to.query.code : "" }`; } });