update code

This commit is contained in:
leonard
2025-07-24 14:45:30 +07:00
parent bcf4015cae
commit bbd037dcb4
5 changed files with 50 additions and 15 deletions

View File

@ -2,7 +2,8 @@ import $cookie from 'vue-cookie';
export default async function({ store, route, redirect }) { export default async function({ store, route, redirect }) {
// const menuId = route.query.menuId; // const menuId = route.query.menuId;
const FEMS_SESSION = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTYiLCJyb2xlIjoiYWRtaW4ifQ.sflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; // const FEMS_SESSION = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTYiLCJyb2xlIjoiYWRtaW4ifQ.sflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
const FEMS_SESSION = $cookie.get('FEMS_SESSION');
if (!FEMS_SESSION) { if (!FEMS_SESSION) {
if (route.name !== 'login') redirect('/login'); if (route.name !== 'login') redirect('/login');
} else { } else {

View File

@ -61,15 +61,15 @@ module.exports = {
styleResources: { styleResources: {
scss: ['./assets/scss/*.scss'], scss: ['./assets/scss/*.scss'],
}, },
// proxy: { proxy: {
// "/api/": { "/api/": {
// target: "http://0.0.0.0:9999/", target: "http://0.0.0.0:9999/",
// //target: "http://192.168.0.152:8082/", //target: "http://192.168.0.152:8082/",
// pathRewrite: { pathRewrite: {
// "^/api/": "" "^/api/": ""
// } }
// } }
// }, },
axios: { axios: {
//baseURL: "http://dotest.kfems.kr:9997", //baseURL: "http://dotest.kfems.kr:9997",
proxy: true, proxy: true,

View File

@ -3,13 +3,14 @@
<v-row ref="searchFilter"> <v-row ref="searchFilter">
<v-col :cols="12"> <v-col :cols="12">
<v-card class="searchFilter"> <v-card class="searchFilter">
<v-row algin="center" no-gutters> <v-row algin="end" no-gutters>
<v-col :cols="3"> <v-col :cols="3">
<InputText <InputText
:parentPrgmId="myPrgmId" :parentPrgmId="myPrgmId"
label="역할ID" label="역할ID"
valueNm="roleId" valueNm="roleId"
:searchOption="true" :searchOption="true"
customClass="input-large"
/> />
</v-col> </v-col>
<v-col :cols="3"> <v-col :cols="3">
@ -18,17 +19,19 @@
label="역할명" label="역할명"
valueNm="roleNm" valueNm="roleNm"
:searchOption="true" :searchOption="true"
customClass="input-large"
/> />
</v-col> </v-col>
<v-col :cols="6" class="text-right"> <v-col :cols="6" class="text-right">
<!-- <v-btn @click="test = !test">WWW</v-btn> --> <!-- <v-btn @click="test = !test">WWW</v-btn> -->
<BtnSearch /> <BtnSearch size="large" />
</v-col> </v-col>
</v-row> </v-row>
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<v-row ref="contents">
<v-row ref="contents" style="height: 100vh;">
<v-col cols="12" lg="2" class="h100"> <v-col cols="12" lg="2" class="h100">
<v-card> <v-card>
<v-card-title> <v-card-title>

View File

@ -147,6 +147,26 @@ export default {
// } // }
await this.loginChk(); await this.loginChk();
}, },
// async loginChk() {
// const DOMAIN = '';
// const apiUrl = 'loginChk';
// const params = {
// local: 'ko',
// comId: this.userComId, // 요청 comId는 클라우드 서비스시는 입력 값으로 처리 되어야 할수 있음.
// userId: this.userId,
// userPswd: this.userPw,
// };
// const res = await this.$axios.post(DOMAIN + apiUrl, { params: params });
// const femsSessionCookie = 3434;
// const FEMS_SESSION = femsSessionCookie;
// $cookie.set('FEMS_SESSION', FEMS_SESSION);
// this.setUserInfo(res.data.dataset.userInfo);
// // alert("임시로 로그인 처리 되었습니다. dashboard 페이지로 이동합니다.");
// // console.log('res.data.dataset.userInfo: ', res.data.dataset.userInfo);
// // return;
// this.$router.push({ path: this.myHome.root });
// },
async loginChk() { async loginChk() {
const DOMAIN = ''; const DOMAIN = '';
const apiUrl = 'loginChk'; const apiUrl = 'loginChk';
@ -156,15 +176,25 @@ export default {
userId: this.userId, userId: this.userId,
userPswd: this.userPw, userPswd: this.userPw,
}; };
console.log('asdasd' + JSON.stringify( DOMAIN) + params)
const res = await this.$axios.post(DOMAIN + apiUrl, { params: params }); const res = await this.$axios.post(DOMAIN + apiUrl, { params: params });
const femsSessionCookie = 3434; if (res.data.retnCd === -9001) {
alert(res.data.retnMsg);
return {};
} else {
const femsSessionCookie = res.data.dataset.FEMS_SESSION;
const FEMS_SESSION = femsSessionCookie; const FEMS_SESSION = femsSessionCookie;
$cookie.set('FEMS_SESSION', FEMS_SESSION); $cookie.set('FEMS_SESSION', FEMS_SESSION);
this.setUserInfo(res.data.dataset.userInfo); this.setUserInfo(res.data.dataset.userInfo);
console.log('FEMS_SESSION', FEMS_SESSION);
console.log('$cookie.get', $cookie.get('FEMS_SESSION'));
console.log('userInfo', JSON.stringify(res.data.dataset.userInfo));
// alert("임시로 로그인 처리 되었습니다. dashboard 페이지로 이동합니다."); // alert("임시로 로그인 처리 되었습니다. dashboard 페이지로 이동합니다.");
this.$router.push({ path: this.myHome.root }); this.$router.push({ path: this.myHome.root });
}
}, },
}, },
}; };

View File

@ -1,5 +1,6 @@
import $cookie from 'vue-cookie'; import $cookie from 'vue-cookie';
export default ({ $axios, res }) => { export default ({ $axios, res }) => {
$axios.defaults.baseURL = '/api/';
$axios.onRequest(config => { $axios.onRequest(config => {
config.headers.common['AUTHENTICATION_FEMS_SESSION'] = `${$cookie.get( config.headers.common['AUTHENTICATION_FEMS_SESSION'] = `${$cookie.get(
'FEMS_SESSION', 'FEMS_SESSION',