luohailiang 2 vuotta sitten
vanhempi
commit
343048b604
2 muutettua tiedostoa jossa 45 lisäystä ja 26 poistoa
  1. 27 23
      public/config.js
  2. 18 3
      src/components/CommonHeader/navbar.vue

+ 27 - 23
public/config.js

@@ -1,41 +1,45 @@
 // 本地开发环境
 const local = {
-  // web_pc: 'https://tyyx.bozedu.top/',
-  // web_mobile: 'https://tyyxm.bozedu.top/',
+    // web_pc: 'https://tyyx.bozedu.top/',
+    // web_mobile: 'https://tyyxm.bozedu.top/',
 
-  api: 'https://txwxopenapi.bozedu.top/',
-  oss: 'https://txwxopenapi.bozedu.top/',
-  uc: 'https://uc.dev.bozedu.net/',
-  origin: window.location.origin,
+    api: 'https://txwxopenapi.bozedu.top/',
+    oss: 'https://txwxopenapi.bozedu.top/',
+    uc: 'https://uc.dev.bozedu.net/',
+    origin: window.location.origin,
+    tyyx: 'https://tyyx.bozedu.top/#/home'
 }
 
 // 测试服环境
 const development = {
-  web_pc: 'https://txwx.bozedu.top/',
+    web_pc: 'https://txwx.bozedu.top/',
 
-  origin: window.location.origin,
-  api: 'https://txwxopenapi.bozedu.top/',
-  oss: 'https://txwxopenapi.bozedu.top/',
-  uc: 'https://uc.dev.bozedu.net/',
+    origin: window.location.origin,
+    api: 'https://txwxopenapi.bozedu.top/',
+    oss: 'https://txwxopenapi.bozedu.top/',
+    uc: 'https://uc.dev.bozedu.net/',
+    tyyx: 'https://tyyx.bozedu.top/#/home'
 }
 
 // // 正式服环境
 const production = {
-  web_pc: 'https://txwx.txhlwxx.com/',
+    web_pc: 'https://txwx.txhlwxx.com/',
 
-  origin: window.location.origin,
-  api: 'https://txwxopenapi.txhlwxx.com/',
-  oss: 'https://txwxopenapi.txhlwxx.com/',
-  uc: 'https://uc.bozedu.net/',
+    origin: window.location.origin,
+    api: 'https://txwxopenapi.txhlwxx.com/',
+    oss: 'https://txwxopenapi.txhlwxx.com/',
+    uc: 'https://uc.bozedu.net/',
+    tyyx:'https://tyyx.txhlwxx.com/#/home'
 }
 
 function isWhich() {
-  if (window.location.href.startsWith(development.web_pc)) {
-    return development
-  } else if (window.location.href.startsWith(production.web_pc)) {
-    return production
-  } else {
-    return local
-  }
+    if (window.location.href.startsWith(development.web_pc)) {
+        return development
+    } else if (window.location.href.startsWith(production.web_pc)) {
+        return production
+    } else {
+        return local
+    }
 }
+
 window.GLOBAL_CONFIG = isWhich()

+ 18 - 3
src/components/CommonHeader/navbar.vue

@@ -1,9 +1,23 @@
 <script setup lang='ts'>
+import ha from "../../../../myxjyszptxweb/assets/index.82b38ca9";
+
 const router = useRouter();
-function routerPush(path: string) {
-  router.push(path);
+const LoginFormRef = $ref();
+function handleLogin() {
+    console.log("handleLogin", LoginFormRef);
+    LoginFormRef.open();
 }
+function routerPush(path: string) {
+    if (sessionStorage.getItem("userInfo")) {
+        router.push(path);
+    } else {
+        handleLogin();
+    }
 
+}
+function toTyyx() {
+    location.href = window.GLOBAL_CONFIG.tyyx;
+}
 </script>
 
 <template>
@@ -79,9 +93,10 @@ function routerPush(path: string) {
       家庭教育
     </div>
     <div
-      class="px-4 py-5 hover:text-hex-1259A1 hover:bg-hex-1259A110 cursor-pointer"
+      class="px-4 py-5 hover:text-hex-1259A1 hover:bg-hex-1259A110 cursor-pointer" @click="toTyyx"
     >
       桐艺云校
     </div>
   </div>
+    <LoginForm ref="LoginFormRef" />
 </template>