mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
在 PWAInstallPrompt.vue 中添加 HTTPS 环境检查
This commit is contained in:
@@ -15,9 +15,14 @@ const dismissed = ref(false)
|
|||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const isLogin = computed(() => authStore.token)
|
const isLogin = computed(() => authStore.token)
|
||||||
|
|
||||||
|
// 检查当前是不是https环境
|
||||||
|
const isHttps = computed(() => {
|
||||||
|
return window.location.protocol === 'https:'
|
||||||
|
})
|
||||||
|
|
||||||
// 检查是否应该显示横幅
|
// 检查是否应该显示横幅
|
||||||
const shouldShowBanner = computed(() => {
|
const shouldShowBanner = computed(() => {
|
||||||
return !isInstalled.value && !dismissed.value && !showInstructions.value && isLogin.value
|
return !isInstalled.value && !dismissed.value && !showInstructions.value && isLogin.value && isHttps.value
|
||||||
})
|
})
|
||||||
|
|
||||||
// 显示延迟(避免立即显示)
|
// 显示延迟(避免立即显示)
|
||||||
@@ -62,8 +67,6 @@ const dismissBanner = () => {
|
|||||||
localStorage.setItem('pwa-install-dismissed', new Date().toISOString())
|
localStorage.setItem('pwa-install-dismissed', new Date().toISOString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取平台特定的安装说明
|
// 获取平台特定的安装说明
|
||||||
const instructions = computed(() => {
|
const instructions = computed(() => {
|
||||||
const rawInstructions = getInstallInstructions()
|
const rawInstructions = getInstallInstructions()
|
||||||
|
|||||||
Reference in New Issue
Block a user