123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- import Vue from 'vue'
- import App from './App'
- // vuex
- import store from './store'
- // 引入全局uView
- import uView from '@/uni_modules/uview-ui'
- import baseApi from '@/util/base.js'
- import request from '@/util/request.js'
- import utils from '@/util/util.js'
- import webim from 'webim.js';
- import helper from '@/common/helper.js'
- import dw from '@/util/dw.js'
- Vue.prototype.$dw = dw
- // import axios from 'axios'
- // import TabbarView from "./common/TabBarView.js";
- // Vue.prototype.$tabbarView = new TabbarView();
- Vue.prototype.$api = baseApi
- Vue.prototype.$request = request
- Vue.prototype.$utils = utils
- Vue.prototype.$helper = helper
- Vue.prototype.$socket = webim;
- Vue.prototype.$store = store
- // Vue.prototype.$axios = axios
- // import axios from 'axios'
- // // 解决uniapp 适配axios请求,避免报adapter is not a function错误
- // axios.defaults.adapter = config => {
- // console.log(config)
- // return new Promise((resolve, reject) => {
- // let settle = require('axios/lib/core/settle');
- // let buildURL = require('axios/lib/helpers/buildURL');
- // uni.request({
- // method: config.method.toUpperCase(),
- // url: config.baseURL + buildURL(config.url, config.params, config.paramsSerializer),
- // header: config.headers,
- // data: config.data,
- // dataType: config.dataType,
- // responseType: config.responseType,
- // sslVerify: config.sslVerify,
- // complete: function complete(response) {
- // // console.log("执行完成:", response)
- // response = {
- // data: response.data,
- // status: response.statusCode,
- // errMsg: response.errMsg,
- // header: response.header,
- // config: config
- // };
- // settle(resolve, reject, response);
- // }
- // })
- // })
- // }
- Vue.config.productionTip = false
- App.mpType = 'app'
- Vue.use(uView)
- const logout = () => {
- uni.removeStorage({
- key: 'userInfo'
- })
- }
- Vue.prototype.$api = {
- logout,
- };
- // #ifdef MP
- // 引入uView对小程序分享的mixin封装
- const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
- Vue.mixin(mpShare)
- // #endif
- const app = new Vue({
- store,
- ...App
- })
- // // 引入请求封装
- // require('./util/request/index')(app)
- app.$mount()
- // #ifdef APP-PLUS
- let main = plus.android.runtimeMainActivity();
- plus.runtime.quit = function() {
- main.moveTaskToBack(false);
- };
- plus.nativeUI.toast = (function(str) {
- if (str == '再按一次退出应用') {
- main.moveTaskToBack(false);
- return false;
- }
- });
- // #endif
|