index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div class="loginBox">
  3. <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="iframe" frameborder="0"></iframe>
  4. <!-- <button @click="handleLogin">登录</button> -->
  5. </div>
  6. </template>
  7. <script>
  8. // import { mapActions } from 'vuex'
  9. import { mapGetters } from 'vuex'
  10. export default {
  11. data() {
  12. return {
  13. redirect: undefined,
  14. timer: null,
  15. iframe: 'https://cloud.cocorobo.cn/aigpt/'
  16. }
  17. },
  18. computed: {
  19. ...mapGetters(['userinfo'])
  20. },
  21. watch: {
  22. $route: {
  23. handler: function(route) {
  24. this.redirect = route.query && route.query.redirect
  25. },
  26. immediate: true
  27. }
  28. },
  29. methods: {
  30. // ...mapActions({
  31. // login: 'user/login'
  32. // }),
  33. // handleLogin() {
  34. // this.$router.push({ path: this.redirect || '/' })
  35. // },
  36. // async getLogin() {
  37. // const userid = await this.login()
  38. // if (userid) {
  39. // this.$router.push({ path: this.redirect || '/' })
  40. // }
  41. // // eduGet().then(res => {})
  42. // }
  43. },
  44. beforeDestroy() {
  45. clearInterval(this.timer)
  46. this.timer = null
  47. },
  48. mounted() {
  49. // this.getLogin()
  50. // this.timer = setInterval(() => {
  51. // this.getLogin()
  52. // }, 2000)
  53. this.iframe = `https://cloud.cocorobo.cn/aigpt/?userid=${this.userinfo.userid}&oid=${this.userinfo.organizeid}&org=${this.userinfo.org}&role=${this.userinfo.role}`
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .loginBox {
  59. position: relative;
  60. width: 100vw;
  61. height: 100vh;
  62. overflow: hidden;
  63. > iframe {
  64. width: 100%;
  65. height: 100%;
  66. border: 0;
  67. }
  68. }
  69. </style>