adminHeader.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div class="admin_header ">
  3. <div class="img_text_middle">
  4. <el-button @click="goBack()">返回人工智能专栏</el-button>
  5. <img :src="userImg" alt="">
  6. <span>{{ userName }}</span>
  7. </div>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { ref, watchEffect } from 'vue';
  12. import userImg from '@/assets/img/user.png'
  13. import { userInfoStore } from '@/stores/counter'
  14. // U.MD.D.I.openInApplication('teacher') 教师管理
  15. const user = userInfoStore()
  16. const userName = ref('userName')
  17. const goBack = () => {
  18. top.location.href = "https://zy.szedu.cn/ai/"
  19. }
  20. watchEffect(() => {
  21. if (JSON.stringify(user.user) != "{}") {
  22. userName.value = user.user.userName
  23. }
  24. })
  25. </script>
  26. <style lang="scss" scoped>
  27. .admin_header {
  28. width: 100%;
  29. padding: 12px 36px;
  30. height: 60px;
  31. .img_text_middle {
  32. float: right;
  33. img{
  34. margin: 0 8px 0 30px;
  35. }
  36. }
  37. .el-button {
  38. background: rgba(54, 129, 252, 1);
  39. color: #fff;
  40. }
  41. }
  42. </style>