123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <view>
- </view>
- </template>
- <script>
- import {
- mapGetters
- } from "vuex";
- import {
- toLogin
- } from '@/libs/login.js';
- export default {
- data() {
- return {
- userInfo: {}
- }
- },
- computed: mapGetters(['isLogin']),
- onLoad() {
- if (this.isLogin) {
- this.getUserInfo();
- }else{
- toLogin();
- }
- },
- methods: {
- getUserInfo: function() {
- let that = this;
- getUserInfo().then(res => {
- that.userInfo = res.data;
- that.$store.commit("SETUID", res.data.uid);
- });
- }
- }
- }
- </script>
- <style lang="scss">
-
- </style>
|