| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <nuxt />
- </template>
- <script>
- import Cookies from 'js-cookie'
- import Stats from '@/kaifain_v2/mixins/stats'
- const MOB_HOST = process.env.NODE_ENV === 'development' ? 'kaifain-m.test.proginn.com' : 'kaifain.m.proginn.com'
- const REM_RESET_STYLE = `font-size:16px !important;`
- const resetRem = () => {
- const _rem_mark = document.querySelector('#rootsize')
- if (_rem_mark) {
- _rem_mark.innerHTML = `html{${REM_RESET_STYLE}}`
- document.documentElement.style = REM_RESET_STYLE
- document.body.style = REM_RESET_STYLE
- }
- }
- export default {
- head() {
- return {
- bodyAttrs: {
- class: ['kaifain-view', 'non-rem']
- },
- ...Stats.head
- }
- },
- created() {
- if (process.client) {
- if (Cookies.get('x_app')) {
- const source = window.location.href
- let target
- if (/\/(s|d)\/[0-9a-f]+/.test(source)) {
- target = source.replace(location.host, MOB_HOST)
- } else {
- target = `https://${MOB_HOST}/`
- }
- window.location.replace(target)
- }
- }
- },
- beforeMount() {
- resetRem()
- }
- }
- </script>
- <style lang="scss">
- :root {
- font-size: 16px;
- }
- </style>
|