<script>
import { mapActions } from 'vuex';

export default {
  async onLaunch() {
    await this.login();
    uni.getSetting({
      success(res) {
        if (!res.authSetting['scope.userLocation']) {
          uni.authorize({
            scope: 'scope.userLocation',
            success() {},
          });
        }
      },
    });
  },

  methods: {
    ...mapActions('user', ['login']),
  },
};
</script>

<style lang="scss">
@import 'colorui/main.scss';
@import 'colorui/icon.scss';
@import 'colorui/animation.scss';
@import 'common/style/global';
@import 'common/style/iconfont';
</style>
