errorPernission page

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-26 17:40:38 +07:00
parent 87f3209073
commit 24374ab8f2
3 changed files with 33 additions and 1 deletions

View file

@ -32,7 +32,8 @@ http.interceptors.response.use(
if (typeof error !== undefined) {
// eslint-disable-next-line no-prototype-builtins
if (error.hasOwnProperty("response")) {
if (error.response.status === 401 || error.response.status === 403) {
if (error.response.status === 403) {
window.location.href = "/error";
// Store.commit("SET_ERROR_MESSAGE", error.response.data.message);
// Store.commit("REMOVE_ACCESS_TOKEN")
}

View file

@ -4,6 +4,7 @@ const MainLayout = () => import("@/views/MainLayout.vue");
const Dashboard = () => import("@/modules/01_dashboard/views/Dashboard.vue");
const Error404NotFound = () => import("@/views/Error404NotFound.vue");
const loginMain = () => import("@/views/login.vue");
const ErrorPermission = () => import("@/views/ErrorPermission.vue");
import ModuleTransfer from "@/modules/02_transfer/router";
import ModuleRetire from "@/modules/03_retire/router";
@ -38,6 +39,11 @@ const router = createRouter({
Key: [7],
},
},
{
path: "/error",
name: "errorPermission",
component: ErrorPermission,
},
...ModuleTransfer,
...ModuleRetire,

View 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>