1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <!-- <nuxt-link to="/user">首页</nuxt-link> -->
- <!-- <nuxt-link to="/m_user">首页</nuxt-link> -->
- <div>
- <h1>惠融易客</h1>
- <nuxt-child />
- </div>
- </template>
- <script>
- import {postListData} from '../api/index'
- export default {
- middleware({ store, route, redirect, params, query }) {
- console.log('middleware layouts inside')
- // store状态树信息
- // route 一条目标路由信息
- //redirect 路由的强制跳转
- // params query 校验参数的合理性
- // console.log('layouts守卫前置守卫')
- // redirect('/reg')
- },
- data() {
- return {
- }
- },
- mounted() {
- this.goto()
- },
- methods: {
- async goto() {
- let z = postListData({
- "categoryId": 1
- })
- console.log('zzzzzzz',z)
- var system = {};
- system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
- if (system.pingtai) {
- //电脑
- console.log('电脑')
- this.$router.push('/user')
- } else {
- //手机
- console.log('手机')
- this.$router.push('/user/m_user')
- }
- }
- }
- }
- </script>
|