index.vue 690 B

1234567891011121314151617181920212223242526272829
  1. <!--
  2. * @Author: LiZhiWei
  3. * @Date: 2026-01-09 15:47:55
  4. * @LastEditors: LiZhiWei
  5. * @LastEditTime: 2026-01-09 17:36:09
  6. * @Description:
  7. -->
  8. <template>
  9. <div><NuxtWelcome></NuxtWelcome></div>
  10. </template>
  11. <script setup lang="ts">
  12. import { checkStatus } from '~/utils/fetch/checkStatus'
  13. const showSuccessMessage = () => {
  14. ElMessage.success('这是一条 Element Plus 的成功提示')
  15. }
  16. const triggerHttpError = () => {
  17. // 模拟 HTTP 401 错误
  18. checkStatus(401, '登录已过期,请重新登录')
  19. }
  20. const triggerServerError = () => {
  21. // 模拟 HTTP 500 错误
  22. checkStatus(500, '内部服务器错误')
  23. }
  24. </script>
  25. <style scoped lang="scss"></style>