Michael Wang 3 rokov pred
rodič
commit
b7cc4eec48
2 zmenil súbory, kde vykonal 11 pridanie a 1 odobranie
  1. 10 0
      src/App.vue
  2. 1 1
      src/features/Login/Login.vue

+ 10 - 0
src/App.vue

@@ -13,11 +13,21 @@
 <script lang="ts">
 import { defineComponent, ref, watch, watchEffect } from "vue";
 import { useMainStore } from "@/store";
+import { useTimers } from "./setups/useTimers";
+import { getToken } from "./auth/auth";
+import { httpApp } from "./plugins/axiosApp";
 
 export default defineComponent({
   name: "App",
 
   setup() {
+    const { addInterval } = useTimers();
+    addInterval(() => {
+      if (getToken()) {
+        httpApp.post("/api/ess/user/online/signal");
+      }
+    }, 10 * 1000);
+
     let spinning = $ref(false);
     const mainStore = useMainStore();
 

+ 1 - 1
src/features/Login/Login.vue

@@ -56,7 +56,7 @@ async function login() {
     const res = await loginByUsername({ accountValue, password, rootOrgId });
     console.log(res);
     store.setUserInfo(res.data);
-    router.push("/basic/rootOrg");
+    router.push("/project/projectManagement");
   } catch (error) {
     console.log(error);
     errorInfo = (<any>error).response.data.desc;