2021-11-15 10:29:05 +08:00
|
|
|
import Vue from 'vue';
|
|
|
|
|
import App from './App';
|
|
|
|
|
import store from './store';
|
|
|
|
|
import axios from './common/axios';
|
|
|
|
|
import utils from './common/util';
|
2021-11-17 17:34:44 +08:00
|
|
|
import ui from 'uview-ui'
|
2022-02-15 17:13:00 +08:00
|
|
|
import VConsole from 'vconsole'
|
2022-04-20 18:11:05 +08:00
|
|
|
import dayjs from 'dayjs'
|
2021-11-15 10:29:05 +08:00
|
|
|
|
2021-12-08 19:24:59 +08:00
|
|
|
const loading = title => {
|
|
|
|
|
uni.showLoading({
|
|
|
|
|
title: title ? title : '加载中',
|
|
|
|
|
mask: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const hideLoading = () => {
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Vue.prototype.$loading = loading
|
|
|
|
|
Vue.prototype.$hideLoading = hideLoading
|
2021-11-17 17:34:44 +08:00
|
|
|
Vue.use(ui)
|
2021-11-15 10:29:05 +08:00
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
//初始化接口工具类
|
|
|
|
|
Vue.prototype.$http = axios;
|
2022-04-20 18:11:05 +08:00
|
|
|
Vue.prototype.$dayjs = dayjs
|
2021-11-15 10:29:05 +08:00
|
|
|
Vue.prototype.$cdn = 'https://cdn.cunwuyun.cn/dvcp/h5/';
|
|
|
|
|
Object.keys(utils).map((e) => (Vue.prototype['$' + e] = utils[e]));
|
2022-03-15 10:53:46 +08:00
|
|
|
utils.dict.init({instance: axios})
|
2021-11-15 10:29:05 +08:00
|
|
|
App.mpType = 'app';
|
2022-07-28 15:08:02 +08:00
|
|
|
process.env.NODE_ENV == 'development' && new VConsole();
|
|
|
|
|
// new VConsole()
|
2021-11-15 10:29:05 +08:00
|
|
|
const app = new Vue({
|
2021-11-17 17:34:44 +08:00
|
|
|
store,
|
|
|
|
|
...App
|
2021-11-15 10:29:05 +08:00
|
|
|
});
|
2022-06-13 17:21:40 +08:00
|
|
|
let params = {}
|
2022-07-19 18:06:22 +08:00
|
|
|
if (/saas/.test(location.pathname)) {//上架版
|
2022-06-13 17:21:40 +08:00
|
|
|
params = {action: "/app/wxcptp/portal/agentSign", corpId: "ww596787bb70f08288"}
|
|
|
|
|
}
|
2022-06-15 16:06:41 +08:00
|
|
|
if (/AppCountryAlbum/.test(location.pathname)) {//乡村相册版
|
2022-06-15 16:10:14 +08:00
|
|
|
params = {action: "/app/wxcptp/portal/agentSign", corpId: "wpytYEDgAAcpXjmlYkYwKO60JDGDWrXg", suiteId: "ww0da13777658d1262"}
|
2022-06-15 16:06:22 +08:00
|
|
|
}
|
2022-06-13 17:21:40 +08:00
|
|
|
store.dispatch("agentSign", params).finally(() => app.$mount())
|
2021-11-15 10:29:05 +08:00
|
|
|
|