feat: 前端打包报错处理
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -265,6 +265,7 @@ src/Acme.BookStore.Blazor.Server.Tiered/Logs/*
|
||||
**/wwwroot/libs/*
|
||||
public
|
||||
dist
|
||||
dist - 副本
|
||||
.vscode
|
||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
|
||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json
|
||||
|
||||
@@ -1,52 +1,53 @@
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { getActivityDetail } from '@/api'
|
||||
import type { ActivityDetailResponse } from '@/api'
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
// import { getActivityDetail } from '@/api'
|
||||
// import type { ActivityDetailResponse } from '@/api'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const loading = ref(false)
|
||||
const activityDetail = ref<ActivityDetailResponse | null>(null)
|
||||
const loading = ref(false);
|
||||
// const activityDetail = ref<ActivityDetailResponse | null>(null)
|
||||
const activityDetail = ref<any | null>(null);
|
||||
|
||||
// 获取活动详情
|
||||
async function fetchActivityDetail() {
|
||||
const id = route.params.id as string
|
||||
const id = route.params.id as string;
|
||||
if (!id)
|
||||
return
|
||||
return;
|
||||
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getActivityDetail(id)
|
||||
activityDetail.value = res.data
|
||||
// const res = await getActivityDetail(id)
|
||||
// activityDetail.value = res.data
|
||||
}
|
||||
catch (error) {
|
||||
console.error('获取活动详情失败:', error)
|
||||
ElMessage.error('获取活动详情失败')
|
||||
console.error('获取活动详情失败:', error);
|
||||
ElMessage.error('获取活动详情失败');
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
function goBack() {
|
||||
router.back()
|
||||
router.back();
|
||||
}
|
||||
|
||||
// 格式化时间
|
||||
function formatDateTime(time?: string) {
|
||||
if (!time)
|
||||
return '-'
|
||||
const date = new Date(time)
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
||||
return '-';
|
||||
const date = new Date(time);
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
// 页面加载时获取详情
|
||||
onMounted(() => {
|
||||
fetchActivityDetail()
|
||||
})
|
||||
fetchActivityDetail();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -64,7 +65,9 @@ onMounted(() => {
|
||||
<div v-if="activityDetail" class="detail-content">
|
||||
<!-- 活动头部 -->
|
||||
<div class="detail-header">
|
||||
<h1 class="detail-title">{{ activityDetail.title }}</h1>
|
||||
<h1 class="detail-title">
|
||||
{{ activityDetail.title }}
|
||||
</h1>
|
||||
<div class="detail-meta">
|
||||
<el-tag
|
||||
v-if="activityDetail.status === 'active'"
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { getAnnouncementDetail } from '@/api'
|
||||
import type { AnnouncementDetailResponse } from '@/api'
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
// import { getAnnouncementDetail } from '@/api'
|
||||
// import type { AnnouncementDetailResponse } from '@/api'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const loading = ref(false)
|
||||
const announcementDetail = ref<AnnouncementDetailResponse | null>(null)
|
||||
const loading = ref(false);
|
||||
const announcementDetail = ref<any | null>(null);
|
||||
|
||||
// 获取公告详情
|
||||
async function fetchAnnouncementDetail() {
|
||||
const id = route.params.id as string
|
||||
const id = route.params.id as string;
|
||||
if (!id)
|
||||
return
|
||||
return;
|
||||
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getAnnouncementDetail(id)
|
||||
announcementDetail.value = res.data
|
||||
// const res = await getAnnouncementDetail(id)
|
||||
// announcementDetail.value = res.data
|
||||
}
|
||||
catch (error) {
|
||||
console.error('获取公告详情失败:', error)
|
||||
ElMessage.error('获取公告详情失败')
|
||||
console.error('获取公告详情失败:', error);
|
||||
ElMessage.error('获取公告详情失败');
|
||||
}
|
||||
finally {
|
||||
loading.value = false
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
function goBack() {
|
||||
router.back()
|
||||
router.back();
|
||||
}
|
||||
|
||||
// 格式化时间
|
||||
function formatDateTime(time?: string) {
|
||||
if (!time)
|
||||
return '-'
|
||||
const date = new Date(time)
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
||||
return '-';
|
||||
const date = new Date(time);
|
||||
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
// 页面加载时获取详情
|
||||
onMounted(() => {
|
||||
fetchAnnouncementDetail()
|
||||
})
|
||||
fetchAnnouncementDetail();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
4
Yi.Ai.Vue3/types/components.d.ts
vendored
4
Yi.Ai.Vue3/types/components.d.ts
vendored
@@ -11,7 +11,6 @@ declare module 'vue' {
|
||||
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
|
||||
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
||||
CardFlipActivity: typeof import('./../src/components/userPersonalCenter/components/CardFlipActivity.vue')['default']
|
||||
CardFlipActivity2: typeof import('./../src/components/userPersonalCenter/components/CardFlipActivity2.vue')['default']
|
||||
DailyTask: typeof import('./../src/components/userPersonalCenter/components/DailyTask.vue')['default']
|
||||
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||
@@ -20,11 +19,8 @@ declare module 'vue' {
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElCarousel: typeof import('element-plus/es')['ElCarousel']
|
||||
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
|
||||
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||
|
||||
Reference in New Issue
Block a user