

250423 김혜민 권한 router 오류 수정
@7eadb7383523283c7ee46b93ed5c186f36c62eb9
+++ client/views/common/pageAuthMixin.js
... | ... | @@ -0,0 +1,17 @@ |
1 | + | |
2 | +export default { | |
3 | + computed: { | |
4 | + pageAuth() { | |
5 | + const vuex = JSON.parse(localStorage.getItem("vuex") || "{}"); | |
6 | + return vuex?.pageAuth || { | |
7 | + inqAuthrt: 'N', | |
8 | + regAuthrt: 'N', | |
9 | + mdfcnAuthrt: 'N', | |
10 | + delAuthrt: 'N', | |
11 | + fileDwnldAuthrt: 'N', | |
12 | + regAuthrt: 'N', | |
13 | + }; | |
14 | + } | |
15 | + } | |
16 | + }; | |
17 | + (파일 끝에 줄바꿈 문자 없음) |
--- client/views/component/userInfo/UserInfoView.vue
+++ client/views/component/userInfo/UserInfoView.vue
... | ... | @@ -236,7 +236,7 @@ |
236 | 236 |
<button class="btn sm tertiary" @click="fnList">목록</button> |
237 | 237 |
</template> |
238 | 238 |
<button |
239 |
- v-if="pageAuth.mdfcnAuthrt == 'Y'" |
|
239 |
+ v-if="pageAuth.mdfcnAuthrt === 'Y'" |
|
240 | 240 |
:class="{ |
241 | 241 |
'btn sm main': true, |
242 | 242 |
}" |
... | ... | @@ -259,7 +259,7 @@ |
259 | 259 |
|
260 | 260 |
// COMPONENT |
261 | 261 |
import UserAuthorList from "./UserAuthorList.vue"; |
262 |
- |
|
262 |
+import pageAuthMixin from "../../common/pageAuthMixin.js"; |
|
263 | 263 |
|
264 | 264 |
// API |
265 | 265 |
import { mbrDetailProc } from "../../../resources/api/mbrInfo"; |
... | ... | @@ -267,6 +267,7 @@ |
267 | 267 |
|
268 | 268 |
export default { |
269 | 269 |
components: { UserAuthorList }, |
270 |
+ mixins: [pageAuthMixin], |
|
270 | 271 |
props: { |
271 | 272 |
pageId: { |
272 | 273 |
type: String, |
... | ... | @@ -283,7 +284,7 @@ |
283 | 284 |
data() { |
284 | 285 |
return { |
285 | 286 |
pageRole: this.$store.state.userType, // 유저 권한 |
286 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
287 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
287 | 288 |
|
288 | 289 |
mbrVO: {}, |
289 | 290 |
showOpt: { ...defaultUserInfoParams }, // 유저정보 표시 여부 객체 |
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -104,10 +104,12 @@ |
104 | 104 |
mdfcnAuthrt: 'N', // 수정 권한 |
105 | 105 |
delAuthrt: 'N', // 삭제 권한 |
106 | 106 |
fileDwnldAuthrt: 'N', // 파일 다운로드 권한 |
107 |
- } |
|
107 |
+ }; |
|
108 |
+ |
|
108 | 109 |
if (!routeMeta || !routeMeta.authrt || routeMeta.authrt.length === 0) { |
109 | 110 |
return result; |
110 | 111 |
} |
112 |
+ |
|
111 | 113 |
routeMeta.authrt.forEach(auth => { |
112 | 114 |
if (userRoles.includes(auth.authrtCd)) { |
113 | 115 |
if (auth.inqAuthrt === 'Y') result.inqAuthrt = 'Y'; |
... | ... | @@ -135,7 +137,6 @@ |
135 | 137 |
// 권한 검증 |
136 | 138 |
function isValidRole() { |
137 | 139 |
const roles = store.state.roles; |
138 |
- console.log('권한확인',roles); |
|
139 | 140 |
if (!Array.isArray(roles)) { |
140 | 141 |
store.commit("setStoreReset"); |
141 | 142 |
return false; |
... | ... | @@ -176,13 +177,13 @@ |
176 | 177 |
// 로그인 상태 확인 (JWT 또는 SESSION) |
177 | 178 |
const isLogin = loginMode === 'J' ? store.state.authorization : store.state.mbrId; |
178 | 179 |
if (!isLogin && to.path !== filters.ctxPath('/login.page')) { |
180 |
+ sessionStorage.setItem('redirect', to.fullPath); |
|
179 | 181 |
next({ path: filters.ctxPath("/login.page") }); |
180 | 182 |
return; |
181 | 183 |
} |
182 | 184 |
|
183 | 185 |
// 접근 제어 확인 |
184 | 186 |
const accesCheck = await accessUrl(to.path); |
185 |
- console.log('accesCheck', accesCheck); |
|
186 | 187 |
const roleCheck = isValidRole(); |
187 | 188 |
if (!accesCheck || !roleCheck) { |
188 | 189 |
alert('접근이 불가합니다.\n관리자에게 문의하세요.'); |
... | ... | @@ -202,6 +203,7 @@ |
202 | 203 |
} |
203 | 204 |
const mbrAuth = store.state.roles.map(auth => auth.authority); // 사용자 권한 정보 |
204 | 205 |
const pageAuth = mergeAuth(mbrAuth, to.meta); |
206 |
+ console.log("권한확인", to.meta); |
|
205 | 207 |
sessionStorage.setItem("redirect", to.fullPath); |
206 | 208 |
|
207 | 209 |
// 메인 페이지 or 로그인 페이지 |
--- client/views/pages/adm/departmentManagement/DepartmentManagement.vue
+++ client/views/pages/adm/departmentManagement/DepartmentManagement.vue
... | ... | @@ -202,6 +202,7 @@ |
202 | 202 |
updateListProc, |
203 | 203 |
} from "../../../../resources/api/dept"; |
204 | 204 |
import Modal from "../../../component/modal/Modal.vue"; |
205 |
+import pageAuthMixin from "../../../common/pageAuthMixin.js"; |
|
205 | 206 |
export default { |
206 | 207 |
components: { |
207 | 208 |
draggable: draggable, |
... | ... | @@ -210,10 +211,11 @@ |
210 | 211 |
PaginationButton: PaginationButton, |
211 | 212 |
Modal: Modal, |
212 | 213 |
}, |
214 |
+ mixins: [pageAuthMixin], |
|
213 | 215 |
data() { |
214 | 216 |
return { |
215 | 217 |
// 페이지 권한 객체 |
216 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
218 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
217 | 219 |
|
218 | 220 |
colgroup: ["5%", "15%", "20%", "20%", "20%"], // 부서관련 등록된 사용자 테이블 생성 |
219 | 221 |
thead: ["선택", "아이디", "이름", "연락처", "이메일"], // 부서관련 등록된 사용자 테이블 생성 |
--- client/views/pages/adm/member/adminManagement/AdminManagementInsert.vue
+++ client/views/pages/adm/member/adminManagement/AdminManagementInsert.vue
... | ... | @@ -5,15 +5,16 @@ |
5 | 5 |
<script> |
6 | 6 |
// COMPONENETS |
7 | 7 |
import UserInfoInsert from "../../../../component/userInfo/UserInfoInsert.vue"; |
8 |
- |
|
8 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
9 | 9 |
export default { |
10 | 10 |
components: { |
11 | 11 |
UserInfoInsert, |
12 | 12 |
}, |
13 |
+ mixins: [pageAuthMixin], |
|
13 | 14 |
data() { |
14 | 15 |
return { |
15 | 16 |
pageId: this.$route.query.pageId, // 페이지 아이디 |
16 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
17 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
17 | 18 |
}; |
18 | 19 |
}, |
19 | 20 |
}; |
--- client/views/pages/adm/member/adminManagement/AdminManagementSelectList.vue
+++ client/views/pages/adm/member/adminManagement/AdminManagementSelectList.vue
... | ... | @@ -79,9 +79,9 @@ |
79 | 79 |
// API |
80 | 80 |
import { mbrListProc } from "../../../../../resources/api/mbrInfo"; |
81 | 81 |
import { pswdResetProc } from "../../../../../resources/api/mbrInfo"; |
82 |
- |
|
82 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
83 | 83 |
export default { |
84 |
- mixins: [queryParams], |
|
84 |
+ mixins: [queryParams, pageAuthMixin], |
|
85 | 85 |
components: { |
86 | 86 |
ListTable: ListTable, |
87 | 87 |
PaginationButton: PaginationButton, |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 |
}, |
90 | 90 |
data() { |
91 | 91 |
return { |
92 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
92 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
93 | 93 |
|
94 | 94 |
colgroup: ["5%", "19%", "19%", "15%", "10%", "8%"], |
95 | 95 |
thead: [ |
--- client/views/pages/adm/member/termsManagement/TermsManagementSelectList.vue
+++ client/views/pages/adm/member/termsManagement/TermsManagementSelectList.vue
... | ... | @@ -47,11 +47,13 @@ |
47 | 47 |
<script> |
48 | 48 |
import ListTable from "../../../../component/table/ListTable.vue"; |
49 | 49 |
import PaginationButton from "../../../../component/pagination/PaginationButton.vue"; |
50 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
50 | 51 |
export default { |
52 |
+ mixins: [pageAuthMixin], |
|
51 | 53 |
data() { |
52 | 54 |
return { |
53 | 55 |
// 페이지 권한 객체 |
54 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
56 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
55 | 57 |
|
56 | 58 |
colgroup: ["5%", "19%", "19%", "15%", "10%", "8%"], |
57 | 59 |
thead: ["NO", "제목", "순서", "사용유무", "작성자", "작성일"], |
--- client/views/pages/adm/member/termsManagement/TermsManagementSelectListOne.vue
+++ client/views/pages/adm/member/termsManagement/TermsManagementSelectListOne.vue
... | ... | @@ -57,11 +57,13 @@ |
57 | 57 |
</template> |
58 | 58 |
|
59 | 59 |
<script> |
60 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
60 | 61 |
export default { |
62 |
+ mixins: [pageAuthMixin], |
|
61 | 63 |
data() { |
62 | 64 |
return { |
63 | 65 |
// 페이지 권한 객체 |
64 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
66 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
65 | 67 |
|
66 | 68 |
colgroup: ["5%", "50%", "15%", "15%", "15%"], |
67 | 69 |
thead: ["NO", "기업명", "대표자", "기업상태", "입주의향"], |
--- client/views/pages/adm/member/userManagement/UserManagementInsert.vue
+++ client/views/pages/adm/member/userManagement/UserManagementInsert.vue
... | ... | @@ -5,15 +5,17 @@ |
5 | 5 |
<script> |
6 | 6 |
// COMPONENETS |
7 | 7 |
import UserInfoInsert from "../../../../component/userInfo/UserInfoInsert.vue"; |
8 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
8 | 9 |
|
9 | 10 |
export default { |
10 | 11 |
components: { |
11 | 12 |
UserInfoInsert, |
12 | 13 |
}, |
14 |
+ mixins: [pageAuthMixin], |
|
13 | 15 |
data() { |
14 | 16 |
return { |
15 | 17 |
pageId: this.$route.query.pageId, // 페이지 아이디 |
16 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
18 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
17 | 19 |
}; |
18 | 20 |
}, |
19 | 21 |
}; |
--- client/views/pages/adm/member/userManagement/UserManagementSelectList.vue
+++ client/views/pages/adm/member/userManagement/UserManagementSelectList.vue
... | ... | @@ -101,12 +101,12 @@ |
101 | 101 |
import queryParams from "../../../../../resources/js/queryParams"; |
102 | 102 |
import { insertProc } from "../../../../../resources/api/prvcInqHstry"; |
103 | 103 |
import { defaultSearchParams } from "../../../../../resources/js/defaultSearchParams"; |
104 |
- |
|
104 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
105 | 105 |
// API |
106 | 106 |
import { mbrListProc, pswdResetProc } from "../../../../../resources/api/mbrInfo"; |
107 | 107 |
|
108 | 108 |
export default { |
109 |
- mixins: [queryParams], |
|
109 |
+ mixins: [queryParams, pageAuthMixin], |
|
110 | 110 |
components: { |
111 | 111 |
Modal: Modal, |
112 | 112 |
ListTable: ListTable, |
... | ... | @@ -115,7 +115,7 @@ |
115 | 115 |
}, |
116 | 116 |
data() { |
117 | 117 |
return { |
118 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
118 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
119 | 119 |
|
120 | 120 |
isOpen: false, |
121 | 121 |
|
--- client/views/pages/adm/popup/PopupManagementSelectListOne.vue
+++ client/views/pages/adm/popup/PopupManagementSelectListOne.vue
... | ... | @@ -254,15 +254,18 @@ |
254 | 254 |
|
255 | 255 |
<script> |
256 | 256 |
import { mdiClose, mdiTrayArrowDown } from "@mdi/js"; |
257 |
+import pageAuthMixin from "../../../common/pageAuthMixin.js"; |
|
257 | 258 |
|
258 | 259 |
// API |
259 | 260 |
import { detailProc, deleteProc } from "../../../../resources/api/popup"; |
260 | 261 |
|
261 | 262 |
export default { |
263 |
+ |
|
264 |
+ mixins: [pageAuthMixin], |
|
262 | 265 |
data() { |
263 | 266 |
return { |
264 | 267 |
// 페이지 권한 객체 |
265 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
268 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
266 | 269 |
|
267 | 270 |
path: mdiClose, |
268 | 271 |
downPath: mdiTrayArrowDown, |
--- client/views/pages/adm/preferences/contentTypeManagement/ContentTypeManagementSelectList.vue
+++ client/views/pages/adm/preferences/contentTypeManagement/ContentTypeManagementSelectList.vue
... | ... | @@ -53,20 +53,20 @@ |
53 | 53 |
import { toRaw } from "vue"; |
54 | 54 |
import queryParams from "../../../../../resources/js/queryParams"; |
55 | 55 |
import { defaultSearchParams } from "../../../../../resources/js/defaultSearchParams"; |
56 |
- |
|
56 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
57 | 57 |
|
58 | 58 |
// API |
59 | 59 |
import { findAll } from "../../../../../resources/api/contsType"; |
60 | 60 |
|
61 | 61 |
export default { |
62 |
- mixins: [queryParams], |
|
62 |
+ mixins: [queryParams, pageAuthMixin], |
|
63 | 63 |
components: { |
64 | 64 |
ListTable: ListTable, |
65 | 65 |
PaginationButton: PaginationButton, |
66 | 66 |
}, |
67 | 67 |
data() { |
68 | 68 |
return { |
69 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
69 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
70 | 70 |
|
71 | 71 |
colgroup: ["5%", "40%", "40%", "15%"], |
72 | 72 |
thead: ["번호", "콘텐츠 한글명", "콘텐츠 영문명", "메뉴노출"], |
--- client/views/pages/adm/preferences/contentTypeManagement/ContentTypeManagementSelectListOne.vue
+++ client/views/pages/adm/preferences/contentTypeManagement/ContentTypeManagementSelectListOne.vue
... | ... | @@ -116,12 +116,16 @@ |
116 | 116 |
deleteProc, |
117 | 117 |
} from "../../../../../resources/api/contsType"; |
118 | 118 |
|
119 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
120 |
+ |
|
119 | 121 |
|
120 | 122 |
export default { |
123 |
+ |
|
124 |
+ mixins: [pageAuthMixin], |
|
121 | 125 |
data() { |
122 | 126 |
return { |
123 | 127 |
pageId: this.$route.query.pageId, // 페이지 아이디 |
124 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
128 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, // 페이지 권한 |
|
125 | 129 |
|
126 | 130 |
contsTypeVO: {}, |
127 | 131 |
}; |
--- client/views/pages/adm/statistics/BbsStatistics.vue
+++ client/views/pages/adm/statistics/BbsStatistics.vue
... | ... | @@ -109,16 +109,16 @@ |
109 | 109 |
|
110 | 110 |
// API |
111 | 111 |
import { selectBbsCntnStatsProc } from "../../../../resources/api/cntnStats"; |
112 |
- |
|
112 |
+import pageAuthMixin from "../../../common/pageAuthMixin.js"; |
|
113 | 113 |
export default { |
114 |
- mixins: [statisticsDate], |
|
114 |
+ mixins: [statisticsDate, pageAuthMixin], |
|
115 | 115 |
components: { |
116 | 116 |
ClusteredBarChart: ClusteredBarChart, |
117 | 117 |
}, |
118 | 118 |
data() { |
119 | 119 |
return { |
120 | 120 |
// 페이지 권한 객체 |
121 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
121 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
122 | 122 |
// 차트 데이터 |
123 | 123 |
chartData: [], |
124 | 124 |
// 전체 수 |
--- client/views/pages/adm/statistics/MenuStatistics.vue
+++ client/views/pages/adm/statistics/MenuStatistics.vue
... | ... | @@ -109,16 +109,17 @@ |
109 | 109 |
|
110 | 110 |
// API |
111 | 111 |
import { selectMenuCntnStatsProc } from "../../../../resources/api/cntnStats"; |
112 |
+import pageAuthMixin from "../../../common/pageAuthMixin.js"; |
|
112 | 113 |
|
113 | 114 |
export default { |
114 |
- mixins: [statisticsDate], |
|
115 |
+ mixins: [statisticsDate, pageAuthMixin], |
|
115 | 116 |
components: { |
116 | 117 |
ClusteredBarChart: ClusteredBarChart, |
117 | 118 |
}, |
118 | 119 |
data() { |
119 | 120 |
return { |
120 | 121 |
// 페이지 권한 객체 |
121 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
122 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
122 | 123 |
// 차트 데이터 |
123 | 124 |
chartData: [], |
124 | 125 |
// 전체 수 |
--- client/views/pages/adm/statistics/UserStatistics.vue
+++ client/views/pages/adm/statistics/UserStatistics.vue
... | ... | @@ -108,16 +108,17 @@ |
108 | 108 |
|
109 | 109 |
// API |
110 | 110 |
import { selectUserCntnStatsProc } from "../../../../resources/api/cntnStats"; |
111 |
+import pageAuthMixin from "../../../common/pageAuthMixin.js"; |
|
111 | 112 |
|
112 | 113 |
export default { |
113 |
- mixins: [statisticsDate], |
|
114 |
+ mixins: [statisticsDate, pageAuthMixin], |
|
114 | 115 |
components: { |
115 | 116 |
ClusteredColumnChart: ClusteredColumnChart, |
116 | 117 |
}, |
117 | 118 |
data() { |
118 | 119 |
return { |
119 | 120 |
// 페이지 권한 객체 |
120 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
121 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
121 | 122 |
// 차트 데이터 |
122 | 123 |
chartData: [], |
123 | 124 |
// 전체 수 |
--- client/views/pages/adm/system/networkAccessControl/NetworkAccessControlSelectList.vue
+++ client/views/pages/adm/system/networkAccessControl/NetworkAccessControlSelectList.vue
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
<button |
56 | 56 |
class="btn sm main" |
57 | 57 |
@click="fnAdd" |
58 |
- v-if="pageAuth.regAuthrt == 'Y'" |
|
58 |
+ v-if="pageAuth.regAuthrt === 'Y'" |
|
59 | 59 |
> |
60 | 60 |
등록 |
61 | 61 |
</button> |
... | ... | @@ -69,10 +69,10 @@ |
69 | 69 |
import { toRaw } from "vue"; |
70 | 70 |
import queryParams from "../../../../../resources/js/queryParams"; |
71 | 71 |
import { defaultSearchParams } from "../../../../../resources/js/defaultSearchParams"; |
72 |
- |
|
72 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
73 | 73 |
|
74 | 74 |
export default { |
75 |
- mixins: [queryParams], |
|
75 |
+ mixins: [queryParams, pageAuthMixin], |
|
76 | 76 |
components: { |
77 | 77 |
ListTable: ListTable, |
78 | 78 |
PaginationButton: PaginationButton, |
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 |
data() { |
81 | 81 |
return { |
82 | 82 |
// 페이지 권한 객체 |
83 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
83 |
+// pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
84 | 84 |
|
85 | 85 |
colgroup: ["5%", "50%", "15%", "15%", "15%"], |
86 | 86 |
thead: ["NO", "경로", "제어IP", "유형", "등록일"], |
--- client/views/pages/adm/system/networkAccessControl/NetworkAccessControlSelectListOne.vue
+++ client/views/pages/adm/system/networkAccessControl/NetworkAccessControlSelectListOne.vue
... | ... | @@ -47,15 +47,16 @@ |
47 | 47 |
<script> |
48 | 48 |
import { findByAcces, del } from "../../../../../resources/api/accesCtrl"; |
49 | 49 |
import queryParams from "../../../../../resources/js/queryParams"; |
50 |
+import pageAuthMixin from "../../../../common/pageAuthMixin.js"; |
|
50 | 51 |
|
51 | 52 |
export default { |
52 |
- mixins: [queryParams], |
|
53 |
+ mixins: [queryParams, pageAuthMixin], |
|
53 | 54 |
components: { |
54 | 55 |
}, |
55 | 56 |
data() { |
56 | 57 |
return { |
57 | 58 |
// 페이지 권한 객체 |
58 |
- pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
59 |
+ // pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth, |
|
59 | 60 |
|
60 | 61 |
accesCtrl: {}, |
61 | 62 |
pageId: "", |
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
... | ... | @@ -144,12 +144,17 @@ |
144 | 144 |
// redirect 값에서 기존 Context Path 제거 |
145 | 145 |
url = url.replace(/^\/[^\/]+/, ""); // 첫 번째 '/' 이후의 경로만 남김 |
146 | 146 |
} |
147 |
+ const routeExists = this.$router.getRoutes().some(route => route.path === url); |
|
147 | 148 |
|
148 | 149 |
if (url == this.$filters.ctxPath("/searchId.page") || url == this.$filters.ctxPath("/resetPswd.page")) { |
149 |
- this.$router.push({ path: this.$filters.ctxPath("/main.page") }); |
|
150 |
- } else { |
|
151 |
- this.$router.push({ path: url }); |
|
152 |
- } |
|
150 |
+ this.$router.push({ path: this.$filters.ctxPath("/main.page") }); |
|
151 |
+ } else if (routeExists) { |
|
152 |
+ this.$router.push({ path: url }); |
|
153 |
+ } else { |
|
154 |
+ this.$router.push({ |
|
155 |
+ path: isAdmin ? this.$filters.ctxPath("/adm/main.page") : this.$filters.ctxPath("/") |
|
156 |
+ }); |
|
157 |
+ } |
|
153 | 158 |
} else { |
154 | 159 |
this.$router.push({ |
155 | 160 |
path: isAdmin ? this.$filters.ctxPath("/adm/main.page") : this.$filters.ctxPath("/") |
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?