d7a783c4 by simon

微信授权调整

1 parent b15d3021
Showing 1 changed file with 41 additions and 42 deletions
...@@ -10,6 +10,10 @@ import { ...@@ -10,6 +10,10 @@ import {
10 formdata 10 formdata
11 } from '@/api/fetch-api.js' 11 } from '@/api/fetch-api.js'
12 12
13 import {
14 getQuery,
15 } from '@/utils/utils'
16
13 // import Mock from './mock' 17 // import Mock from './mock'
14 // Mock.bootstrap(); 18 // Mock.bootstrap();
15 19
...@@ -33,9 +37,43 @@ import { ...@@ -33,9 +37,43 @@ import {
33 // routes里的component组件需要以import方式引入,否则页面创建的时候,app还没挂载。 37 // routes里的component组件需要以import方式引入,否则页面创建的时候,app还没挂载。
34 38
35 39
40 let util = require('@/utils/utils');
41 let func = require('@/utils/func');
42
43 // 挂载全局app
44 app.api = api;
45 app.get = httpGet;
46 app.post = httpPost;
47 app.uploadFile = formdata;
48 app.router = router;
49 app.util = util;
50 app.func = func;
51 app.vant = {
52 Dialog,
53 Toast
54 }
55 window.app = app;
36 56
37 // function initVue() {
38 57
58 function initVue() {
59 window.vue = new Vue({
60 router,
61 store,
62 data: {
63 isInit: false,
64 globalData: {
65 ui: {
66 colorUI: "#409EFF",
67 colorDanger: "#EE0A24"
68 },
69 },
70 },
71 render: h => h(VueApp)
72 }).$mount('#app')
73 }
74
75 // 微信授权
76 // function initVue() {
39 // let codeSn = getQuery("c"); 77 // let codeSn = getQuery("c");
40 // if (process.env.NODE_ENV == "development") { 78 // if (process.env.NODE_ENV == "development") {
41 // openid = "oDPvDjjha8EVFhJaceqxs3Bta-1k"; 79 // openid = "oDPvDjjha8EVFhJaceqxs3Bta-1k";
...@@ -83,46 +121,7 @@ import { ...@@ -83,46 +121,7 @@ import {
83 // render: h => h(VueApp) 121 // render: h => h(VueApp)
84 // }).$mount('#app'); 122 // }).$mount('#app');
85 123
86 // // console.log('window.vue:',window.vue); 124 // }).catch((err) => {});
87 // }).catch((err) => {
88
89 // });
90 125
91 // } 126 // }
92 // initVue();
93
94 let util = require('@/utils/utils');
95 let func = require('@/utils/func');
96
97 // let Toast = vant.Toast;
98 // let Dialog = vant.Dialog;
99
100 let app = new Vue({
101 router,
102 store,
103 data: {
104 isInit: false,
105 globalData: {
106 ui: {
107 colorUI: "#409EFF",
108 colorDanger: "#EE0A24"
109 },
110 },
111 },
112 render: h => h(VueApp)
113 }).$mount('#app')
114
115
116 // 挂载全局app
117 app.api = api;
118 app.get = httpGet;
119 app.post = httpPost;
120 app.uploadFile = formdata;
121 app.router = router;
122 app.util = util;
123 app.func = func;
124 app.vant = {
125 Dialog,
126 Toast
127 }
128 window.app = app;
...\ No newline at end of file ...\ No newline at end of file
127 initVue();
...\ No newline at end of file ...\ No newline at end of file
......