forked from wemakerspace/myhomeapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
49 lines (38 loc) · 1.05 KB
/
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
45
46
47
48
49
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
import uView from "uview-ui"
Vue.use(uView)
import GoEasy from 'goeasy'
Vue.prototype.goEasy = GoEasy.getInstance({
host: 'hangzhou.goeasy.io',
appkey: "BS-0caadcc4d28449dfba6e5d50cc6e1ef8"
})
App.mpType = 'app'
import store from './store/index.js'
const app = new Vue({
...App,
store
})
import httpInterceptor from '@/common/http.interceptor.js'
Vue.use(httpInterceptor, app)
import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)
app.$mount()
let main = plus.android.runtimeMainActivity()
//为了防止快速点按返回键导致程序退出重写quit方法改为隐藏至后台
plus.runtime.quit = function() {
main.moveTaskToBack(false)
};
//重写toast方法如果内容为 ‘再按一次退出应用’ 就隐藏应用,其他正常toast
plus.nativeUI.toast = (function(str) {
if (str == '再按一次退出应用') {
main.moveTaskToBack(false);
return false;
} else {
uni.showToast({
title: '再按一次退出MyHome',
icon: 'none',
})
}
});