<template>
  <sdLoading v-if="!isAlertShow" />
  <a-result v-else status="warning" :title="alertMessage" />
</template>

<script>
import sdLoading from '@/common/pages/sd-loading.vue'
import loginService from './login-service'
import components from './_import-components/sd-thirdparty-login-import'
import sdLogin from './sd-login.vue'
export default {
  name: 'SdThirdpartyLogin',

  components: {
    ...components,
    sdLoading,
  },
  mixins: [sdLogin],
  data() {
    return {
      isAlertShow: false,
      alertMessage: '单点失败',
    }
  },
  created() {
    loginService
      .ssoLogin(this.$route.query)
      .then((res) => {
        return this.loginSuccess()
      })
      .catch((e) => {
        this.isAlertShow = true
        this.alertMessage = e.message
      })
  },
  methods: {},
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
