wzp
2022-03-08 1f478b4b033d518f6de21f931d828d2a175b2a3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import App from './App'
 
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif
 
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
//自定义导航栏
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)
 
import { http,apiBaseUrl } from '@/api/requestConfig.js'; // 全局挂载引入,配置相关在该index.js文件里修改
Vue.prototype.$http = http;
Vue.prototype.$ApiUrl = apiBaseUrl;
 
 
// 路由守卫
 
// 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();
// });
 
 
 
var dayjs = require('dayjs');
Vue.prototype.$dayjs = dayjs;
 
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif