jichoi / lms_front star
박민혁 박민혁 08-28
240828 박민혁 대시보드 및 로그인 수정
@910e7b2ad7a8cded969c2114dba6e714c406e048
client/views/Login.vue
--- client/views/Login.vue
+++ client/views/Login.vue
@@ -187,10 +187,7 @@
          }).then(function (response) {
 
             const token = response.headers.get('Authorization');
-            const Refreshtoken = response.headers.get('RefreshToken');
-
             store.dispatch('login', token);
-            localStorage.setItem("Refreshtoken", Refreshtoken);
 
             vm.branchPage();
          }).catch(function (error) {
@@ -231,13 +228,13 @@
 
                // 역할에 따라 페이지 이동
                if (roles.includes("STUDENT")) {
-                  vm.goToPage('Dashboard');
+                  vm.goToPage('MyPlan');
                } else if (roles.includes("TEACHER")) {
                   vm.goToPage('Board');
                } else if (roles.includes("PARENT")) {
                   vm.goToPage('Main_p');
                } else if (roles.includes("ADMIN")) {
-                  vm.goToPage('Dashboard');
+                  vm.goToPage('MyPlan');
                }
             } else {
                console.error('Invalid token structure');
client/views/pages/AppRouter.js
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
@@ -423,4 +423,52 @@
     routes,
 });
 
+AppRouter.beforeEach((to, from, next) => {
+    const token = localStorage.getItem('token');
+
+    if (!token && (to.name !== 'login' && to.name !== 'Join')) {
+        // 토큰이 없고 로그인 페이지가 아닐 경우 로그인 페이지로 리다이렉트
+        next({ name: 'login' });
+    } else if (token) {
+        // 토큰이 있을 경우 역할에 따른 접근 제어
+        const tokenParts = token.split('.');
+        const payload = tokenParts[1];
+
+        const base64 = payload.replace(/-/g, '+').replace(/_/g, '/');
+
+        const jsonPayload = decodeURIComponent(
+            Array.prototype.map.call(atob(base64), c => {
+                return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
+            }).join('')
+        );
+
+        const userInfo = JSON.parse(jsonPayload);
+        const teacherRoutes = routes[35].children.map(route => route.path);
+
+        if (userInfo.author[0].authority === 'STUDENT') {
+            if (teacherRoutes.includes(to.path) || to.name === 'Main_p') {
+                next({ name: 'MyPlan' }); 
+            } else {
+                next(); // 다른 페이지로 접근 허용
+            }
+        } else if (userInfo.author[0].authority === 'TEACHER') {
+            if (!teacherRoutes.includes(to.path)) {
+                next({ name: 'Home' }); 
+            } else {
+                next();
+            }
+        } else if (userInfo.author[0].authority === 'PARENT') {
+            if (to.name !== 'Main_p') {
+                next({ name: 'Main_p' });
+            } else {
+                next(); 
+            }
+        } else {
+            next(); 
+        }
+    } else {
+        next(); 
+    }
+});
+
 export default AppRouter;
client/views/pages/main/Dashboard.vue
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
@@ -16,78 +16,40 @@
       </div>
       <div class="race-box">
         <div class="rabbit-start">
-          <img
-            src="../../../resources/img/img09_s.png"
-            alt=""
-            :style="{ display: rabbitPos[0] ? 'block' : 'none' }"
-          />
+          <img src="../../../resources/img/img09_s.png" alt="" :style="{ display: rabbitPos[0] ? 'block' : 'none' }" />
         </div>
         <div class="rcon flex justify-end mb5">
           <div class="race-btn" @click="[storeLearningId(labeledItems[0])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[1] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[1] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="1"
-            >
-              <img
-                :src="
-                  labeledItems[0].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[0].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[1] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="1">
+              <img :src="labeledItems[0].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[1] ? 'block' : 'none' }" />
+              <img :src="labeledItems[0].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[1] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[0].label }}</p>
           </div>
           <div class="race-btn" @click="[storeLearningId(labeledItems[1])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[2] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[2] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="2"
