

231031 류윤주 로그인 커밋
@3352ba6c0a4fbf73da1e8e697c3851a82a8d8f63
--- client/views/layout/AdminHeader.vue
+++ client/views/layout/AdminHeader.vue
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
<template> |
2 | 2 |
<header> |
3 |
- <p class="navigate_bar"><router-link to="/">Home</router-link> > {{pathName()}}</p> |
|
3 |
+ <p class="navigate_bar">{{ userId }}</p> |
|
4 | 4 |
</header> |
5 | 5 |
</template> |
6 | 6 |
|
... | ... | @@ -9,50 +9,14 @@ |
9 | 9 |
|
10 | 10 |
export default { |
11 | 11 |
data() { |
12 |
- return { |
|
13 |
- //현재 라우터의 정보 |
|
14 |
- route: useRoute(), |
|
15 |
- |
|
16 |
- // 페이지 경로 목록 |
|
17 |
- pageList: [ |
|
18 |
- {path: "/management.page", name: "수요반응자원 관리"} |
|
19 |
- , {path: "/contract.page", name: "참여고객 관리"} |
|
20 |
- , {path: "/rrmsePropose.page", name: "RRMSE 산출의뢰"} |
|
21 |
- , {path: "/rrmseCalculationLog.page", name: "RRMSE 산출이력"} |
|
22 |
- , {path: "/reduceState.page", name: "감축현황"} |
|
23 |
- , {path: "/reduceReport.page", name: "감축결과보고서"} |
|
24 |
- , {path: "/translateDay.page", name: "데이터송수신현황 일별"} |
|
25 |
- , {path: "/translateContract.page", name: "데이터송수신현황 참여고객별"} |
|
26 |
- , {path: "/dataStatus.page", name: "데이터송수신현황 데이터수집현황"} |
|
27 |
- , {path: "/analysis.page", name: "전력사용량/CBL 통계"} |
|
28 |
- , {path: "/cblAnalysis.page", name: "CBL 분석"} |
|
29 |
- , {path: "/device.page", name: "5분검침기 현황"} |
|
30 |
- , {path: "/smsAutoSend.page", name: "SMS발송관리 자동발송설정"} |
|
31 |
- , {path: "/smsManualSend.page", name: "SMS발송관리 수동발송"} |
|
32 |
- , {path: "/smsLog.page", name: "SMS발송관리 발송이력"} |
|
33 |
- , {path: "/emailAutoSend.page", name: "E-mail발송관리 자동발송설정"} |
|
34 |
- , {path: "/emailLog.page", name: "E-mail발송관리 발송이력"} |
|
35 |
- , {path: "/system.page", name: "회원관리"} |
|
36 |
- , {path: "/login.page", name: "로그인"} |
|
37 |
- ] |
|
38 |
- }; |
|
12 |
+ return {}; |
|
39 | 13 |
}, |
40 |
- methods: { |
|
41 |
- pathName: function () { |
|
42 |
- for(let i=0; i<this.pageList.length; i++) { |
|
43 |
- if(this.route.path == this.pageList[i]['path']) { |
|
44 |
- return this.pageList[i]['name']; |
|
45 |
- } |
|
46 |
- } |
|
47 |
- return "대시보드" |
|
48 |
- } |
|
49 |
- }, |
|
14 |
+ methods: {}, |
|
50 | 15 |
watch: {}, |
51 | 16 |
computed: {}, |
52 | 17 |
components: {}, |
53 | 18 |
mounted() { |
54 | 19 |
console.log("adminHeader mounted"); |
55 |
- console.log("Header route: ", this.route); |
|
56 | 20 |
}, |
57 | 21 |
}; |
58 | 22 |
</script> |
--- client/views/pages/App.vue
+++ client/views/pages/App.vue
... | ... | @@ -1,7 +1,7 @@ |
1 | 1 |
<template> |
2 | 2 |
<div v-if="isAdminPage" class="admin-wrap"> |
3 | 3 |
<div :class="{ 'layout-wrap': true }"> |
4 |
- <AdminHeader v-show="isLogin"></AdminHeader> |
|
4 |
+ <AdminHeader v-show="isLogin" :userId="loggedInUserId"></AdminHeader> |
|
5 | 5 |
<AdminMenu v-show="isLogin"></AdminMenu> |
6 | 6 |
<div :class="{ 'login-wrap': !isLogin, 'main-wrap': isLogin }"> |
7 | 7 |
<router-view @updateIsLogin="isLogin = $event" /> |
... | ... | @@ -35,6 +35,7 @@ |
35 | 35 |
return { |
36 | 36 |
title: null, |
37 | 37 |
isLogin: false, |
38 |
+ loggedInUserId: null, |
|
38 | 39 |
userInfo: { |
39 | 40 |
user_id: null, |
40 | 41 |
}, |
... | ... | @@ -43,9 +44,10 @@ |
43 | 44 |
}, |
44 | 45 |
methods: { |
45 | 46 |
// 로그인 |
46 |
- updateIsLogin: function (newValue) { |
|
47 |
+ updateIsLogin: function (boolean) { |
|
47 | 48 |
console.log("newValue : ", newValue); |
48 |
- this.isLogin = newValue; |
|
49 |
+ this.isLogin = boolean; |
|
50 |
+ this.loggedInUserId = "test"; |
|
49 | 51 |
}, |
50 | 52 |
//로그인 사용자 조회 |
51 | 53 |
loginUserSelectOne: function (callback) { |
... | ... | @@ -104,7 +106,7 @@ |
104 | 106 |
const requiresAuth = to.matched.some((record) => record.meta.requiresAuth); |
105 | 107 |
if (requiresAuth && !isLogin) { |
106 | 108 |
next('/adm/login.page'); |
107 |
- } else { |
|
109 |
+ } else{ |
|
108 | 110 |
next(); |
109 | 111 |
} |
110 | 112 |
}); |
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 |
component: TechnologyDtail, |
54 | 54 |
}, |
55 | 55 |
/* 관리자 */ |
56 |
- { path: "/adm.page", name: "AdminMain", component: AdminMain,meta: { requiresAuth: true }}, |
|
56 |
+ { path: "/adm.page", name: "AdminMain", component: AdminMain ,meta: { requiresAuth: true }}, |
|
57 | 57 |
{ path: "/adm/login.page", name: "AdminLogin", component: AdminLogin}, |
58 | 58 |
{ path: "/adm/userSelectList.page", name: "AdminUser", component: AdminUser}, |
59 | 59 |
{ path: "/adm/noticeSelectList.page", name: "AdminNotice", component: AdminNotice}, |
--- client/views/pages/admin/login/Login.vue
+++ client/views/pages/admin/login/Login.vue
... | ... | @@ -4,14 +4,14 @@ |
4 | 4 |
<h1>AI 디지털교과서 통합지원센터</h1> |
5 | 5 |
<p class="sub-logo">관리자단</p> |
6 | 6 |
</div> |
7 |
- <div class="id-zone"> |
|
7 |
+ <div class="id-zone"> |
|
8 | 8 |
<label for="id"> |
9 | 9 |
<input type="text" name="" id="id" placeholder="ID를 입력하세요." v-model="mngrLogin.mngr_id"> |
10 | 10 |
</label> |
11 | 11 |
</div> |
12 | 12 |
<div class="pw-zone"> |
13 | 13 |
<label for="pw"> |
14 |
- <input type="password" name="" id="pw" placeholder="PASSWORD를 입력하세요." v-model="mngrLogin.mngr_pw"> |
|
14 |
+ <input type="password" name="" id="pw" placeholder="PASSWORD를 입력하세요." v-model="mngrLogin.mngr_pw"> |
|
15 | 15 |
</label> |
16 | 16 |
</div> |
17 | 17 |
|
... | ... | @@ -54,12 +54,21 @@ |
54 | 54 |
axios({ |
55 | 55 |
url: '/managerLogin.json', |
56 | 56 |
method: 'post', |
57 |
+ validateStatus: function (status) { |
|
58 |
+ return status >= 200 && status < 303; |
|
59 |
+ }, |
|
57 | 60 |
headers: { |
58 | 61 |
'Content-Type': 'application/json; charset=UTF-8' |
59 | 62 |
}, |
63 |
+ |
|
60 | 64 |
data: vm.mngrLogin |
61 | 65 |
}).then(function (response) { |
62 |
- console.log("login - response : ", response.data); |
|
66 |
+ // console.log("login - response : ", response.data); |
|
67 |
+ // console.log("headers",response.headers); |
|
68 |
+ console.log("1 : ", response.headers); |
|
69 |
+ const cookies = response.headers['Set-Cookie'] |
|
70 |
+ const cookies2 = response.headers['set-cookie'] |
|
71 |
+ console.log("2", cookies, "3", cookies2) |
|
63 | 72 |
if (response.data == true) { |
64 | 73 |
vm.$emit("updateIsLogin", true); |
65 | 74 |
vm.$router.push({ path: 'adm.page', query: {} }); |
... | ... | @@ -107,11 +116,12 @@ |
107 | 116 |
font-size: 2rem; |
108 | 117 |
} |
109 | 118 |
|
110 |
-.id-zone,.pw-zone{ |
|
119 |
+.id-zone, |
|
120 |
+.pw-zone { |
|
111 | 121 |
margin-bottom: 10px; |
112 | 122 |
} |
113 | 123 |
|
114 |
-.blue-btn{ |
|
124 |
+.blue-btn { |
|
115 | 125 |
width: 100%; |
116 | 126 |
} |
117 | 127 |
</style> |
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?