You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shengxian/pages/public/loading.vue

40 lines
690 B

2 years ago
<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>