style: 全局配置消息距离顶部的位置

This commit is contained in:
TsMask
2024-06-20 14:41:02 +08:00
parent 57f575aa84
commit f6644a0d97
2 changed files with 3 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import { onBeforeMount } from 'vue'; import { onBeforeMount } from 'vue';
import { ConfigProvider } from 'ant-design-vue/lib'; import { ConfigProvider, message } from 'ant-design-vue/lib';
import { CACHE_LOCAL_PRIMARY_COLOR } from '@/constants/cache-keys-constants'; import { CACHE_LOCAL_PRIMARY_COLOR } from '@/constants/cache-keys-constants';
import { localGet, localSet } from '@/utils/cache-local-utils'; import { localGet, localSet } from '@/utils/cache-local-utils';
@@ -8,6 +8,7 @@ import { localGet, localSet } from '@/utils/cache-local-utils';
*/ */
export const usePrimaryColor = () => { export const usePrimaryColor = () => {
onBeforeMount(() => { onBeforeMount(() => {
message.config({ top: '100px' }); // 全局配置消息距离顶部的位置
changePrimaryColor(getLocalColor()); changePrimaryColor(getLocalColor());
}); });
}; };

View File

@@ -47,7 +47,7 @@ function fnFinish() {
.fnLogin(toRaw(state.from)) .fnLogin(toRaw(state.from))
.then(res => { .then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('views.login.loginSuccess'), 3); message.success(t('views.login.loginSuccess'), 1);
/**登录后重定向页面 */ /**登录后重定向页面 */
const redirectPath = route.query?.redirect || '/index'; const redirectPath = route.query?.redirect || '/index';
router.push({ path: redirectPath as string }); router.push({ path: redirectPath as string });