<template>
  <div></div>
</template>

<script>
  import {mapGetters} from "vuex";

  export default {
    name: "scada-sso",
    data() {
      return {
        loginForm: {
          token: null
        }
      };
    },
    created() {
    },
    mounted() {
      this.handleLogin();
    },
    computed: {
      ...mapGetters(["tagWel"])
    },
    props: [],
    methods: {
      handleLogin() {
        let token = this.$route.query.SSOToken;
        this.loginForm.token = token;
        this.$store.dispatch("loginByScada", this.loginForm).then(() => {
          this.$router.push({path: this.tagWel.value});
        }).catch(() => {
          this.$router.push({path: "/403"});
        });
      },
    }
  };
</script>

<style>
</style>
