<template>
  <sdLoading />
</template>

<script>
import sdLoading from '@/common/pages/sd-loading.vue'
import qs from 'qs'
import loginService from '@/login/login-service'
import components from './_import-components/sd-thirdparty-ssologin-import'

export default {
  name: 'SdThirdpartySsologin',
  metaInfo: {
    title: 'SdThirdpartySsologin',
  },
  components: {
    sdLoading,
    ...components,
  },
  data() {
    return {}
  },
  created() {
    const params = qs.stringify(this.$route.query)
    loginService.updateAccessToken().then(() => {
      location.replace(
        `${location.origin}${location.pathname}api/framework/v1/ssoinfo/viewThird/${
          this.$route.params?.thirdpartyCode
        }?access_token=${loginService.getTokens().access_token}${params ? '&' + params : ''}`
      )
    })
  },
}
</script>

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