|
9 | 9 | <div class="flex justify-between items-center mb-6 border-b border-gray-200 pb-4"> |
10 | 10 | <h2 class="text-xl font-bold text-text-heading">프로필</h2> |
11 | 11 | <button |
| 12 | + v-if="user.userInfo?.role_type === 'student'" |
12 | 13 | @click="studentScoreInputForm" |
13 | 14 | :class="[ |
14 | 15 | 'px-4 py-2 rounded-base text-sm font-medium transition-colors duration-200', |
|
30 | 31 | <p class="text-lg font-semibold text-text-heading text-center"> |
31 | 32 | {{ user.userInfo?.name }} |
32 | 33 | </p> |
33 | | - <p class="text-sm text-text-muted text-center mb-4">{{ user.userInfo?.user_id }}</p> |
| 34 | + <p |
| 35 | + v-if="user.userInfo?.role_type === 'student'" |
| 36 | + class="text-sm text-text-muted text-center mb-4" |
| 37 | + > |
| 38 | + {{ user.userInfo?.user_id }} |
| 39 | + </p> |
34 | 40 | </div> |
35 | 41 |
|
36 | 42 | <div class="bg-gray-50 rounded-base border border-gray-200 p-4 mb-6"> |
37 | | - <div class="flex justify-between items-center py-3 border-b border-gray-200"> |
| 43 | + <div |
| 44 | + v-if="user.userInfo?.role_type === 'student'" |
| 45 | + class="flex justify-between items-center py-3 border-b border-gray-200" |
| 46 | + > |
38 | 47 | <span class="text-sm font-medium text-text-muted">학번</span> |
39 | 48 | <span class="text-sm text-text-base">{{ user.userInfo?.user_id }}</span> |
40 | 49 | </div> |
41 | | - <div class="flex justify-between items-center py-3 border-b border-gray-200"> |
| 50 | + <div |
| 51 | + v-if="user.userInfo?.role_type === 'student'" |
| 52 | + class="flex justify-between items-center py-3 border-b border-gray-200" |
| 53 | + > |
42 | 54 | <span class="text-sm font-medium text-text-muted">학년</span> |
43 | 55 | <span class="text-sm text-text-base">{{ user.userInfo?.grade_id + '학년' }}</span> |
44 | 56 | </div> |
@@ -196,10 +208,12 @@ const gradeInput = reactive({ |
196 | 208 | }) |
197 | 209 |
|
198 | 210 | onMounted(async () => { |
199 | | - try { |
200 | | - userGrade.value = await getUserGrade() |
201 | | - } catch (error) { |
202 | | - console.log('성적 정보를 불러오지 못했습니다.', error) |
| 211 | + if (user.userInfo.role_type === 'stuendt') { |
| 212 | + try { |
| 213 | + userGrade.value = await getUserGrade() |
| 214 | + } catch (error) { |
| 215 | + console.log('성적 정보를 불러오지 못했습니다.', error) |
| 216 | + } |
203 | 217 | } |
204 | 218 | }) |
205 | 219 |
|
|
0 commit comments