my.vue 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view>
  3. <!-- 用户未登录时,显示登录组件 -->
  4. <my-login v-if="!token && token === ''"></my-login>
  5. <!-- 用户登录后,显示用户信息组件 -->
  6. <my-userinfo v-else></my-userinfo>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapState, mapMutations } from 'vuex'
  11. export default {
  12. computed: {
  13. ...mapState('m_user', ['token'])
  14. },
  15. data() {
  16. return {
  17. };
  18. },
  19. onReady() {
  20. this.findVerifyStatus()
  21. },
  22. onHide() {
  23. this.findVerifyStatus()
  24. },
  25. methods: {
  26. ...mapMutations('m_user', ['updateAuthentication']),
  27. // 查询是否通过了老师认证
  28. async findVerifyStatus() {
  29. const { data: result } = await uni.$http.get('/education/teacher-certifications/findVerifyStatus')
  30. const message = result.message
  31. // console.log("fff")
  32. this.updateAuthentication(message)
  33. },
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. </style>