refactor(projects): 登录重定向地址相关重构

This commit is contained in:
Soybean
2021-10-18 18:01:14 +08:00
parent 336c7766f9
commit 04008b63ee
11 changed files with 52 additions and 52 deletions

View File

@ -41,6 +41,9 @@
<n-radio :default-checked="true" />
</n-space>
</div>
<n-space>
<n-button type="primary" @click="handleDialog">Dialog</n-button>
</n-space>
</n-space>
</n-spin>
</div>
@ -48,12 +51,23 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { NGradientText, NSpace, NButton, NSpin, NTag, NSwitch, NCheckbox, NRadio } from 'naive-ui';
import { NGradientText, NSpace, NButton, NSpin, NTag, NSwitch, NCheckbox, NRadio, useDialog } from 'naive-ui';
const dialog = useDialog();
const loading = ref(true);
setTimeout(() => {
loading.value = false;
}, 1500);
function handleDialog() {
dialog.info({
title: '提示',
content: '您确定要退出登录吗?',
positiveText: '确定',
negativeText: '取消'
});
}
</script>
<style scoped></style>

View File

@ -40,12 +40,12 @@ import type { FormInst, FormRules } from 'naive-ui';
import { EnumLoginModule } from '@/enum';
import { useThemeStore } from '@/store';
import { useRouterChange, useRouteQuery } from '@/hooks';
import { setToken, toLoginRedirectUrl } from '@/utils';
import { setToken } from '@/utils';
import { OtherLogin } from './components';
import logo from '@/assets/img/common/logo.png';
const theme = useThemeStore();
const { toHome, toCurrentLogin } = useRouterChange();
const { toHome, toCurrentLogin, toLoginRedirectUrl } = useRouterChange();
const { loginRedirectUrl } = useRouteQuery();
const notification = useNotification();