-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathApp.vue
55 lines (50 loc) · 1012 Bytes
/
App.vue
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
50
51
52
53
54
55
<script>
import tui from 'common/httpRequest.js'
export default {
onLaunch: function() {
let that = this;
uni.getProvider({
service: 'oauth',
success(res) {
if (res.provider && res.provider.length) {
tui.login();
} else {
// H5
uni.setStorage({
key: 'is_online',
data: true
});
tui.is_online = true
if (!tui.getToken()) {
uni.navigateTo({
url: '/pages/login/h5'
});
} else {
tui.initLaravelEcho(tui.getToken());
}
}
},
fail(res) {
console.log(res);
},
});
},
onShow: function() {
},
onHide: function() {
//console.log('App Hide')
},
onError: function(err) {
//全局错误监听
},
methods: {
}
};
</script>
<style>
/*每个页面公共css uParse为优化版本*/
@import './common/app.css';
/* #ifndef APP-NVUE */
@import './components/uni/uParse/src/wxParse.css';
/* #endif */
</style>