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