-            >
-              <img
-                :src="
-                  labeledItems[1].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[1].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[2] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="2">
+              <img :src="labeledItems[1].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[2] ? 'block' : 'none' }" />
+              <img :src="labeledItems[1].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[2] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[1].label }}</p>
           </div>
@@ -95,350 +57,173 @@
         <div class="lcon flex justify-between mb5">
           <div class="race-btn" @click="[storeLearningId(labeledItems[6])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[7] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[7] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="7"
-            >
-              <img
-                :src="
-                  labeledItems[6].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[6].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[7] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="7">
+              <img :src="labeledItems[6].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[7] ? 'block' : 'none' }" />
+              <img :src="labeledItems[6].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[7] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[6].label }}</p>
           </div>
-          <div
-            class="race-btn"
-            @click="[storeLearningId(labeledItems[5]),]"
-          >
+          <div class="race-btn" @click="[storeLearningId(labeledItems[5]),]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[6] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[6] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="6"
-            >
-              <img
-                :src="
-                  labeledItems[5].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[5].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[6] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="6">
+              <img :src="labeledItems[5].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[6] ? 'block' : 'none' }" />
+              <img :src="labeledItems[5].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[6] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[5].label }}</p>
           </div>
           <div class="race-btn" @click="[storeLearningId(labeledItems[4])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[5] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[5] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="5"
-            >
-              <img
-                :src="
-                  labeledItems[4].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[4].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[5] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="5">
+              <img :src="labeledItems[4].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[5] ? 'block' : 'none' }" />
+              <img :src="labeledItems[4].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[5] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[4].label }}</p>
           </div>
           <div class="race-btn" @click="[storeLearningId(labeledItems[3])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[4] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[4] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="4"
-            >
-              <img
-                :src="
-                  labeledItems[3].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[3].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[4] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="4">
+              <img :src="labeledItems[3].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[4] ? 'block' : 'none' }" />
+              <img :src="labeledItems[3].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[4] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[3].label }}</p>
           </div>
           <div class="race-btn" @click="[storeLearningId(labeledItems[2])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[3] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[3] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="3"
-            >
-              <img
-                :src="
-                  labeledItems[2].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[2].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[3] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="3">
+              <img :src="labeledItems[2].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[3] ? 'block' : 'none' }" />
+              <img :src="labeledItems[2].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[3] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[2].label }}</p>
           </div>
         </div>
         <div class="rcon flex">
-          <div
-            class="race-btn"
-            @click="
-              [
-                goToPage('Chapter8'),
-                storeLearningId(labeledItems[7].learning_id),
-              ]
-            "
-          >
+          <div class="race-btn" @click="
+            [storeLearningId(labeledItems[7]),]
+            ">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[8] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[8] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="8"
-            >
-              <img
-                :src="
-                  labeledItems[7].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[7].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[8] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="8">
+              <img :src="labeledItems[7].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[8] ? 'block' : 'none' }" />
+              <img :src="labeledItems[7].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[8] ? 'block' : 'none' }" />
             </button>
             <p class="long">{{ labeledItems[7].label }}</p>
           </div>
           <div class="race-btn" @click="[storeLearningId(labeledItems[8])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[9] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[9] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="9"
-            >
-              <img
-                :src="
-                  labeledItems[8].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[8].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[9] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)" data-num="9">
+              <img :src="labeledItems[8].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[9] ? 'block' : 'none' }" />
+              <img :src="labeledItems[8].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[9] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[8].label }}</p>
           </div>
-          <div
-            class="race-btn"
-            @click="[storeLearningId(labeledItems[9])]"
-          >
+          <div class="race-btn" @click="[storeLearningId(labeledItems[9])]">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[10] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[10] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImage(index)"
-              data-num="10"
-            >
-              <img
-                :src="
-                  labeledItems[9].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[9].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[10] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index" @click="toggleImage(index)"
+              data-num="10">
+              <img :src="labeledItems[9].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[10] ? 'block' : 'none' }" />
+              <img :src="labeledItems[9].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[10] ? 'block' : 'none' }" />
             </button>
             <p>{{ labeledItems[9].label }}</p>
           </div>
 
