loading.vue
690 字节
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
<template>
<view></view>
</template>
<script>
import store from '@/shopro/store';
import { mapMutations, mapActions, mapState } from 'vuex';
export default {
data() {
return {};
},
async onLoad(options) {
// #ifdef H5
// 检测H5登录回调
if (options?.token) {
let that = this;
uni.showLoading({
title: '登录中...'
});
await that.getUserInfo(options.token);
let lastPage = uni.getStorageSync('lastPage');
if (lastPage) {
uni.removeStorageSync('lastPage');
window.location = lastPage;
} else {
uni.switchTab({
url: '/'
});
}
}
// #endif
},
methods: {
...mapActions(['getUserInfo'])
}
};
</script>
<style></style>