123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- import App from './App'
- import vueComposition from "@vue/composition-api"
- Vue.use(vueComposition)
- import Vue from 'vue'
- import {
- router,
- RouterMount
- } from "@/common/router";
- import store from "@/common/store";
- import common from "@/common";
- import uView from '@/uni_modules/uview-ui'
- let mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js');
- Vue.mixin(mpShare)
- Vue.config.productionTip = false
- App.mpType = 'app'
- Vue.prototype.$store = store
- Vue.use(router);
- Vue.use(uView);
- Vue.use(common);
- try {
- function isPromise(obj) {
- return (
- !!obj &&
- (typeof obj === "object" || typeof obj === "function") &&
- typeof obj.then === "function"
- );
- }
-
- uni.addInterceptor({
- returnValue(res) {
- if (!isPromise(res)) {
- return res;
- }
- return new Promise((resolve, reject) => {
- res.then((res) => {
- if (res[0]) {
- reject(res[0]);
- } else {
- resolve(res[1]);
- }
- });
- });
- },
- });
- } catch (error) {}
- const app = new Vue({
- ...App
- })
- if (process.env.NODE_ENV !== "development") {
- console.log = () => {}
- }
- require('@/common/request/index.js')(app)
- import { downloadFile, goChat, openFile, setCache, exportWord, filterSize, countChar, textFormat, accMul, accDiv, accAdd, accSub, parseDate } from '@/common/js/public.js'
- Vue.prototype.$downloadFile = downloadFile
- Vue.prototype.$openFile = openFile
- Vue.prototype.$filterSize = filterSize
- Vue.prototype.$goChat = goChat
- Vue.prototype.$setCache = setCache
- Vue.prototype.$exportWord = exportWord
- Vue.prototype.$countChar = countChar
- Vue.prototype.$textFormat = textFormat
- Vue.prototype.$accMul = accMul
- Vue.prototype.$accDiv = accDiv
- Vue.prototype.$accAdd = accAdd
- Vue.prototype.$accSub = accSub
- Vue.prototype.$parseDate = parseDate
- RouterMount(app, router, "#app");
- app.$mount();
- import {
- createSSRApp
- } from 'vue'
- export function createApp() {
- const app = createSSRApp(App)
- return {
- app
- }
- }
|