study 2 週間 前
コミット
4040b32d5d
2 ファイル変更19 行追加14 行削除
  1. 15 11
      src/utils/request.js
  2. 4 3
      src/views/user/welcome.vue

+ 15 - 11
src/utils/request.js

@@ -45,22 +45,26 @@ const errorHandler = (error) => {
     if (error.response.status === 403) {
       notification.error({
         message: '提示',
-        description: data.errors
+        description: data.message
       })
-      if (token) {
+      // if (token) {
         store.dispatch('Logout').then(() => {
           setTimeout(() => {
-            window.location.reload()
+            if (router.currentRoute.path !== '/user/login') {
+                  router.replace({ path: '/user/login' }).catch(() => {
+                    // 静默处理导航错误
+                  })
+                }
           }, 1500)
         })
-      }else{
-         // 使用 replace 避免历史记录问题
-         if (router.currentRoute.path !== '/user/login') {
-          router.replace({ path: '/user/login' }).catch(() => {
-            // 静默处理导航错误
-          })
-        }
-      }
+      // }else{
+      //    // 使用 replace 避免历史记录问题
+      //    if (router.currentRoute.path !== '/user/login') {
+      //     router.replace({ path: '/user/login' }).catch(() => {
+      //       // 静默处理导航错误
+      //     })
+      //   }
+      // }
     }
   }
 

+ 4 - 3
src/views/user/welcome.vue

@@ -122,7 +122,7 @@
                 <li>云端更新的节点订阅</li>
                 <li>5台设备数量限制</li>
               </ul>
-              <a-button type="primary" size="large" class="plan-button">选择套餐</a-button>
+              <a-button type="primary" size="large" class="plan-button"><router-link :to="{ name: 'register' }">注册</router-link></a-button>
             </div>
             <div class="pricing-card featured">
               <div class="plan-name">Trojan Pro</div>
@@ -135,7 +135,7 @@
                 <li>云端更新的节点订阅</li>
                 <li>无设备数量限制</li>
               </ul>
-              <a-button type="primary" size="large" class="plan-button">选择套餐</a-button>
+              <a-button type="primary" size="large" class="plan-button"><router-link :to="{ name: 'register' }">注册</router-link></a-button>
             </div>
           </div>
         </div>
@@ -250,7 +250,8 @@ export default {
           description: '稳定高速的网络连接',
         },
         {
-          img: '07',
+          // img: '07',
+          img: '11',
           title: '高质量带宽',
           description: '优质带宽保障',
         },