/* * @Author: zzd993 * @Date: 2022-08-16 10:10:32 * @LastEditors: zzd993 * @LastEditTime: 2022-08-16 12:38:39 * @FilePath: \elabnote-front-main\src\api\systemcenter\logout.ts * Copyright (c) 2022 by BMY, All Rights Reserved. */import { sysRequest } from '@/service'export const logOut = () => { return sysRequest.post({ url: '/scUser/logOut' })}
/* * @Author: zzd993 * @Date: 2022-08-16 10:57:35 * @LastEditors: zzd993 * @LastEditTime: 2022-08-16 13:48:03 * @FilePath: \elabnote-front-main\src\util\Logout\index.ts * Copyright (c) 2022 by BMY, All Rights Reserved. */import { localCache } from '@/util'import { logOut } from '@/api/systemcenter'import router from '@/router'export const LogOut = async () => { await logOut() localCache.clearCookies() await router.replace('/login') localCache.clearCache() location.reload()}
<!-- * @Author: zhangy * @Date: 2022-06-15 21:04:26 * @LastEditors: zzd993 * @LastEditTime: 2022-08-16 12:41:08 * @FilePath: \elabnote-front-main\src\views\not-found\index.vue * Copyright (c) 2022 by BMY, All Rights Reserved.--><template> <div class="container"> <!-- <Breadcrumb :items="['menu.exception', 'menu.exception.404']" /> --> <div class="content"> <a-result class="result" status="404" :subtitle="subtitle" /> <a-space v-if="!Props.isSimple"> <a-button key="again" @click="() => router.back()"> {{ $t('notFound.back') }} </a-button> <a-button key="back" type="primary" @click="skipLogin"> {{ $t('notFound.login') }} </a-button> </a-space> </div> </div></template><script setup lang="ts"> import { useRouter } from 'vue-router' import { useI18n } from 'vue-i18n' import { LogOut } from '@/util/Logout' const Props = withDefaults(defineProps<{ subtitle?: string; isSimple?: boolean }>(), { subtitle: () => useI18n().t('notFound.tipInfo'), isSimple: false }) const router = useRouter() const skipLogin = () => { LogOut() }</script><style lang="scss" scoped> .content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }</style>