
--- client/views/layout/Menu.vue
+++ client/views/layout/Menu.vue
... | ... | @@ -36,10 +36,11 @@ |
36 | 36 |
<ul class="main-menu main-menu-1"> |
37 | 37 |
<li v-for="menuItem in menuItems" :key="menuItem.text" :class="{ 'active': menuItem.isHovered }" |
38 | 38 |
@mouseover="menuItem.isHovered = true" @mouseout="menuItem.isHovered = false"> |
39 |
- <router-link :to="menuItem.link">{{ menuItem.text }}</router-link> |
|
39 |
+ <router-link v-if="shouldRenderMenuItem(menuItem)" :to="menuItem.link">{{ menuItem.text |
|
40 |
+ }}</router-link> |
|
40 | 41 |
<ul class="sub-menu sub-menu-1"> |
41 | 42 |
<li v-for="subMenuItem in menuItem.subMenu" :key="subMenuItem.text" @click="navClose(menuItem)"> |
42 |
- <router-link :to="subMenuItem.link">{{ subMenuItem.text }}</router-link> |
|
43 |
+ <router-link v-if="shouldRenderSubMenuItem(subMenuItem)" :to="subMenuItem.link">{{ subMenuItem.text }}</router-link> |
|
43 | 44 |
</li> |
44 | 45 |
</ul> |
45 | 46 |
</li> |
... | ... | @@ -50,6 +51,7 @@ |
50 | 51 |
</template> |
51 | 52 |
|
52 | 53 |
<script> |
54 |
+import { useStore } from "vuex"; |
|
53 | 55 |
export default { |
54 | 56 |
data() { |
55 | 57 |
return { |
... | ... | @@ -101,7 +103,8 @@ |
101 | 103 |
{ text: "매칭 관리", link: "/MatchingManager.page" } |
102 | 104 |
] |
103 | 105 |
} |
104 |
- ] |
|
106 |
+ ], |
|
107 |
+ store: useStore(), |
|
105 | 108 |
}; |
106 | 109 |
}, |
107 | 110 |
methods: { |
... | ... | @@ -118,7 +121,23 @@ |
118 | 121 |
menuItem.isExpanded = false; |
119 | 122 |
this.check = false; |
120 | 123 |
}, |
121 |
- |
|
124 |
+ shouldRenderMenuItem(menuItem) { |
|
125 |
+ //해당 메뉴 항목이 로그인 상태에 따라 렌더링되어야 하는지 확인하는 로직 |
|
126 |
+ if (menuItem.text === "마이페이지") { |
|
127 |
+ return this.store.state.loginUser != null; |
|
128 |
+ } |
|
129 |
+ // 다른 메뉴 항목은 항상 표시 |
|
130 |
+ return true; |
|
131 |
+ }, |
|
132 |
+ shouldRenderSubMenuItem(subMenuItem) { |
|
133 |
+ // 해당 서브 메뉴 항목이 로그인 상태에 따라 렌더링되어야 하는지 확인하는 로직 |
|
134 |
+ if (subMenuItem.text === "매칭 관리") { |
|
135 |
+ // '매칭 관리' 항목은 'company'로 로그인한 경우에만 표시 |
|
136 |
+ return this.store.state.loginUser.user_auth === 'company'; |
|
137 |
+ } |
|
138 |
+ // 다른 서브 메뉴 항목은 항상 표시 |
|
139 |
+ return true; |
|
140 |
+ } |
|
122 | 141 |
}, |
123 | 142 |
watch: { |
124 | 143 |
|
--- client/views/pages/App.vue
+++ client/views/pages/App.vue
... | ... | @@ -1,5 +1,5 @@ |
1 | 1 |
<template> |
2 |
- <div v-if="isAdminPage" class="admin-wrap" > |
|
2 |
+ <div v-if="isAdminPage" class="admin-wrap"> |
|
3 | 3 |
<div :class="layoutClass"> |
4 | 4 |
<AdminHeader v-show="isLogin" :mngrId="mngrInfo" @updateIsLogin="isLogin = $event"></AdminHeader> |
5 | 5 |
<AdminMenu v-show="isLogin"></AdminMenu> |
... | ... | @@ -16,6 +16,19 @@ |
16 | 16 |
</div> |
17 | 17 |
<Footer></Footer> |
18 | 18 |
</div> |
19 |
+ <!-- <div v-show="isModalOpen" class="modal-wrapper"> |
|
20 |
+ <div class="modal-container"> |
|
21 |
+ <p> |
|
22 |
+ 해당글은 정회원에게 공개된 게시물 입니다. |
|
23 |
+ (준회원은 가입 승인 이후 열람 가능하며, |
|
24 |
+ 비회원은 회원가입이 필요합니다.) |
|
25 |
+ </p> |
|
26 |
+ <div class="modal-end"> |
|
27 |
+ <button class="dark-gray-btn mgl5" @click="closeModal()">닫기</button> |
|
28 |
+ <button class="blue-btn" @click="loginMove">로그인</button> |
|
29 |
+ </div> |
|
30 |
+ </div> |
|
31 |
+ </div> --> |
|
19 | 32 |
</template> |
20 | 33 |
|
21 | 34 |
<script> |
... | ... | @@ -41,7 +54,9 @@ |
41 | 54 |
mngr_id: null, |
42 | 55 |
}, |
43 | 56 |
store: useStore(), |
44 |
- screenType: 'large', |
|
57 |
+ screenType: 'large', |
|
58 |
+ // 모달창 오픈 상태 |
|
59 |
+ isModalOpen: false, |
|
45 | 60 |
}; |
46 | 61 |
}, |
47 | 62 |
created() { |
... | ... | @@ -49,6 +64,18 @@ |
49 | 64 |
this.debouncedHandleResize = debounce(this.handleResize, 200); // 200ms 디바운스 |
50 | 65 |
}, |
51 | 66 |
methods: { |
67 |
+ openModal: function () { |
|
68 |
+ this.isModalOpen = true; |
|
69 |
+ }, |
|
70 |
+ |
|
71 |
+ closeModal: function () { |
|
72 |
+ this.isModalOpen = false; |
|
73 |
+ console.log("1"); |
|
74 |
+ this.modalType = null; |
|
75 |
+ console.log("2"); |
|
76 |
+ }, |
|
77 |
+ |
|
78 |
+ |
|
52 | 79 |
// 로그인 |
53 | 80 |
updateIsLogin: function (boolean) { |
54 | 81 |
console.log("newValue : ", newValue); |
... | ... | @@ -111,7 +138,7 @@ |
111 | 138 |
}); |
112 | 139 |
}, |
113 | 140 |
// 반응형을 위한 핸들러 |
114 |
- handleResize() { |
|
141 |
+ handleResize: function () { |
|
115 | 142 |
const screenWidth = window.innerWidth; |
116 | 143 |
if (screenWidth <= 480) { |
117 | 144 |
this.screenType = 'small'; |
... | ... | @@ -122,6 +149,11 @@ |
122 | 149 |
} |
123 | 150 |
console.log('isLargeScreen:', this.screenType); // 값 확인 |
124 | 151 |
}, |
152 |
+ |
|
153 |
+ loginMove: function () { |
|
154 |
+ this.$router.push('/Login.page'); |
|
155 |
+ this.isModalOpen = false |
|
156 |
+ } |
|
125 | 157 |
}, |
126 | 158 |
watch: { |
127 | 159 |
|
... | ... | @@ -183,15 +215,32 @@ |
183 | 215 |
this.loginUserSelectOne(function (store) { |
184 | 216 |
//로그인 유무(로그인 정보가 있으면 True, 없으면 False) |
185 | 217 |
let isLogin = (store.loginUser != null && store.loginUser['user_id'] != null); |
218 |
+ const authenticationState = store.loginUser; |
|
219 |
+ const { authorization } = to.meta; |
|
220 |
+ const nonMember = authenticationState == null ? '비회원' : '회원' |
|
221 |
+ |
|
186 | 222 |
//로그인 상태 일 때 |
187 | 223 |
if (isLogin == true) { |
224 |
+ const memberType = authenticationState.create_account_approval === 'Y' ? '정회원' : '준회원'; |
|
225 |
+ const memberTypeDetail = memberType === '정회원' ? (authenticationState.user_auth === 'common' ? '일반 정회원' : '기업 정회원') : '준회원'; |
|
226 |
+ console.log("::::", memberTypeDetail); |
|
188 | 227 |
//로그인 페이지 이동은 못하게 함 |
189 | 228 |
if (to.path == '/login.page') { |
190 | 229 |
next(false); |
191 | 230 |
} else {//로그인 페이지 이 외의 페이지들을 이동 가능하게 함 |
231 |
+ if (!authorization.includes(memberTypeDetail)) { |
|
232 |
+ // 권한이 없는 유저는 not-found 페이지로 보낸다. |
|
233 |
+ next({ path: "/" }); |
|
234 |
+ } |
|
192 | 235 |
next(); |
193 | 236 |
} |
194 | 237 |
} else {//로그인 상태가 아닐 때 |
238 |
+ // 로그인 상태가 아니면 권한이 없는게 있어 넣어줘야함 |
|
239 |
+ if (!authorization.includes(nonMember)) { |
|
240 |
+ if (nonMember == '비회원') { |
|
241 |
+ alert(' 해당글은 정회원에게 공개된 게시물 입니다. (준회원은 가입 승인 이후 열람 가능하며, 비회원은 회원가입이 필요합니다.)') |
|
242 |
+ } next(); |
|
243 |
+ } |
|
195 | 244 |
next(); |
196 | 245 |
} |
197 | 246 |
}); |
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -74,27 +74,27 @@ |
74 | 74 |
|
75 | 75 |
const routes = [ |
76 | 76 |
/* 메인화면 */ |
77 |
- { path: "/", name: "Main", component: Main }, |
|
78 |
- { path: "/Data.page", name: "Data", component: Data }, |
|
79 |
- { path: "/Matching.page", name: "Matching", component: Matching }, |
|
80 |
- { path: "/Login.page", name: "Login", component: Login }, |
|
81 |
- { path: "/Join.page", name: "Join", component: Join }, |
|
82 |
- { path: "/Joinsub.page", name: "Joinsub", component: Joinsub }, |
|
83 |
- { path: "/Introduction.page", name: "Introduction", component: Introduction }, |
|
84 |
- { path: "/Technology.page", name: "Technology", component: Technology }, |
|
85 |
- { path: "/Notice.page", name: "Notice", component: Notice }, |
|
86 |
- { path: "/Info.page", name: "Info", component: Info }, |
|
87 |
- { path: "/Guide.page", name: "Guide", component: Guide }, |
|
88 |
- { path: "/Infosub.page", name: "Infosub", component: Infosub }, |
|
89 |
- { path: "/News.page", name: "News", component: News }, |
|
90 |
- { path: "/DataDtali.page", name: "DataDtali", component: DataDtali }, |
|
91 |
- { path: "/NoticeOne.page", name: "NoticeOne", component: NoticeOne }, |
|
92 |
- { path: "/Wgcommunity.page", name: "Wgcommunity", component: Wgcommunity }, |
|
93 |
- { path: "/WgcommunityOne.page", name: "WgcommunityOne", component: WgcommunityOne,}, |
|
94 |
- { path: "/MatchingOne.page", name: "MatchingOne", component: MatchingOne }, |
|
95 |
- { path: "/userIDsearch.page", name: "userIDsearch", component: userIDsearch }, |
|
96 |
- { path: "/TechnologyOne.page", name: "TechnologyOne", component: TechnologyOne,}, |
|
97 |
- { path: "/MatchingManager.page", name: "MatchingManager", component: MatchingManager,}, |
|
77 |
+ { path: "/", name: "Main", component: Main, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]}}, |
|
78 |
+ { path: "/Data.page", name: "Data", component: Data, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
79 |
+ { path: "/Matching.page", name: "Matching", component: Matching, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
80 |
+ { path: "/Login.page", name: "Login", component: Login, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
81 |
+ { path: "/Join.page", name: "Join", component: Join, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
82 |
+ { path: "/Joinsub.page", name: "Joinsub", component: Joinsub, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
83 |
+ { path: "/Introduction.page", name: "Introduction", component: Introduction, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
84 |
+ { path: "/Technology.page", name: "Technology", component: Technology, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
85 |
+ { path: "/Notice.page", name: "Notice", component: Notice, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
86 |
+ { path: "/Info.page", name: "Info", component: Info,meta:{authorization:["준회원","일반 정회원","기업 정회원"]} }, |
|
87 |
+ { path: "/Guide.page", name: "Guide", component: Guide, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]}}, |
|
88 |
+ { path: "/Infosub.page", name: "Infosub", component: Infosub,meta:{authorization:["일반 정회원","기업 정회원"]} }, |
|
89 |
+ { path: "/News.page", name: "News", component: News, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
90 |
+ { path: "/DataDtali.page", name: "DataDtali", component: DataDtali,meta:{authorization:["일반 정회원","기업 정회원"]} }, |
|
91 |
+ { path: "/NoticeOne.page", name: "NoticeOne", component: NoticeOne, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
92 |
+ { path: "/Wgcommunity.page", name: "Wgcommunity", component: Wgcommunity, meta:{authorization:["비회원","준회원","일반 정회원","기업 정회원"]} }, |
|
93 |
+ { path: "/WgcommunityOne.page", name: "WgcommunityOne", component: WgcommunityOne,meta:{authorization:["일반 정회원","기업 정회원"]}}, |
|
94 |
+ { path: "/MatchingOne.page", name: "MatchingOne", component: MatchingOne,meta:{authorization:["일반 정회원","기업 정회원"]} }, |
|
95 |
+ // { path: "/userIDsearch.page", name: "userIDsearch", component: userIDsearch,meta:{authorization:[]} }, |
|
96 |
+ { path: "/TechnologyOne.page", name: "TechnologyOne", component: TechnologyOne,meta:{authorization:["일반 정회원","기업 정회원"]}}, |
|
97 |
+ { path: "/MatchingManager.page", name: "MatchingManager", component: MatchingManager,meta:{authorization:["기업 정회원"]}}, |
|
98 | 98 |
/* 관리자 */ |
99 | 99 |
{ path: "/adm.page", name: "AdminMain", component: AdminMain, meta: { requiresAuth: true },}, |
100 | 100 |
{ path: "/adm/login.page", name: "AdminLogin", component: AdminLogin }, |
--- client/views/pages/user/networking/Matching.vue
+++ client/views/pages/user/networking/Matching.vue
... | ... | @@ -91,6 +91,7 @@ |
91 | 91 |
</template> |
92 | 92 |
|
93 | 93 |
<script> |
94 |
+import { useStore } from "vuex"; |
|
94 | 95 |
import axios from 'axios'; |
95 | 96 |
import COMMON_UTIL from '../../../../resources/js/commonUtil.js'; |
96 | 97 |
|
... | ... | @@ -112,8 +113,8 @@ |
112 | 113 |
companyTop6List: [], |
113 | 114 |
companyListCount: 0, |
114 | 115 |
companyIdx: 0, |
115 |
- |
|
116 |
- pickModalOpen: false |
|
116 |
+ pickModalOpen: false, |
|
117 |
+ store: useStore(), |
|
117 | 118 |
} |
118 | 119 |
}, |
119 | 120 |
methods: { |
... | ... | @@ -148,14 +149,21 @@ |
148 | 149 |
}, |
149 | 150 |
|
150 | 151 |
pickModal: function (item) { |
151 |
- |
|
152 |
- if (this.userCompanyId != item.company_id) { |
|
153 |
- if (confirm(item.company_nm + "에게 PICK 신청을 하시겠습니까?")) { |
|
154 |
- this.pick(item) |
|
152 |
+ const isUserLogin = this.store.state.loginUser; |
|
153 |
+ if (isUserLogin.user_auth === 'common') { |
|
154 |
+ alert("일반 회원은 해당 기능을 이용하실 수 없습니다.") |
|
155 |
+ } else if (isUserLogin.create_account_approval === 'N' && isUserLogin.user_auth === 'company') { |
|
156 |
+ alert("가입 승인 중 입니다. 해당 기능을 이용하실 수 없습니다.") |
|
157 |
+ } else if (isUserLogin.create_account_approval === 'Y' && isUserLogin.user_auth === 'company') { |
|
158 |
+ if (this.userCompanyId != item.company_id) { |
|
159 |
+ if (confirm(item.company_nm + "에게 PICK 신청을 하시겠습니까?")) { |
|
160 |
+ this.pick(item) |
|
161 |
+ } |
|
162 |
+ } else { |
|
163 |
+ alert("자신의 기업에는 PICK을 할 수 없습니다.") |
|
155 | 164 |
} |
156 |
- } else { |
|
157 |
- alert("자신의 기업에는 PICK을 할 수 없습니다.") |
|
158 | 165 |
} |
166 |
+ |
|
159 | 167 |
|
160 | 168 |
}, |
161 | 169 |
|
... | ... | @@ -206,10 +214,10 @@ |
206 | 214 |
companySelectOnePage: function (item) { |
207 | 215 |
const vm = this; |
208 | 216 |
let best = 'non' |
209 |
- for(let i =0; i < vm.companyTop6List.length; i++) { |
|
210 |
- if(vm.companyTop6List[i].company_id === item.company_id) { |
|
217 |
+ for (let i = 0; i < vm.companyTop6List.length; i++) { |
|
218 |
+ if (vm.companyTop6List[i].company_id === item.company_id) { |
|
211 | 219 |
best = 'best'; |
212 |
- } |
|
220 |
+ } |
|
213 | 221 |
} |
214 | 222 |
axios({ |
215 | 223 |
url: '/matching/companyViewCountAdd.json', |
... | ... | @@ -219,14 +227,14 @@ |
219 | 227 |
}, |
220 | 228 |
data: { 'company_id': item.company_id } |
221 | 229 |
}).then(function (response) { |
222 |
- vm.$router.push({ path: '/MatchingOne.page', query: { 'company_id': item.company_id, 'best': best} }); |
|
230 |
+ vm.$router.push({ path: '/MatchingOne.page', query: { 'company_id': item.company_id, 'best': best } }); |
|
223 | 231 |
}).catch(function (error) { |
224 | 232 |
console.log("기업 상세조회 오류, 관리자에게 문의하세요."); |
225 | 233 |
}) |
226 | 234 |
}, |
227 | 235 |
|
228 | 236 |
/**페이지 접속 로그 등록 */ |
229 |
- pageLogInsert: function() { |
|
237 |
+ pageLogInsert: function () { |
|
230 | 238 |
const vm = this; |
231 | 239 |
|
232 | 240 |
axios({ |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?