Merge branch 'main' of github.com:Frappet/hrms-landing
* 'main' of github.com:Frappet/hrms-landing: api # Conflicts: # src/api/index.ts
This commit is contained in:
commit
146dcb9028
3 changed files with 48 additions and 11 deletions
|
|
@ -16,10 +16,10 @@ import type { DateCards } from "@/interface/index/Main";
|
|||
|
||||
const $q = useQuasar();
|
||||
|
||||
const urlAdmin = import.meta.env.VITE_URL_ADMIN ?? "";
|
||||
const urlUser = import.meta.env.VITE_URL_USER ?? "";
|
||||
const urlMgt = import.meta.env.VITE_URL_MGT ?? "";
|
||||
const urlCheckin = import.meta.env.VITE_URL_CHECKIN ?? "";
|
||||
const urlAdmin = config.API.URL_ADMIN;
|
||||
const urlUser = config.API.URL_USER;
|
||||
const urlMgt = config.API.URL_MGT;
|
||||
const urlCheckin = config.API.URL_CHECKIN;
|
||||
|
||||
const cards = ref<DateCards[]>([
|
||||
{
|
||||
|
|
@ -83,8 +83,8 @@ async function goPage(sys: string, url: string) {
|
|||
requiredRole = ["ADMIN", "SUPER_ADMIN"];
|
||||
}
|
||||
|
||||
console.log("requiredRole===>", requiredRole);
|
||||
console.log("decoded===>", JSON.parse(decoded).realm_access.roles);
|
||||
// console.log("requiredRole===>", requiredRole);
|
||||
// console.log("decoded===>", JSON.parse(decoded).realm_access.roles);
|
||||
|
||||
// ตรวจสอบว่า payload.role มีค่าหรือไม่ และว่ามี role ที่ต้องการหรือไม่
|
||||
if (
|
||||
|
|
@ -112,7 +112,8 @@ async function logout() {
|
|||
await deleteCookie("BMAHRIS_KEYCLOAK_IDENTITY");
|
||||
await deleteCookie("BMAHRIS_KEYCLOAK_REFRESH");
|
||||
|
||||
window.location.href = `${import.meta.env.VITE_URL_SSO}`;
|
||||
// ยิง logout เข้าระบบ
|
||||
window.location.href = `${config.API.URL_SSO}`;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -138,11 +139,10 @@ onMounted(async () => {
|
|||
}
|
||||
)
|
||||
.then((res: any) => {
|
||||
console.log("res===>", res);
|
||||
|
||||
if (res.status === 200) {
|
||||
setCookie("BMAHRIS_KEYCLOAK_IDENTITY", res.data.access_token, 1);
|
||||
setCookie("BMAHRIS_KEYCLOAK_REFRESH", res.data.refresh_token, 1);
|
||||
// ยิง log เข้าระบบ
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
|
|
@ -207,7 +207,7 @@ onMounted(async () => {
|
|||
class="q-mt-xl"
|
||||
:class="!$q.screen.gt.md ? 'row justify-center' : ''"
|
||||
>
|
||||
<div class="q-col-gutter-md" :class="$q.screen.gt.md ? 'row' : ''">
|
||||
<div class="q-col-gutter-lg" :class="$q.screen.gt.md ? 'row' : ''">
|
||||
<div class="col" v-for="(card, index) in cards" :key="index">
|
||||
<q-card
|
||||
:style="!$q.screen.gt.md ? 'width: 300px' : ''"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue