64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
import Vue from 'vue'
|
||
import App from './App'
|
||
|
||
|
||
import HttpRequest from './common/httpRequest'
|
||
import HttpCache from './common/cache'
|
||
import queue from './common/queue'
|
||
|
||
Vue.config.productionTip = false
|
||
Vue.prototype.$Request = HttpRequest;
|
||
Vue.prototype.$queue = queue;
|
||
|
||
Vue.prototype.$Sysconf = HttpRequest.config;
|
||
Vue.prototype.$SysCache = HttpCache;
|
||
|
||
App.mpType = 'app'
|
||
|
||
// 引入全局uView
|
||
import uView from "uview-ui";
|
||
Vue.use(uView);
|
||
|
||
|
||
const app = new Vue({
|
||
...App
|
||
})
|
||
|
||
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
|
||
import httpInterceptor from '@/common/http.interceptor.js'
|
||
Vue.use(httpInterceptor, app)
|
||
|
||
// http接口API集中管理引入部分
|
||
import httpApi from '@/common/http.api.js'
|
||
Vue.use(httpApi, app)
|
||
|
||
app.$mount()
|
||
|
||
console.log(uni);
|
||
|
||
// #ifdef APP
|
||
|
||
const sysInfo = uni.getSystemInfoSync();
|
||
let isIos = sysInfo.platform == 'ios'
|
||
|
||
if (isIos) {
|
||
const originNavigateTo = uni.navigateTo
|
||
|
||
uni.navigateTo = (params) => {
|
||
|
||
console.log("自定义 navigate 。。。。。。。。。。");
|
||
|
||
let jsonParam = JSON.parse(JSON.stringify(params))
|
||
|
||
|
||
if (isIos && jsonParam.url.includes('/me/detail/detail')) {
|
||
console.log('iOS 跳转视频也');
|
||
jsonParam.url = jsonParam.url.replace('/me/detail/detail', '/me/detail/detailIOS')
|
||
}
|
||
|
||
originNavigateTo(jsonParam)
|
||
}
|
||
}
|
||
|
||
|
||
// #endif
|