d7a783c4 by simon

微信授权调整

1 parent b15d3021
Showing 1 changed file with 41 additions and 42 deletions
......@@ -10,6 +10,10 @@ import {
formdata
} from '@/api/fetch-api.js'
import {
getQuery,
} from '@/utils/utils'
// import Mock from './mock'
// Mock.bootstrap();
......@@ -33,9 +37,43 @@ import {
// routes里的component组件需要以import方式引入,否则页面创建的时候,app还没挂载。
let util = require('@/utils/utils');
let func = require('@/utils/func');
// function initVue() {
// 挂载全局app
app.api = api;
app.get = httpGet;
app.post = httpPost;
app.uploadFile = formdata;
app.router = router;
app.util = util;
app.func = func;
app.vant = {
Dialog,
Toast
}
window.app = app;
function initVue() {
window.vue = new Vue({
router,
store,
data: {
isInit: false,
globalData: {
ui: {
colorUI: "#409EFF",
colorDanger: "#EE0A24"
},
},
},
render: h => h(VueApp)
}).$mount('#app')
}
// 微信授权
// function initVue() {
// let codeSn = getQuery("c");
// if (process.env.NODE_ENV == "development") {
// openid = "oDPvDjjha8EVFhJaceqxs3Bta-1k";
......@@ -83,46 +121,7 @@ import {
// render: h => h(VueApp)
// }).$mount('#app');
// // console.log('window.vue:',window.vue);
// }).catch((err) => {
// });
// }).catch((err) => {});
// }
// initVue();
let util = require('@/utils/utils');
let func = require('@/utils/func');
// let Toast = vant.Toast;
// let Dialog = vant.Dialog;
let app = new Vue({
router,
store,
data: {
isInit: false,
globalData: {
ui: {
colorUI: "#409EFF",
colorDanger: "#EE0A24"
},
},
},
render: h => h(VueApp)
}).$mount('#app')
// 挂载全局app
app.api = api;
app.get = httpGet;
app.post = httpPost;
app.uploadFile = formdata;
app.router = router;
app.util = util;
app.func = func;
app.vant = {
Dialog,
Toast
}
window.app = app;
\ No newline at end of file
initVue();
\ No newline at end of file
......