jxdnsong
2022-10-25 bf5ba56e8a82f0ef699f2eae413d0dc2c4e4f67d
src/App.vue
@@ -1,11 +1,12 @@
<template>
    <div id="app" :class="{ cantdoit: cantdoits }">
    <div ref="appRef" id="app" :class="{ cantdoit: cantdoits }">
        <router-view v-if="isRouterActive"></router-view>
    </div>
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
import DevicePixelRatio from './utils/devicePixelRatio'
export default {
    name: 'App',
@@ -19,7 +20,9 @@
        }
    },
    created () {
        if (!this._isMobile()) {
            new DevicePixelRatio().init()
        }
    },
    mounted () {
        var transmitData = {}
@@ -86,7 +89,12 @@
        } else {
            // pc端
            // this.$router.replace('/large')
            this.$router.replace('/pcLayout')
            // if (this.$route.path == '/pcLayout/default') {
            //     this.$router.replace('/pcLayout')
            // } else {
            //     this.$router.replace('/login')
            // }
        }
    },
    methods: {
@@ -105,17 +113,6 @@
            var r = window.location.href.slice(inlength)
            if (r != null) return decodeURIComponent(r)
            return null
        },
        getQueryVariable (variable) {
            var query = window.location.search.substring(1)
            var vars = query.split('&')
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split('=')
                if (pair[0] == variable) {
                    return pair[1]
                }
            }
            return false
        },
        _isMobile () {
            const flag = navigator.userAgent.match(