-          <div
-            class="race-btn"
-            @click="
-              [
-                goToPage('Chapter2_8'),
-                storeLearningId(labeledItems[10].learning_id),
-              ]
-            "
-          >
+          <div class="race-btn" @click="
+            [storeLearningId(labeledItems[10]),]
+            ">
             <div class="rabbit-running">
-              <img
-                src="../../../resources/img/img09_s.png"
-                alt=""
-                :style="{ display: rabbitPos[11] ? 'block' : 'none' }"
-              />
+              <img src="../../../resources/img/img09_s.png" alt=""
+                :style="{ display: rabbitPos[11] ? 'block' : 'none' }" />
             </div>
-            <button
-              class="popTxt"
-              v-for="(item, index) in items"
-              :key="index"
-              @click="toggleImageAndShowPopup(index, '11')"
-              data-num="11"
-            >
-              <img
-                :src="
-                  labeledItems[10].label.length >= 4
-                    ? item.imgSrc3
-                    : item.imgSrc1
-                "
-                :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }"
-              />
-              <img
-                :src="
-                  labeledItems[10].label.length >= 4
-                    ? item.imgSrc4
-                    : item.imgSrc2
-                "
-                :style="{ display: rabbitCompl[11] ? 'block' : 'none' }"
-              />
+            <button class="popTxt" v-for="(item, index) in items" :key="index"
+              @click="toggleImageAndShowPopup(index, '11')" data-num="11">
+              <img :src="labeledItems[10].label.length >= 4
+                  ? item.imgSrc3
+                  : item.imgSrc1
+                " :style="{ display: !rabbitCompl[11] ? 'block' : 'none' }" />
+              <img :src="labeledItems[10].label.length >= 4
+                  ? item.imgSrc4
+                  : item.imgSrc2
+                " :style="{ display: rabbitCompl[11] ? 'block' : 'none' }" />
             </button>
             <p class="long">{{ labeledItems[10].label }}</p>
           </div>
         </div>
         <div class="race-btn">
           <div class="rabbit-running" style="display: flex">
-            <img
-              class="rabbit-end"
-              src="../../../resources/img/img138_72s.png"
-              alt=""
-              :style="{ display: rabbitEnd ? 'block' : 'none' }"
-            />
-            <img
-              class="fireworks-end"
-              src="../../../resources/img/fireworks.gif"
-              alt=""
-              :style="{ display: rabbitEnd ? 'block' : 'none' }"
-            />
+            <img class="rabbit-end" src="../../../resources/img/img138_72s.png" alt=""
+              :style="{ display: rabbitEnd ? 'block' : 'none' }" />
+            <img class="fireworks-end" src="../../../resources/img/fireworks.gif" alt=""
+              :style="{ display: rabbitEnd ? 'block' : 'none' }" />
           </div>
         </div>
       </div>
@@ -446,17 +231,9 @@
       <!-- 팝업 -->
       <div v-show="searchOpen2" class="popup-wrap">
         <div class="popup-box">
-          <button
-            type="button"
-            class="popup-close-btn"
-            style="position: absolute; top: 10px; right: 10px"
-            @click="closeModal"
-          >
-            <svg-icon
-              type="mdi"
-              :path="mdiWindowClose"
-              class="close-btn"
-            ></svg-icon>
+          <button type="button" class="popup-close-btn" style="position: absolute; top: 10px; right: 10px"
+            @click="closeModal">
+            <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
           </button>
 
           <div class="mb30 text-ct">
@@ -466,12 +243,7 @@
             </p>
           </div>
           <div class="flex justify-center">
-            <button
-              type="button"
-              title="사진촬영"
-              class="new-btn"
-              @click="openCameraModal"
-            >
+            <button type="button" title="사진촬영" class="new-btn" @click="openCameraModal">
               사진 촬영
             </button>
           </div>
@@ -483,29 +255,15 @@
           <div class="flex mb10 justify-between">
             <p class="popup-title">사진 촬영</p>
             <button type="button" class="popup-close-btn" @click="closeModal">
-              <svg-icon
-                type="mdi"
-                :path="mdiWindowClose"
-                class="close-btn"
-              ></svg-icon>
+              <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
             </button>
           </div>
           <div class="box">
             <div style="width: 100%">
               <div id="container" ref="container">
