修复重大故障: JwtAuthenticationFilter文件,远程读取用户接口导致的服务器请求数量跑满

This commit is contained in:
2025-02-22 00:00:33 +08:00
parent d61e683d41
commit def17d1de9
51 changed files with 1748 additions and 1436 deletions

View File

@@ -4,116 +4,94 @@
<div class="xl:w-screen-xl m-auto py-4 mt-20">
<el-page-header :icon="ArrowLeft" @back="goBack">
<template #content>
<span class="text-large font-600 mr-3"> {{ page.title || '客户案例' }} </span>
<span class="text-large font-600 mr-3"> 客户案例 </span>
</template>
<template #extra>
<el-space class="flex items-center">
<el-input v-model="where.keywords" style="width: 400px" :placeholder="`搜索关键词`" :suffix-icon="Search"
@change="reload"/>
</el-space>
</template>
<el-row :gutter="24" id="container" class="clearfix">
<el-col v-for="(item,index) in list" :key="index" :span="6" class="left">
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer" @click="navigateTo(`/detail/${item.articleId}.html`)">
<el-image
:src="item.image"
fit="cover"
:lazy="true" class="w-full md:h-[166px] h-[199px] cursor-pointer bg-gray-50"/>
<div class="flex-1 px-4 py-5 sm:p-6 !p-4">
<div class="text-gray-700 dark:text-white text-base font-semibold flex flex-col gap-1.5">
<div class="flex-1 text-xl cursor-pointer flex items-center">
{{ item.title }}
<el-col v-for="(item,index) in list" :key="index" :span="8" class="left mb-8">
<el-card shadow="hover" :body-style="{ padding: '0px' }" class="cursor-pointer" @mouseover="showDomain(item)"
@mouseleave="hideDomain">
<nuxt-link :to="`/market/${item.websiteId}`">
<div class="flex-1 px-4 py-5 sm:p-4 !p-4">
<div class="text-gray-700 dark:text-white text-base font-semibold flex gap-1.5">
<el-avatar
:src="item.websiteLogo" shape="square" :size="55" style="background-color: white;"/>
<div class="flex-1 text-lg cursor-pointer flex flex-col">
{{ item.websiteName }}
<div class="flex justify-between items-center">
<sapn class="text-xs text-gray-400 font-normal line-clamp-1">
{{ id == item.websiteId ? item.domain : item.comments || '暂无描述' }}
</sapn>
<el-button size="small" round>获取</el-button>
</div>
</div>
</div>
<div class="item-image pt-3">
<el-image v-if="item.files" :src="`${JSON.parse(item.files)[0]}`" class="w-full h-1/2 max-h-[220px]"/>
<el-image v-else class="w-full h-[220px]"/>
</div>
</div>
<div class="flex items-center gap-1.5 py-2 text-gray-500 justify-between">
<div class="text-gray-500 line-clamp-2">{{ item.comments }}</div>
</div>
<div class="button-group flex justify-between items-center mt-3 text-sm">
<el-space class="flex items-end">
<div class="text-gray-400 gap-1 flex items-center"><el-icon><View /></el-icon><span>{{ getViews(item) }}</span></div>
</el-space>
<div class="text-gray-400">
{{ dayjs(item.createTime).format('YYYY-MM-DD') }}
</div>
</div>
</div>
</nuxt-link>
</el-card>
</el-col>
</el-row>
</el-page-header>
<Pagination :total="total" @done="search" />
<Pagination :total="total" @done="search"/>
</div>
</template>
<script setup lang="ts">
import Banner from "@/components/Banner.vue";
import { ArrowLeft,View, Search } from '@element-plus/icons-vue'
import { ElNotification as notify } from 'element-plus'
import {useConfigInfo, useLayout, usePage} from "~/composables/configState";
import type {CmsNavigation} from "~/api/cms/cmsNavigation/model";
import type {CmsArticle, CmsArticleParam} from "~/api/cms/cmsArticle/model";
import type { ComponentSize } from 'element-plus'
import { ElNotification } from 'element-plus'
import type { TabsPaneContext } from 'element-plus'
import { h } from 'vue'
import dayjs from "dayjs";
import {detail, getNavIdByParamsId, navTo, paramsId} from "~/utils/common";
import Left from "~/components/Left.vue";
import {getCmsNavigation, listCmsNavigation} from "~/api/cms/cmsNavigation";
import {pageCmsArticle} from "~/api/cms/cmsArticle";
import {ArrowLeft, Search} from '@element-plus/icons-vue'
import type {CmsArticleParam} from "~/api/cms/cmsArticle/model";
import {pageCmsWebsiteAll} from "~/api/cms/cmsWebsite";
import type {CmsWebsite, CmsWebsiteParam} from "~/api/cms/cmsWebsite/model";
const route = useRoute();
const router = useRouter();
const navId = ref();
// 页面信息
const list = ref<CmsArticle[]>([]);
const i18n = useI18n();
const category = ref<CmsNavigation[]>([]);
const list = ref<CmsWebsite[]>([]);
const total = ref(0);
const activeName = ref('2839');
// 获取状态
const page = usePage();
const layout = useLayout();
const id = ref<number>();
// 搜索表单
const where = reactive<CmsArticleParam>({
const where = reactive<CmsWebsiteParam>({
keywords: '',
page: 1,
limit: 20,
model: 'case',
status: 0,
parentId: undefined,
limit: 12,
status: undefined,
recommend: undefined,
search: true,
websiteType: undefined,
categoryId: undefined,
lang: i18n.locale.value
lang: undefined
});
const goBack = () => {
router.back();
}
const showDomain = (item: CmsWebsite) => {
id.value = Number(item.websiteId);
};
const hideDomain = () => {
id.value = 0;
};
// 加载页面数据
const reload = async () => {
pageCmsArticle(where).then(response => {
if(response){
await pageCmsWebsiteAll(where).then(response => {
if (response?.list) {
list.value = response?.list;
total.value = response.count;
list.value = response.list;
}
}).catch(() => {
})
// seo
// useSeoMeta({
// description: data.comments || data.title,
// keywords: data.title,
// titleTemplate: `${data?.title}` + ' - %s',
// })
// 二级栏目分类
// listCmsNavigation({}).then(navigation => {
// category.value = navigation;
// // 加载文章列表
// if(data.parentId == 0 && category.value.length > 0){
// where.parentId = page.value.navigationId;
// }else {
// where.categoryId = page.value.navigationId;
// }
//
// })
}
/**
@@ -125,49 +103,15 @@ const search = (data: CmsArticleParam) => {
reload();
}
const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event)
}
const value = ref('')
const options = [
{
value: 'Option1',
label: 'Option1',
},
{
value: 'Option2',
label: 'Option2',
},
{
value: 'Option3',
label: 'Option3',
},
{
value: 'Option4',
label: 'Option4',
},
{
value: 'Option5',
label: 'Option5',
},
]
watch(
() => route.params.id,
() => {
reload();
},
{ immediate: true }
{immediate: true}
);
</script>
<style lang="scss">
.right .content img{
width: auto !important;
}
.demo-tabs > .el-tabs__content {
padding: 32px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
</style>