my.vue 710 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view>
  3. <!-- 基本信息 -->
  4. <view class="top_bg"></view>
  5. <t-m-info></t-m-info>
  6. <!-- t-m-icon -->
  7. <t-m-icon></t-m-icon>
  8. <t-m-list></t-m-list>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. };
  16. },
  17. onLoad() {
  18. // 判断会否登录、没有则跳转至登录页
  19. const Authorization = uni.getStorageSync('Authorization')
  20. if (Authorization == '') {
  21. uni.showToast({
  22. icon: "none",
  23. title: "用户未登录"
  24. })
  25. setTimeout(function() {
  26. uni.redirectTo({
  27. url: "../../login/login"
  28. })
  29. }, 1000)
  30. }
  31. }
  32. }
  33. </script>
  34. <style lang="scss">
  35. .top_bg {
  36. height: 60px;
  37. background: #009FE8;
  38. }
  39. </style>