-                <video
-                  v-if="!photoTaken"
-                  autoplay="true"
-                  ref="modalVideoElement"
-                  class="mirrored"
-                  @canplay="onVideoLoaded"
-                  style="position: absolute; height: 100%"
-                ></video>
-                <img
-                  src="../../../resources/img/camera-rabbit.png"
-                  class="camera-rabbit"
-                  style="position: absolute"
-                />
+                <video v-if="!photoTaken" autoplay="true" ref="modalVideoElement" class="mirrored"
+                  @canplay="onVideoLoaded" style="position: absolute; height: 100%"></video>
+                <img src="../../../resources/img/camera-rabbit.png" class="camera-rabbit" style="position: absolute" />
                 <canvas ref="canvas" style="pointer-events: none"></canvas>
               </div>
             </div>
@@ -518,17 +276,8 @@
     </div>
 
     <div class="complete-wrap myphoto">
-      <button
-        class="login-btn mt10"
-        type="submit"
-        style="width: 100%"
-        @click="finishSchedule"
-      >
-        <img
-          src="../../../resources/img/btn07_s.png"
-          alt=""
-          style="width: 100%; height: 100px"
-        />
+      <button class="login-btn mt10" type="submit" style="width: 100%" @click="finishSchedule">
+        <img src="../../../resources/img/btn07_s.png" alt="" style="width: 100%; height: 100px" />
         <p>학습 종료하기</p>
       </button>
       <h2 class="mb40 mt10">이 단원을 끝낸 친구들</h2>
@@ -536,19 +285,9 @@
       <article class="flex-column">
         <div class="flex-row">
           <div class="flex" style="gap: 5px; flex-wrap: wrap">
-            <div
-              v-for="(image, index) in images"
-              :key="image.fileId"
-              @click="buttonSearch(image)"
-              class="photo"
-              style="margin-bottom: 5px"
-            >
-              <img
-                :src="image.url"
-                :alt="image.fileNm"
-                reloadable="true"
-                style="height: 100%"
-              />
+            <div v-for="(image, index) in images" :key="image.fileId" @click="buttonSearch(image)" class="photo"
+              style="margin-bottom: 5px">
+              <img :src="image.url" :alt="image.fileNm" reloadable="true" style="height: 100%" />
             </div>
           </div>
         </div>
@@ -557,51 +296,27 @@
         <div class="popup-box" style="top: 50%">
           <div class="flex mb10 justify-between">
             <button type="button" class="popup-close-btn" @click="closeModal">
-              <svg-icon
-                type="mdi"
-                :path="mdiWindowClose"
-                class="close-btn"
-              ></svg-icon>
+              <svg-icon type="mdi" :path="mdiWindowClose" class="close-btn"></svg-icon>
             </button>
           </div>
           <div class="box">
             <div style="width: 910px; height: 680px">
-              <img
-                :src="selectedImage.image"
-                alt="Image"
-                @error="onImageError"
-                reloadable="true"
-              />
+              <img :src="selectedImage.image" alt="Image" @error="onImageError" reloadable="true" />
             </div>
           </div>
           <div class="flex justify-between mt20">
             <div class="text flex">
               <p class="title2 date ml30">{{ selectedImage.date }}</p>
-              <span class="title1 ml30"
-                >{{ selectedImage.unit }}을 마친
-                <em class="yellow">{{ selectedImage.name }}</em
-                >친구</span
-              >
+              <span class="title1 ml30">{{ selectedImage.unit }}을 마친
+                <em class="yellow">{{ selectedImage.name }}</em>친구</span>
             </div>
             <div class="title2 flex align-center" style="gap: 10px">
