wechatLogin.vue 954 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view>
  3. </view>
  4. </template>
  5. <script>
  6. export default {
  7. data() {
  8. return {
  9. }
  10. },
  11. onLoad({print, url, sharecode, is_channel}){
  12. let redirect = '/h5/#/pages/index/redirect'
  13. if(url){
  14. redirect = url
  15. }
  16. redirect = `${redirect}?sharecode=${sharecode || ''}&is_channel=${is_channel || ''}`
  17. this.$api.getWechatLoginUrl({
  18. redirect: redirect
  19. }).then(res=>{
  20. if(print){
  21. console.log(redirect)
  22. console.log(res)
  23. return
  24. }
  25. if (res.code === 1) {
  26. location.href = res.data.url
  27. }
  28. })
  29. // location.href = `http://dzxvkt.top/index/wechat/bootToUrl?url=aHR0cDovL21oLmg1bWhzYy5jbi9oNS8jL3BhZ2VzL2xvZ2luL2JpbmRQaG9uZT9zaGFyZWNvZGU9JmFtcDtpc19jaGFubmVsPQ==`
  30. // location.href = `http://dzxvkt.top//index/wechat/bootToUrl?url=aHR0cDovL21oLmg1bWhzYy5jbi9oNS8jL3BhZ2VzL2xvZ2luL2JpbmRQaG9uZT9zaGFyZWNvZGU9JmFtcDtpc19jaGFubmVsPQ==`
  31. },
  32. methods: {
  33. }
  34. }
  35. </script>
  36. <style>
  37. </style>