修复重大故障: 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,59 +4,51 @@
<template #content>
<span class="text-large font-600 mr-3"> 实名认证 </span>
</template>
<div class="login-layout m-auto mt-10 sm:w-screen-xl w-full">
<div class="m-auto flex sm:flex-row flex-col sm:px-0 px-3 ">
<!-- 用户菜单 -->
<!-- <UserMenu :activeIndex="activeIndex" @done="reload"/>-->
<div class="flash bg-white rounded-lg w-full">
<div class="sm:w-screen-md w-full sm:px-4 sm:py-2">
<Auth @done="reload"/>
<el-card shadow="hover" class="my-10 px-2">
<el-row :gutter="30" justify="space-between">
<el-col :span="16">
<Auth @done="reload"/>
</el-col>
<el-col :span="5">
<div class="w-full mt-2 text-center" v-if="isCheck">
<el-alert type="warning" :closable="false" :title="`扫二维码完成实名认证`" />
<el-image :src="config.wxQrcode" shape="square" class="mt-2" />
</div>
</div>
</div>
</div>
</el-col>
</el-row>
</el-card>
</el-page-header>
</div>
</template>
<script setup lang="ts">
import { ArrowLeft,View,Search } from '@element-plus/icons-vue'
import {useConfigInfo, useWebsite} from "~/composables/configState";
import {useConfigInfo} from "~/composables/configState";
import {ref} from 'vue'
import {useServerRequest} from "~/composables/useServerRequest";
import type {ApiResult} from "~/api";
import UserMenu from "./components/UserMenu.vue";
import Auth from './components/Auth.vue';
import type {ShopMerchantApply} from "~/api/shop/shopMerchantApply/model";
import {COMMON_API_URL} from "~/config";
// 配置信息
const runtimeConfig = useRuntimeConfig();
const route = useRoute();
const router = useRouter();
const activeIndex = ref('');
const website = useWebsite()
const config = useConfigInfo();
const merchantApply = ref<ShopMerchantApply>();
const isCheck = ref(true);
const reload = async () => {
const reload = async (status?: boolean) => {
// 未登录状态(是否强制登录)
const token = localStorage.getItem('token');
if (!token || token == '') {
navigateTo('/passport/login');
return false;
}
const {data: response} = await useServerRequest<ApiResult<ShopMerchantApply>>(COMMON_API_URL + '/shop/shop-merchant-apply/getByUserId', {baseURL: runtimeConfig.public.apiServer})
if (response.value?.data) {
merchantApply.value = response.value.data;
}
if(config.value){
useHead({
title: `实名认证 - ${config.value?.siteName}`,
meta: [{name: website.value.keywords, content: website.value.comments}]
});
}
}
if(status){
isCheck.value = false
}
useHead({
title: `实名认证 - ${config.value?.siteName}`
});
}
const goBack = () => {
router.back(); // 返回上一页