replace ElMessageBox(alert, confirm) with alert dialog

This commit is contained in:
pa
2026-01-13 22:40:13 +09:00
committed by Natsumi
parent 870c7a4938
commit fc5afe9e69
53 changed files with 1250 additions and 862 deletions

View File

@@ -1,4 +1,3 @@
import { ElMessageBox } from 'element-plus';
import { toast } from 'vue-sonner';
import Noty from 'noty';
@@ -6,6 +5,7 @@ import Noty from 'noty';
import {
useAuthStore,
useAvatarStore,
useModalStore,
useNotificationStore,
useUpdateLoopStore,
useUserStore
@@ -33,6 +33,7 @@ export function request(endpoint, options) {
const userStore = useUserStore();
const avatarStore = useAvatarStore();
const authStore = useAuthStore();
const modalStore = useModalStore();
const notificationStore = useNotificationStore();
const updateLoopStore = useUpdateLoopStore();
if (
@@ -187,10 +188,10 @@ export function request(endpoint, options) {
}
}
if (status === 403 && endpoint === 'config') {
ElMessageBox.alert(
t('api.error.message.vpn_in_use'),
`403 ${t('api.error.message.login_error')}`
).catch(() => {});
modalStore.alert({
description: t('api.error.message.vpn_in_use'),
title: `403 ${t('api.error.message.login_error')}`
});
authStore.handleLogoutEvent();
$throw(403, endpoint);
}