瀏覽代碼

Merge branch 'iteration-20240730-bug' into jenkins-test

lex 8 月之前
父節點
當前提交
aa14411d34
共有 2 個文件被更改,包括 24 次插入3 次删除
  1. 2 1
      src/views/co-ai/index.module.less
  2. 22 2
      src/views/layout/auth.tsx

+ 2 - 1
src/views/co-ai/index.module.less

@@ -384,6 +384,7 @@
     &.VIP {
       background: url('./image/icon-music-vip.png') no-repeat center;
       background-size: contain;
+      border-top-right-radius: 9px;;
     }
   }
 
@@ -599,4 +600,4 @@
       padding: 0;
     }
   }
-}
+}

+ 22 - 2
src/views/layout/auth.tsx

@@ -34,7 +34,7 @@ export default defineComponent({
     const setAuth = async () => {
       const { query } = route;
       const token = query.userInfo || query.Authorization;
-
+      console.log(query, 'query');
       if (token) {
         storage.set(ACCESS_TOKEN, token);
       }
@@ -60,7 +60,27 @@ export default defineComponent({
           ) {
             setLoginError();
           } else {
-            setLogout();
+            // 判断是否登录状态
+            if (query.platform) {
+              // 判断是否在应用中
+              if(window.parent && window.parent !== window) {
+                window.parent.postMessage(
+                  {
+                    api: 'onLogin'
+                  },
+                  '*'
+                );
+                setTimeout(() => {
+                  window.location.href = `${location.origin}/classroom`;
+                }, 500);
+              } else {
+                  window.location.href = `${location.origin}/classroom`;
+              }
+
+            } else {
+              setLogout();
+
+            }
           }
         }
         data.loading = false;