jichoi / lms_front star
박민혁 박민혁 2024-08-23
240823 박민혁 대시 보드 들어가면 학생 아이디 가져올 수 있도록
@a6f905d3bc4ac584372ee0205dc20b1ea1f9dffe
client/views/pages/main/Dashboard.vue
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
@@ -271,8 +271,6 @@
             titleBookName: "",
 
             images: [],
-            unit_id: "",
-            book_id: "",
 
             selectedImage: [
                 {
@@ -333,6 +331,8 @@
             if (this.$route.query.reCapture == "true") {
                 this.openCameraModal();
             }
+
+            this.searchStdId();
         },
 
         //은진
@@ -764,6 +764,29 @@
         closeBtn() {
             this.searchOpen = false;
         },
+
+        // 유저 아이디를 unit 아이디를 통해 가져오기
+        searchStdId() {
+            const userInfo = this.$store.getters.getUserInfo;
+            axios({
+                url: "/userclass/searchStdId.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    userId: userInfo.userId,
+                    unitId: this.unit_id,
+                },
+            })
+                .then((response) => {
+                    this.$store.commit('setStdId', response.data);
+                })
+                .catch((err) => {
+                    console.log("지문 에러 : ", err);
+                });
+        },
+
     },
     components: {
         SvgIcon,
Add a comment
List