jichoi / lms_front star
구자현 구자현 2024-08-26
240826 구자현 마이페이지 이름 수정
@09b2a6a4bef69f9f0910e7e52f2fc8e1e68c27ac
client/views/pages/main/MyPage.vue
--- client/views/pages/main/MyPage.vue
+++ client/views/pages/main/MyPage.vue
@@ -49,7 +49,7 @@
             </div>
         </div>
         <div class="title-box flex justify-between mb20">
-            <p class="title">가나다학생 랭킹</p>
+            <p class="title">{{ studentInfo.studentName }} 학생 랭킹</p>
         </div>
         <div class=" mb30">
             <div class=" flex " style="gap: 50px;">
@@ -113,7 +113,15 @@
             mdiMagnify: mdiMagnify,
             mdilArrowRight: mdilArrowRight,
             timer: "00:00",
-            progress: 20
+            progress: 20,
+            studentInfo: {
+                studentName: "",
+                institutionName: "",
+                grade: "",
+                className: "",
+                studentQuestion: "",
+                history: [],
+            },
         }
     },
     methods: {
@@ -138,7 +146,26 @@
                     alert("반 학생 수 조회에 오류가 발생했습니다.");
                 });
         },
-
+        fetchStudentInfo() {
+            const vm = this;
+            axios({
+                url: "/studentInfo/getInfo.json",
+                method: "post",
+                headers: {
+                    "Content-Type": "application/json; charset=UTF-8",
+                },
+                data: {
+                    userId: "USID_000000000000002" // 로그인한 학생의 userId
+                }
+            })
+                .then((response) => {
+                console.log(response.data);
+                this.studentInfo = response.data;
+                })
+                .catch((error) => {
+                console.error("학생 정보 가져오기 실패:", error);
+                });
+        },
         photoRankByLikeData: function () {
             const vm = this;
             axios({
@@ -260,6 +287,7 @@
     },
     mounted() {
         console.log('Main2 mounted');
+        this.fetchStudentInfo();
         this.classStdCount();
         this.photoRankByLikeData();
         this.getUserRankByScore();
Add a comment
List