<template>
  <div class="" />
</template>

<script>
import config from "@/config"
export default {
  name:'login',
  async mounted () {
      const path = (this.$route.query || {}).path
      const source = 'http://stat.caixiao365.com/'
      // const local = "http://localhost:8081/"
      const redirect_url = encodeURIComponent(source + (path ? `#/${path}` : ''))
      var state = 'wx_' + Math.random().toString(36).substr(2, 15)
      const scope = 'snsapi_userinfo'
      const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.appId}&redirect_uri=${redirect_url}&response_type=code&scope=${scope}&state=${state}#wechat_redirect`
      window.location.href = url
  }
}
</script>
