เพิ่มปุ่มกลับ Landing Page
This commit is contained in:
parent
9d253e517c
commit
bd033e6131
1 changed files with 31 additions and 2 deletions
|
|
@ -11,6 +11,11 @@ import { tokenParsed, logout } from "@/plugins/auth";
|
|||
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
// landing page config url
|
||||
const configParam = {
|
||||
landingPageUrl: import.meta.env.VITE_URL_SSO,
|
||||
};
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
|
|
@ -212,9 +217,9 @@ const handleButtonClick = async () => {
|
|||
const currentPath = route.name;
|
||||
const queryParams = { role: "user" }; // Replace with your query parameters
|
||||
const queryString = new URLSearchParams(queryParams).toString();
|
||||
const type = await dataStore.getProFileType()
|
||||
const type = await dataStore.getProFileType();
|
||||
// Assuming config.generatePopupPath() returns a base URL
|
||||
const popupBasePath = config.generatePopupPath(currentPath,type);
|
||||
const popupBasePath = config.generatePopupPath(currentPath, type);
|
||||
|
||||
if (popupBasePath) {
|
||||
const popupPath = `${popupBasePath}?${queryString}`;
|
||||
|
|
@ -227,6 +232,17 @@ const handleButtonClick = async () => {
|
|||
function onInfo() {
|
||||
router.push(`/retire`);
|
||||
}
|
||||
|
||||
// landing page redirect
|
||||
const landingPageUrl = () => {
|
||||
if (window.location.hostname === "bmasso.bma.go.th") {
|
||||
return `${configParam.landingPageUrl}/landing?mode=dev`;
|
||||
} else if (window.location.hostname === "bma-ehr.frappet.com") {
|
||||
return `${configParam.landingPageUrl}/landing?mode=prod`;
|
||||
} else {
|
||||
return `${configParam.landingPageUrl}/landing?mode=dev`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- โครงเว็บ -->
|
||||
|
|
@ -484,6 +500,19 @@ function onInfo() {
|
|||
</q-item>
|
||||
</template>
|
||||
<q-list>
|
||||
<q-item clickable v-close-popup :href="landingPageUrl">
|
||||
<q-item-section avatar style="min-width: 30px">
|
||||
<q-avatar
|
||||
color="blue"
|
||||
text-color="white"
|
||||
icon="home"
|
||||
size="18px"
|
||||
font-size="14px"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section> Landing Page </q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item clickable v-close-popup @click="onInfo">
|
||||
<q-item-section avatar style="min-width: 30px">
|
||||
<q-icon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue