Ver Fonte

修改登录问题

lex há 1 ano atrás
pai
commit
fc8d5370b0
1 ficheiros alterados com 7 adições e 1 exclusões
  1. 7 1
      src/page-instrument/App.tsx

+ 7 - 1
src/page-instrument/App.tsx

@@ -28,7 +28,13 @@ export default defineComponent({
             if (/(192|localhost)/.test(location.origin)) {
               return;
             }
-            window.location.href = `${location.origin}/classroom`;
+            // 判断是否在应用中
+            window.parent.postMessage(
+              {
+                api: "onLogin",
+              },
+              "*"
+            );
           }
           return;
         }