| | |
| | | import { http } from '@/api/requestConfig.js'; // 全局挂载引入,配置相关在该index.js文件里修改 |
| | | Vue.prototype.$http = http |
| | | |
| | | // 路由守卫 |
| | | |
| | | // import UniRouteGuards from 'uniapp-route-guards'; |
| | | // Vue.use(UniRouteGuards); |
| | | |
| | | // const guard = new UniRouteGuards(); |
| | | |
| | | // // 自定义路由拦截白名单 |
| | | // const WHILE_LIST = ['']; |
| | | |
| | | // // 跳过路由白名单拦截 |
| | | // guard.beforeEach((to, from, next) => { |
| | | // if (WHILE_LIST.includes(from.url)) { |
| | | // return next(to.url); |
| | | // } |
| | | // next(); |
| | | // }); |
| | | |
| | | // // 拦截 调用 uni.switchTab 页面C并跳转到 页面D |
| | | // guard.beforeEach((to, from, next) => { |
| | | // console.log('\n'); |
| | | // console.log('================='); |
| | | // console.log('guard.beforeEach'); |
| | | // console.log('to: ', to); |
| | | // console.log('from: ', from); |
| | | // console.log('================='); |
| | | // console.log('\n'); |
| | | |
| | | // if (to.action === 'switchTab' && to.url === '/src/pages/c') { |
| | | // return next({ |
| | | // url: '/src/pages/d', |
| | | // action: 'navigateTo' |
| | | // }); |
| | | // } |
| | | |
| | | // next(); |
| | | // }); |
| | | |
| | | |
| | | |
| | | // import dayjs from 'dayjs'; |
| | | var dayjs = require('dayjs'); |
| | | Vue.prototype.$dayjs = dayjs; |