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/*
|
**/wwwroot/libs/*
|
||||||
public
|
public
|
||||||
dist
|
dist
|
||||||
|
dist - 副本
|
||||||
.vscode
|
.vscode
|
||||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
|
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Development.json
|
||||||
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json
|
/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.Production.json
|
||||||
|
|||||||
@@ -1,52 +1,53 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus';
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { getActivityDetail } from '@/api'
|
// import { getActivityDetail } from '@/api'
|
||||||
import type { ActivityDetailResponse } from '@/api'
|
// import type { ActivityDetailResponse } from '@/api'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute();
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const activityDetail = ref<ActivityDetailResponse | null>(null)
|
// const activityDetail = ref<ActivityDetailResponse | null>(null)
|
||||||
|
const activityDetail = ref<any | null>(null);
|
||||||
|
|
||||||
// 获取活动详情
|
// 获取活动详情
|
||||||
async function fetchActivityDetail() {
|
async function fetchActivityDetail() {
|
||||||
const id = route.params.id as string
|
const id = route.params.id as string;
|
||||||
if (!id)
|
if (!id)
|
||||||
return
|
return;
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await getActivityDetail(id)
|
// const res = await getActivityDetail(id)
|
||||||
activityDetail.value = res.data
|
// activityDetail.value = res.data
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error('获取活动详情失败:', error)
|
console.error('获取活动详情失败:', error);
|
||||||
ElMessage.error('获取活动详情失败')
|
ElMessage.error('获取活动详情失败');
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
function goBack() {
|
function goBack() {
|
||||||
router.back()
|
router.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 格式化时间
|
// 格式化时间
|
||||||
function formatDateTime(time?: string) {
|
function formatDateTime(time?: string) {
|
||||||
if (!time)
|
if (!time)
|
||||||
return '-'
|
return '-';
|
||||||
const date = new Date(time)
|
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 `${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(() => {
|
onMounted(() => {
|
||||||
fetchActivityDetail()
|
fetchActivityDetail();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -64,7 +65,9 @@ onMounted(() => {
|
|||||||
<div v-if="activityDetail" class="detail-content">
|
<div v-if="activityDetail" class="detail-content">
|
||||||
<!-- 活动头部 -->
|
<!-- 活动头部 -->
|
||||||
<div class="detail-header">
|
<div class="detail-header">
|
||||||
<h1 class="detail-title">{{ activityDetail.title }}</h1>
|
<h1 class="detail-title">
|
||||||
|
{{ activityDetail.title }}
|
||||||
|
</h1>
|
||||||
<div class="detail-meta">
|
<div class="detail-meta">
|
||||||
<el-tag
|
<el-tag
|
||||||
v-if="activityDetail.status === 'active'"
|
v-if="activityDetail.status === 'active'"
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus';
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { getAnnouncementDetail } from '@/api'
|
// import { getAnnouncementDetail } from '@/api'
|
||||||
import type { AnnouncementDetailResponse } from '@/api'
|
// import type { AnnouncementDetailResponse } from '@/api'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute();
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const announcementDetail = ref<AnnouncementDetailResponse | null>(null)
|
const announcementDetail = ref<any | null>(null);
|
||||||
|
|
||||||
// 获取公告详情
|
// 获取公告详情
|
||||||
async function fetchAnnouncementDetail() {
|
async function fetchAnnouncementDetail() {
|
||||||
const id = route.params.id as string
|
const id = route.params.id as string;
|
||||||
if (!id)
|
if (!id)
|
||||||
return
|
return;
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await getAnnouncementDetail(id)
|
// const res = await getAnnouncementDetail(id)
|
||||||
announcementDetail.value = res.data
|
// announcementDetail.value = res.data
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error('获取公告详情失败:', error)
|
console.error('获取公告详情失败:', error);
|
||||||
ElMessage.error('获取公告详情失败')
|
ElMessage.error('获取公告详情失败');
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
function goBack() {
|
function goBack() {
|
||||||
router.back()
|
router.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 格式化时间
|
// 格式化时间
|
||||||
function formatDateTime(time?: string) {
|
function formatDateTime(time?: string) {
|
||||||
if (!time)
|
if (!time)
|
||||||
return '-'
|
return '-';
|
||||||
const date = new Date(time)
|
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 `${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(() => {
|
onMounted(() => {
|
||||||
fetchAnnouncementDetail()
|
fetchAnnouncementDetail();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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']
|
AccountPassword: typeof import('./../src/components/LoginDialog/components/FormLogin/AccountPassword.vue')['default']
|
||||||
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
APIKeyManagement: typeof import('./../src/components/userPersonalCenter/components/APIKeyManagement.vue')['default']
|
||||||
CardFlipActivity: typeof import('./../src/components/userPersonalCenter/components/CardFlipActivity.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']
|
DailyTask: typeof import('./../src/components/userPersonalCenter/components/DailyTask.vue')['default']
|
||||||
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
|
||||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||||
@@ -20,11 +19,8 @@ declare module 'vue' {
|
|||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
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']
|
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
||||||
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
||||||
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
|
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||||
|
|||||||
Reference in New Issue
Block a user