瀏覽代碼

update 优化 三方授权页面 延迟跳转避免无法查看错误信息

疯狂的狮子Li 1 年之前
父節點
當前提交
75e72bf974
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/layout/components/SocialCallback/index.vue

+ 6 - 2
src/layout/components/SocialCallback/index.vue

@@ -31,12 +31,16 @@ const processResponse = async (res: any) => {
     setToken(res.data.access_token);
   }
   ElMessage.success(res.msg);
-  location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
+  setTimeout(() => {
+    location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
+  }, 2000);
 };
 
 const handleError = (error: any) => {
   ElMessage.error(error.message);
-  location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
+  setTimeout(() => {
+    location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
+  }, 2000);
 };
 
 const callbackByCode = async (data: LoginData) => {