mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
build(projects): update deps and fix type error [升级依赖并修复类型问题]
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<n-breadcrumb class="px-12px">
|
||||
<template v-for="breadcrumb in breadcrumbs" :key="breadcrumb.key">
|
||||
<n-breadcrumb-item>
|
||||
<n-dropdown v-if="breadcrumb.hasChildren" :options="breadcrumb.children" @select="dropdownSelect">
|
||||
<n-dropdown v-if="breadcrumb.hasChildren" :options="breadcrumb.options" @select="dropdownSelect">
|
||||
<span>
|
||||
<component
|
||||
:is="breadcrumb.icon"
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import type { VNodeChild } from 'vue';
|
||||
import type { Component } from 'vue';
|
||||
import { useBoolean } from '@/hooks';
|
||||
|
||||
defineOptions({ name: 'MixMenuDetail' });
|
||||
@ -30,7 +30,7 @@ interface Props {
|
||||
/** 当前激活状态的理由名称 */
|
||||
activeRouteName: string;
|
||||
/** 路由图标 */
|
||||
icon?: () => VNodeChild;
|
||||
icon?: Component;
|
||||
/** mini尺寸的路由 */
|
||||
isMini?: boolean;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import type { AxiosResponse, AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import { REFRESH_TOKEN_CODE } from '@/config';
|
||||
import {
|
||||
localStg,
|
||||
@ -59,7 +59,7 @@ export default class CustomAxiosInstance {
|
||||
}
|
||||
);
|
||||
this.instance.interceptors.response.use(
|
||||
async response => {
|
||||
(async response => {
|
||||
const { status } = response;
|
||||
if (status === 200 || status < 300 || status === 304) {
|
||||
const backend = response.data;
|
||||
@ -82,7 +82,7 @@ export default class CustomAxiosInstance {
|
||||
}
|
||||
const error = handleResponseError(response);
|
||||
return handleServiceResult(error, null);
|
||||
},
|
||||
}) as (response: AxiosResponse<any, any>) => Promise<AxiosResponse<any, any>>,
|
||||
(axiosError: AxiosError) => {
|
||||
const error = handleAxiosError(axiosError);
|
||||
return handleServiceResult(error, null);
|
||||
|
5
src/typings/system.d.ts
vendored
5
src/typings/system.d.ts
vendored
@ -245,13 +245,14 @@ declare namespace App {
|
||||
};
|
||||
|
||||
/** 面包屑 */
|
||||
type GlobalBreadcrumb = import('naive-ui').DropdownOption & {
|
||||
type GlobalBreadcrumb = Omit<import('naive-ui').DropdownOption, 'icon'> & {
|
||||
key: string;
|
||||
label: string;
|
||||
disabled: boolean;
|
||||
routeName: string;
|
||||
hasChildren: boolean;
|
||||
children?: GlobalBreadcrumb[];
|
||||
icon?: import('vue').Component;
|
||||
options?: import('naive-ui/es/dropdown/src/interface').DropdownMixedOption[];
|
||||
};
|
||||
|
||||
/** 多页签Tab的路由 */
|
||||
|
@ -65,9 +65,9 @@ function transformBreadcrumbMenuToBreadcrumb(menu: App.GlobalMenuOption, rootPat
|
||||
breadcrumb.icon = menu.icon;
|
||||
}
|
||||
if (hasChildren) {
|
||||
breadcrumb.children = menu.children?.map(item =>
|
||||
breadcrumb.options = menu.children?.map(item =>
|
||||
transformBreadcrumbMenuToBreadcrumb(item as App.GlobalMenuOption, rootPath)
|
||||
);
|
||||
) as NonNullable<App.GlobalBreadcrumb['options']>;
|
||||
}
|
||||
return breadcrumb;
|
||||
}
|
||||
|
Reference in New Issue
Block a user