-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.js
44 lines (32 loc) · 920 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Vue from 'vue'
import App from './App'
import {http} from "utils/luch-request/index.js"
Vue.prototype.$http = http;
//聊天测试
import store from "./common/chat/store.js";
Vue.prototype.$store = store;
//聊天测试结束
//自定义事件引入
import event from './common/uni-app-customEvent/custom-event.js'
const Event = new event();
Vue.prototype.$event = Event;
Vue.config.productionTip = false;
// backpage : 登录后返回的页面
// backtype : 打开页面的类型[1 : redirectTo 2 : switchTab]
Vue.prototype.checkLogin = function(backpage, backtype) {
var UID = uni.getStorageSync('UID');
var TOKEN = uni.getStorageSync('Token');
if (UID == '' || TOKEN == '') {
uni.redirectTo({
url: './pages/login/login?backpage=' + backpage + '&backtype=' + backtype
});
return false;
}
return [UID, TOKEN];
}
App.mpType = 'app'
const app = new Vue({
...App,
store,
})
app.$mount()