Michael Wang 3 lat temu
rodzic
commit
132adbb225
2 zmienionych plików z 6 dodań i 3 usunięć
  1. 1 1
      src/api/loginPage.ts
  2. 5 2
      src/features/login/Login.vue

+ 1 - 1
src/api/loginPage.ts

@@ -5,7 +5,7 @@ import { httpApp } from "@/plugins/axiosApp";
 export function loginByUsername(loginInfo: {
   accountValue: string;
   password: string;
-  rootOrgId: string;
+  rootOrgId: number;
 }) {
   return httpApp.post("/api/ess/auth/login", loginInfo, {
     noErrorMessage: true,

+ 5 - 2
src/features/login/Login.vue

@@ -34,7 +34,6 @@
 
 <script setup lang="ts">
 import { loginByUsername } from "@/api/loginPage";
-import { ref } from "vue";
 import { useRouteQuery } from "@vueuse/router";
 import { useRouter } from "vue-router";
 import { useMainStore } from "@/store";
@@ -52,7 +51,11 @@ let errorInfo = $ref("");
 
 async function login() {
   try {
-    const res = await loginByUsername({ accountValue, password, rootOrgId });
+    const res = await loginByUsername({
+      accountValue,
+      password,
+      rootOrgId: parseInt(rootOrgId?.toString() ?? "1"),
+    });
     console.log(res);
     store.setUserInfo(res.data);
     router.push("/project/projectManagement");