cookie sso
This commit is contained in:
parent
0f2a0cf784
commit
a9f1bbd1dc
2 changed files with 18 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ import { useRouter } from 'vue-router'
|
|||
import http from '@/plugins/http'
|
||||
import config from '@/app.config'
|
||||
import avatar from '@/assets/avatar_user.jpg'
|
||||
import { logout, tokenParsed } from '@/plugins/auth'
|
||||
import { logout, tokenParsed, getCookie } from '@/plugins/auth'
|
||||
import { useCounterMixin } from '@/stores/mixin'
|
||||
|
||||
import type { notiType } from '@/interface/index/Main'
|
||||
|
|
@ -27,9 +27,9 @@ const router = useRouter()
|
|||
const $q = useQuasar()
|
||||
|
||||
// landing page config url
|
||||
// const configParam = {
|
||||
// landingPageUrl: import.meta.env.VITE_URL_LANDING,
|
||||
// }
|
||||
const configParam = {
|
||||
landingPageUrl: import.meta.env.VITE_URL_LANDING,
|
||||
}
|
||||
|
||||
const modalReset = ref<boolean>(false) //ตัวแปร popup reset password
|
||||
const fullName = ref<string>('') //ชื่อผู้ใช้งาน
|
||||
|
|
@ -160,7 +160,7 @@ function onLoad(index: number, done: Function) {
|
|||
}
|
||||
|
||||
// landing page redirect
|
||||
// const landingPageUrl = ref<string>(configParam.landingPageUrl)
|
||||
const landingPageUrl = ref<string>(configParam.landingPageUrl)
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลผู้ใช่งาน*/
|
||||
async function fetchKeycloakPosition() {
|
||||
|
|
@ -284,10 +284,14 @@ function ruleReNewPassWord(val: string) {
|
|||
})
|
||||
}
|
||||
|
||||
const isSsoToken = ref<boolean>(false)
|
||||
|
||||
onMounted(async () => {
|
||||
fetchTotolNotificate()
|
||||
fetchKeycloakPosition()
|
||||
const checkTokenParsed = await tokenParsed()
|
||||
const SSO_TOKEN = await getCookie('SSO')
|
||||
isSsoToken.value = SSO_TOKEN === 'y' ? true : false
|
||||
if (checkTokenParsed != null) {
|
||||
fullName.value = checkTokenParsed.name
|
||||
}
|
||||
|
|
@ -464,7 +468,7 @@ onMounted(async () => {
|
|||
|
||||
<q-separator />
|
||||
<q-list dense class="q-py-sm">
|
||||
<!-- <q-item clickable :href="landingPageUrl">
|
||||
<q-item clickable :href="landingPageUrl" v-if="isSsoToken">
|
||||
<q-item-section avatar>
|
||||
<q-avatar
|
||||
color="blue"
|
||||
|
|
@ -475,7 +479,7 @@ onMounted(async () => {
|
|||
/>
|
||||
</q-item-section>
|
||||
<q-item-section class="q-py-sm"> Landing Page </q-item-section>
|
||||
</q-item> -->
|
||||
</q-item>
|
||||
<q-item clickable @click="onreset()">
|
||||
<q-item-section avatar>
|
||||
<q-avatar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue