NotFound.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="not-found-container">
  3. <!-- Loading 动效 -->
  4. <div class="loading-container">
  5. <div class="loading-spinner">
  6. <div class="spinner-ring"></div>
  7. <div class="spinner-ring"></div>
  8. <div class="spinner-ring"></div>
  9. </div>
  10. <p class="loading-text">正在为您跳转到统一登录门户,请稍后...</p>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import { isLocal, isTest, isProd } from '@/utils/apiConfig'
  16. export default {
  17. name: 'NotFound',
  18. mounted() {
  19. const reason = this.$route.query.reason
  20. console.log('🚫 进入404页面,原因:', reason || '未知')
  21. console.log('🔧 当前环境:', { isLocal, isTest, isProd })
  22. // 本地/测试环境不跳转
  23. if (isLocal || isTest) {
  24. console.log('🔧 本地/测试环境:不跳转到登录门户')
  25. return
  26. }
  27. // 生产环境跳转到统一认证门户
  28. console.log('🔄 即将重定向到登录门户...')
  29. localStorage.removeItem('shudao_refresh_token')
  30. localStorage.removeItem('shudao_token_type')
  31. localStorage.removeItem('shudao_username')
  32. sessionStorage.removeItem('auth_debug_logs')
  33. setTimeout(() => {
  34. console.log('🚀 开始跳转到登录门户')
  35. window.location.href = 'https://tyrz.scgsdsj.com/iga/login_sd.html'
  36. }, 2000)
  37. }
  38. }
  39. </script>
  40. <style scoped>
  41. /* 容器样式 - 纯白色背景 */
  42. .not-found-container {
  43. min-height: 100vh;
  44. display: flex;
  45. flex-direction: column;
  46. align-items: center;
  47. justify-content: center;
  48. background: #FFFFFF;
  49. padding: 40px 20px;
  50. text-align: center;
  51. }
  52. /* Loading 容器 */
  53. .loading-container {
  54. display: flex;
  55. flex-direction: column;
  56. align-items: center;
  57. gap: 24px;
  58. animation: fadeIn 0.8s ease-out both;
  59. }
  60. @keyframes fadeIn {
  61. from {
  62. opacity: 0;
  63. transform: translateY(-20px);
  64. }
  65. to {
  66. opacity: 1;
  67. transform: translateY(0);
  68. }
  69. }
  70. /* Loading 文字 */
  71. .loading-text {
  72. font-size: 16px;
  73. color: #5dade2;
  74. font-weight: 500;
  75. margin: 0;
  76. letter-spacing: 0.5px;
  77. }
  78. /* Spinner 容器 */
  79. .loading-spinner {
  80. position: relative;
  81. width: 80px;
  82. height: 80px;
  83. }
  84. /* Spinner 圆环 */
  85. .spinner-ring {
  86. position: absolute;
  87. width: 100%;
  88. height: 100%;
  89. border: 4px solid transparent;
  90. border-radius: 50%;
  91. animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  92. }
  93. .spinner-ring:nth-child(1) {
  94. border-top-color: #5dade2;
  95. animation-delay: 0s;
  96. }
  97. .spinner-ring:nth-child(2) {
  98. border-right-color: #3498db;
  99. animation-delay: 0.15s;
  100. }
  101. .spinner-ring:nth-child(3) {
  102. border-bottom-color: #5dade2;
  103. animation-delay: 0.3s;
  104. opacity: 0.6;
  105. }
  106. @keyframes spin {
  107. 0% {
  108. transform: rotate(0deg) scale(1);
  109. }
  110. 50% {
  111. transform: rotate(180deg) scale(1.1);
  112. }
  113. 100% {
  114. transform: rotate(360deg) scale(1);
  115. }
  116. }
  117. /* 移动端适配 */
  118. @media (max-width: 768px) {
  119. .not-found-container {
  120. padding: 30px 16px;
  121. }
  122. .loading-spinner {
  123. width: 60px;
  124. height: 60px;
  125. }
  126. .loading-text {
  127. font-size: 14px;
  128. }
  129. }
  130. </style>