-              <svg-icon
-                v-if="!isHeartFilled"
-                type="mdi"
-                :path="mdiHeartOutline"
-                @click="
-                  toggleHeart(selectedImage.heart, selectedImage.fileMngId)
-                "
-                style="color: #ffba08; cursor: pointer"
-              ></svg-icon>
-              <svg-icon
-                v-if="isHeartFilled"
-                type="mdi"
-                :path="mdiHeart"
-                @click="
-                  toggleHeart(selectedImage.heart, selectedImage.fileMngId)
-                "
-                style="color: #ffba08; cursor: pointer"
-              ></svg-icon>
+              <svg-icon v-if="!isHeartFilled" type="mdi" :path="mdiHeartOutline" @click="
+                toggleHeart(selectedImage.heart, selectedImage.fileMngId)
+                " style="color: #ffba08; cursor: pointer"></svg-icon>
+              <svg-icon v-if="isHeartFilled" type="mdi" :path="mdiHeart" @click="
+                toggleHeart(selectedImage.heart, selectedImage.fileMngId)
+                " style="color: #ffba08; cursor: pointer"></svg-icon>
               <p>
                 <em class="yellow">{{ selectedImage.heart }}</em>
               </p>
@@ -660,7 +375,7 @@
       schedules: [],
       nowSchedule: "",
       state: "",
-      rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+      rabbitPos: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       rabbitCompl: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
       rabbitEnd: false,
 
@@ -930,6 +645,7 @@
             this.titleUnitName = this.roadmapData[0].unit_nm;
             this.titleBookName = this.roadmapData[0].book_nm;
             this.labeledItems = this.processedRoadmap;
+            console.log(this.roadmapData, this.labeledItems)
           } else {
             this.state = "noProblem";
           }
@@ -961,12 +677,14 @@
         this.goToPage(this.problemType);
       } else if (labeledItems.label.startsWith("단어장")) {
         this.handleWordBookContent(this.$store.getters.getLearningId);
-      }
-
-      if (labeledItems.label.startsWith("지문")) {
+      } else if (labeledItems.label.startsWith("지문")) {
         //console.log("지문 아이디 : ", labeledItems.learning_id);
         this.$store.dispatch("updateTextId", labeledItems.learning_id);
         this.fetchTextType(labeledItems.learning_id);
+      } else if (labeledItems.label.startsWith("중간평가")) {
+        this.fetchEvalData(labeledItems);
+      } else if (labeledItems.label.startsWith("최종평가")) {
+        this.fetchEvalData(labeledItems);
       }
     },
     handleWordBookContent(item) {
@@ -1060,7 +778,39 @@
           console.log("지문 에러 : ", err);
         });
     },
+
+    // 평가 정보를 통해서 관련 문제 가져오기
+    fetchEvalData(evaldata) {
+      axios({
+        url: "/evalProblem/selectEvalProblem.json",
+        method: "post",
+        headers: {
+          "Content-Type": "application/json; charset=UTF-8",
+        },
+        data: {
+          evalId: evaldata.learning_id
+        },
+      })
+        .then(response => {
+          const payload = {
+            learning_id: response.data,
+            label: evaldata.label,
+            seqNum: evaldata.seqNum
+          };
+
+          // Vuex 뮤테이션 호출
+          this.$store.commit('setLearningData', payload);
+          this.handleProblemDetail(response.data[0]);
+          this.goToPage(this.problemType);
+        })
+        .catch(error => {
+          console.error("fetchData - error: ", error);
+          return [];
+        });
+    },
+
     handleProblemDetail(item) {
+
       if (item.prblm_type_id === "prblm_type_001") {
         this.problemType = "Chapter3";
       } else if (item.prblm_type_id === "prblm_type_002") {
@@ -1072,6 +822,7 @@
       } else if (item.prblm_type_id === "prblm_type_005") {
         this.problemType = "Chapter3_3_1";
       } else if (item.prblm_type_id === "prblm_type_006") {
+        console.log(item);
         this.problemType = "Chapter3_4";
       } else if (item.prblm_type_id === "prblm_type_007") {
         this.problemType = "Chapter3_5";
client/views/pages/teacher/ExamDetail.vue
--- client/views/pages/teacher/ExamDetail.vue
+++ client/views/pages/teacher/ExamDetail.vue
@@ -343,6 +343,7 @@
                 await this.updateSequence();
 
                 // 업데이트 후 평가 문제 목록 갱신
+                alert('문제 수정에 성공했습니다!');
                 this.fetchEvalQues();
             } catch (error) {
                 console.error('오류:', error);
Add a comment
List