<script>
import { buildAuthorizeUrl } from '@/utils/oauth-utils'

export default {
  mounted() {
    this.handleAuthorize()
  },
  methods: {
    handleAuthorize() {
      const authUrl = buildAuthorizeUrl(
        'http://127.0.0.1:8080',
        'certificate-authority-client',
        'http://127.0.0.1:9529/callback',
        '',
        'openid profile certificate.read certificate.write'
      )
      console.log(authUrl)
      debugger
      // 跳转授权页面（可选）
      window.location.href = authUrl
    }
  }
}
</script>

<style scoped>

</style>
