|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <a-modal width="420px" :visible="showModal" @ok="handleOk" @cancel="handleCancel" :okText="$t('login.okBtn')"
|
|
|
|
|
- :cancelText="$t('login.cancelBtn')" unmountOnClose>
|
|
|
|
|
|
|
+ <a-modal
|
|
|
|
|
+ width="420px"
|
|
|
|
|
+ :visible="showModal"
|
|
|
|
|
+ @ok="handleOk"
|
|
|
|
|
+ @cancel="handleCancel"
|
|
|
|
|
+ :okText="$t('login.okBtn')"
|
|
|
|
|
+ :cancelText="$t('login.cancelBtn')"
|
|
|
|
|
+ unmountOnClose
|
|
|
|
|
+ >
|
|
|
<template #title><icon-exclamation-circle-fill class="tips-icon" /> {{ $t('login.tip') }} </template>
|
|
<template #title><icon-exclamation-circle-fill class="tips-icon" /> {{ $t('login.tip') }} </template>
|
|
|
<div>{{ $t('login.okText') }}</div>
|
|
<div>{{ $t('login.okText') }}</div>
|
|
|
</a-modal>
|
|
</a-modal>
|
|
@@ -8,9 +15,12 @@
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { computed } from 'vue';
|
|
import { computed } from 'vue';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
|
|
-import { kuky_Authorization } from '../../../base/storage';
|
|
|
|
|
-import { resetHasRouteFlag } from '../../../router';
|
|
|
|
|
|
|
+// import { useRouter } from 'vue-router';
|
|
|
|
|
+// import { kuky_Authorization } from '../../../base/storage';
|
|
|
|
|
+// import { resetHasRouteFlag } from '../../../router';
|
|
|
|
|
+
|
|
|
|
|
+import useLogout from '../../account/use-logout';
|
|
|
|
|
+
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
visible: {
|
|
visible: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -18,15 +28,14 @@ const props = defineProps({
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
const emit = defineEmits(['update:visible']);
|
|
const emit = defineEmits(['update:visible']);
|
|
|
-const router = useRouter();
|
|
|
|
|
|
|
+// const router = useRouter();
|
|
|
const showModal = computed(() => props.visible);
|
|
const showModal = computed(() => props.visible);
|
|
|
|
|
|
|
|
|
|
+const logout = useLogout();
|
|
|
|
|
+
|
|
|
const handleOk = () => {
|
|
const handleOk = () => {
|
|
|
- kuky_Authorization.remove();
|
|
|
|
|
|
|
+ logout();
|
|
|
|
|
|
|
|
- // 重置路由守卫标志位
|
|
|
|
|
- resetHasRouteFlag();
|
|
|
|
|
- router.push({ path: '/login', replace: true });
|
|
|
|
|
emit('update:visible', false);
|
|
emit('update:visible', false);
|
|
|
};
|
|
};
|
|
|
const handleCancel = () => {
|
|
const handleCancel = () => {
|