page errorPernission
This commit is contained in:
parent
e09d0afe73
commit
bc29de9f1c
3 changed files with 33 additions and 1 deletions
|
|
@ -32,7 +32,8 @@ http.interceptors.response.use(
|
||||||
if (typeof error !== undefined) {
|
if (typeof error !== undefined) {
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
// eslint-disable-next-line no-prototype-builtins
|
||||||
if (error.hasOwnProperty("response")) {
|
if (error.hasOwnProperty("response")) {
|
||||||
if (error.response.status === 401 || error.response.status === 403) {
|
if (error.response.status === 403) {
|
||||||
|
window.location.href = "/error";
|
||||||
// kcLogout();
|
// kcLogout();
|
||||||
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
|
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
|
||||||
// Store.commit("REMOVE_ACCESS_TOKEN")
|
// Store.commit("REMOVE_ACCESS_TOKEN")
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ const MainLayout = () => import("@/views/MainLayout.vue");
|
||||||
const Dashboard = () => import("@/views/Dashboard.vue");
|
const Dashboard = () => import("@/views/Dashboard.vue");
|
||||||
const Error404NotFound = () => import("@/views/Error404NotFound.vue");
|
const Error404NotFound = () => import("@/views/Error404NotFound.vue");
|
||||||
const loginView = () => import("@/views/login.vue");
|
const loginView = () => import("@/views/login.vue");
|
||||||
|
const ErrorPermission = () => import("@/views/ErrorPermission.vue");
|
||||||
|
|
||||||
// import ModuleMetadata from "@/modules/01_metadata/router";
|
// import ModuleMetadata from "@/modules/01_metadata/router";
|
||||||
import ModuleMetadataNew from "@/modules/01_masterdata/router";
|
import ModuleMetadataNew from "@/modules/01_masterdata/router";
|
||||||
|
|
@ -47,6 +48,11 @@ const router = createRouter({
|
||||||
Key: "HOME",
|
Key: "HOME",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/error",
|
||||||
|
name: "errorPermission",
|
||||||
|
component: ErrorPermission,
|
||||||
|
},
|
||||||
// ...ModuleMetadata,
|
// ...ModuleMetadata,
|
||||||
...ModuleMetadataNew,
|
...ModuleMetadataNew,
|
||||||
// ...ModuleOrganizational,
|
// ...ModuleOrganizational,
|
||||||
|
|
|
||||||
25
src/views/ErrorPermission.vue
Normal file
25
src/views/ErrorPermission.vue
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="bg-white text-center q-pa-md flex flex-center"
|
||||||
|
style="height: 90vh"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div class="text-h3">
|
||||||
|
<q-icon name="mdi-alert-outline" color="red" /> ไม่พบข้อมูลที่ต้องการ
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
class="q-mt-xl"
|
||||||
|
color="primary"
|
||||||
|
text-color="white"
|
||||||
|
to="/"
|
||||||
|
label="กลับหน้าหลัก"
|
||||||
|
no-caps
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue