49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
import Vue from 'vue';
|
|
import App from './App';
|
|
import store from './store';
|
|
import axios from './common/axios';
|
|
import utils from './common/util';
|
|
import ui from 'uview-ui'
|
|
import VConsole from 'vconsole'
|
|
import dayjs from 'dayjs'
|
|
|
|
const loading = title => {
|
|
uni.showLoading({
|
|
title: title ? title : '加载中',
|
|
mask: true
|
|
})
|
|
}
|
|
|
|
const hideLoading = () => {
|
|
uni.hideLoading()
|
|
}
|
|
|
|
Vue.prototype.$loading = loading
|
|
Vue.prototype.$hideLoading = hideLoading
|
|
Vue.use(ui)
|
|
Vue.config.productionTip = false;
|
|
//初始化接口工具类
|
|
Vue.prototype.$http = axios;
|
|
Vue.prototype.$dayjs = dayjs
|
|
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
|
|
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
|
|
utils.dict.init({instance: axios})
|
|
App.mpType = 'app';
|
|
process.env.NODE_ENV == 'development' && new VConsole();
|
|
// new VConsole()
|
|
const app = new Vue({
|
|
store,
|
|
...App
|
|
});
|
|
let params = {}
|
|
if (/saas/.test(location.pathname)) {//上架版
|
|
params = {action: "/app/wxcptp/portal/agentSign", corpId: "ww596787bb70f08288"}
|
|
}
|
|
if (/AppCountryAlbum/.test(location.pathname)) {//乡村相册版
|
|
params = {action: "/app/wxcptp/portal/agentSign", corpId: "wpytYEDgAAcpXjmlYkYwKO60JDGDWrXg", suiteId: "ww0da13777658d1262"}
|
|
}
|
|
if (/AppVote/.test(location.pathname)) {//微信公众号网页开发
|
|
app.$mount()
|
|
} else store.dispatch("agentSign", params).finally(() => app.$mount())
|
|
|