封装消息提示框,分为success, info, error级别,并全部替换
This commit is contained in:
1 parent
5df6957e15
commit
b0fda9f081
7 files changed
+306
-75
No files matched your search
@@ -19,8 +19,10 @@ import { useRoute, useRouter } from 'vue-router';
|
||||
import { config } from '../config';
|
||||
import FilePreviewModal from '../components/FilePreviewModal.vue';
|
||||
import ThemeToggleButton from '../components/ThemeToggleButton.vue';
|
||||
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { showMessageDialog } = useGlobalMessageDialog();
|
||||
|
||||
const renderMarkdown = (text: string) => {
|
||||
if (!text) return '';
|
||||
@@ -450,7 +452,7 @@ const loadAgent = async () => {
|
||||
currentAgent.value = await res.json();
|
||||
} else {
|
||||
if (res.status === 403) {
|
||||
alert(t('workspace.permission.denied') || 'Access denied');
|
||||
showMessageDialog('error', t('workspace.permission.denied') || 'Access denied');
|
||||
router.push('/');
|
||||
return;
|
||||
}
|
||||
@@ -494,7 +496,7 @@ const feedbackSubmitted = ref(false);
|
||||
const submitFeedback = async () => {
|
||||
if (!enableFeedback.value || feedbackSubmitted.value) return;
|
||||
if (!rating.value) {
|
||||
alert(t('chat.feedback.selectRating'));
|
||||
showMessageDialog('warning', t('chat.feedback.selectRating'));
|
||||
return;
|
||||
}
|
||||
const res = await fetch('/api/chat/feedback', {
|
||||
|
||||
Reference in new issue
Block a user