feat: add edm service
This commit is contained in:
parent
a1b12fbb46
commit
2ff18e7785
3 changed files with 39 additions and 0 deletions
26
src/pages/06_edm/MainPage.vue
Normal file
26
src/pages/06_edm/MainPage.vue
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { getInstance } from 'src/services/keycloak';
|
||||
|
||||
const kc = getInstance();
|
||||
const at = ref(kc.token);
|
||||
const rt = ref(kc.refreshToken);
|
||||
|
||||
watch(
|
||||
() => kc.token,
|
||||
() => {
|
||||
at.value = kc.token;
|
||||
rt.value = kc.refreshToken;
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<iframe
|
||||
:src="`http://localhost:9001/?at=${at}&rt=${rt}`"
|
||||
frameborder="0"
|
||||
class="full-width full-height rounded bordered"
|
||||
></iframe>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
@ -46,6 +46,11 @@ const routes: RouteRecordRaw[] = [
|
|||
name: 'Quotation',
|
||||
component: () => import('pages/05_quotation/MainPage.vue'),
|
||||
},
|
||||
{
|
||||
path: '/edm',
|
||||
name: 'document-management',
|
||||
component: () => import('pages/06_edm/MainPage.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ export async function getToken() {
|
|||
return keycloak.token;
|
||||
}
|
||||
|
||||
export async function getRefreshToken() {
|
||||
return keycloak.refreshToken;
|
||||
}
|
||||
|
||||
export function getUserId(): string | undefined {
|
||||
return keycloak.tokenParsed?.sub;
|
||||
}
|
||||
|
|
@ -63,3 +67,7 @@ export function isLoggedIn() {
|
|||
export function getRealm(): string | undefined {
|
||||
return keycloak.tokenParsed?.iss?.split('/').at(-1);
|
||||
}
|
||||
|
||||
export function getInstance() {
|
||||
return keycloak;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue