Where should I write the authorization of Wechat on a single page of vue-cli?

the project has a requirement for Wechat web page authorization just to get the openid,. I want to finish it in the front end. When I read the document, the request for code will be redirected to a link, so it"s a bit unclear where the authorization is at the entrance of the route. Please give me some ideas. Thank you

.
Mar.18,2021

Authorization is fine when user information is needed. You can write a separate empty page specifically for user authorization login
when it is detected that user authorization is required, jump to the empty page:

vm.$router.replace({
      path: '/login',
      query: {
        redirect: encodeURIComponent(vm.$route.fullPath)
      }
    })

return to the original page after successful authorization:

this.$router.replace(decodeURIComponent(redirectUrl))
Menu