第一次

This commit is contained in:
PC-202306242200\Administrator
2024-09-10 16:47:49 +08:00
parent 4988491b1c
commit d4720a32e1
419 changed files with 59630 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { Outlet, useOutletContext } from 'umi';
export default function EmptyRoute() {
const context = useOutletContext();
return <Outlet context={context} />;
}

View File

@@ -0,0 +1,21 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import type { IRuntimeConfig as Plugin0 } from 'D:/project/xdnyAdmin/src/.umi/plugin-antd/runtimeConfig.d'
import type { IRuntimeConfig as Plugin1 } from 'D:/project/xdnyAdmin/src/.umi/plugin-initialState/runtimeConfig.d'
import type { IRuntimeConfig as Plugin2 } from 'D:/project/xdnyAdmin/src/.umi/plugin-layout/runtimeConfig.d'
import type { IRuntimeConfig as Plugin3 } from 'D:/project/xdnyAdmin/src/.umi/plugin-locale/runtimeConfig.d'
import type { IRuntimeConfig as Plugin4 } from 'D:/project/xdnyAdmin/src/.umi/plugin-request/runtimeConfig.d'
interface IDefaultRuntimeConfig {
onRouteChange?: (props: { routes: any, clientRoutes: any, location: any, action: any, isFirst: boolean }) => void;
patchRoutes?: (props: { routes: any }) => void;
patchClientRoutes?: (props: { routes: any }) => void;
render?: (oldRender: () => void) => void;
rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void;
[key: string]: any;
}
export type RuntimeConfig = IDefaultRuntimeConfig & Plugin0 & Plugin1 & Plugin2 & Plugin3 & Plugin4
export function defineApp(config: RuntimeConfig): RuntimeConfig {
return config;
}

10
src/.umi/core/helmet.ts Normal file
View File

@@ -0,0 +1,10 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { HelmetProvider } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
import { context } from './helmetContext';
export const innerProvider = (container) => {
return React.createElement(HelmetProvider, { context }, container);
}

View File

@@ -0,0 +1,4 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export const context = {};

66
src/.umi/core/history.ts Normal file
View File

@@ -0,0 +1,66 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { createHashHistory, createMemoryHistory, createBrowserHistory } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
import type { UmiHistory } from './historyIntelli';
let history: UmiHistory;
let basename: string = '/';
export function createHistory(opts: any) {
let h;
if (opts.type === 'hash') {
h = createHashHistory();
} else if (opts.type === 'memory') {
h = createMemoryHistory(opts);
} else {
h = createBrowserHistory();
}
if (opts.basename) {
basename = opts.basename;
}
history = {
...h,
push(to, state) {
h.push(patchTo(to, h), state);
},
replace(to, state) {
h.replace(patchTo(to, h), state);
},
get location() {
return h.location;
},
get action() {
return h.action;
}
}
return h;
}
// Patch `to` to support basename
// Refs:
// https://github.com/remix-run/history/blob/3e9dab4/packages/history/index.ts#L484
// https://github.com/remix-run/history/blob/dev/docs/api-reference.md#to
function patchTo(to: any, h: History) {
if (typeof to === 'string') {
return `${stripLastSlash(basename)}${to}`;
} else if (typeof to === 'object') {
const currentPathname = h.location.pathname;
return {
...to,
pathname: to.pathname? `${stripLastSlash(basename)}${to.pathname}` : currentPathname,
};
} else {
throw new Error(`Unexpected to: ${to}`);
}
}
function stripLastSlash(path) {
return path.slice(-1) === '/' ? path.slice(0, -1) : path;
}
export { history };

View File

@@ -0,0 +1,132 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { getRoutes } from './route'
import type { History } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react'
type Routes = Awaited<ReturnType<typeof getRoutes>>['routes']
type AllRoute = Routes[keyof Routes]
type IsRoot<T extends any> = 'parentId' extends keyof T ? false : true
// show `/` in not `layout / wrapper` only
type GetAllRouteWithoutLayout<Item extends AllRoute> = Item extends any
? 'isWrapper' extends keyof Item
? never
: 'isLayout' extends keyof Item
? never
: Item
: never
type AllRouteWithoutLayout = GetAllRouteWithoutLayout<AllRoute>
type IndexRoutePathname = '/' extends AllRouteWithoutLayout['path']
? '/'
: never
type GetChildrens<T extends any> = T extends any
? IsRoot<T> extends true
? never
: T
: never
type Childrens = GetChildrens<AllRoute>
type Root = Exclude<AllRoute, Childrens>
type AllIds = AllRoute['id']
type GetChildrensByParentId<
Id extends AllIds,
Item = AllRoute
> = Item extends any
? 'parentId' extends keyof Item
? Item['parentId'] extends Id
? Item
: never
: never
: never
type RouteObject<
Id extends AllIds,
Item = GetChildrensByParentId<Id>
> = IsNever<Item> extends true
? ''
: Item extends AllRoute
? {
[Key in Item['path'] as TrimSlash<Key>]: UnionMerge<
RouteObject<Item['id']>
>
}
: never
type GetRootRouteObject<Item extends Root> = Item extends Root
? {
[K in Item['path'] as TrimSlash<K>]: UnionMerge<RouteObject<Item['id']>>
}
: never
type MergedResult = UnionMerge<GetRootRouteObject<Root>>
// --- patch history types ---
type HistoryTo = Parameters<History['push']>['0']
type HistoryPath = Exclude<HistoryTo, string>
type UmiPathname = Path<MergedResult> | (string & {})
interface UmiPath extends HistoryPath {
pathname: UmiPathname
}
type UmiTo = UmiPathname | UmiPath
type UmiPush = (to: UmiTo, state?: any) => void
type UmiReplace = (to: UmiTo, state?: any) => void
export interface UmiHistory extends History {
push: UmiPush
replace: UmiReplace
}
// --- type utils ---
type TrimLeftSlash<T extends string> = T extends `/${infer R}`
? TrimLeftSlash<R>
: T
type TrimRightSlash<T extends string> = T extends `${infer R}/`
? TrimRightSlash<R>
: T
type TrimSlash<T extends string> = TrimLeftSlash<TrimRightSlash<T>>
type IsNever<T> = [T] extends [never] ? true : false
type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B
? 1
: 2
? true
: false
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
k: infer I
) => void
? I
: never
type UnionMerge<U> = UnionToIntersection<U> extends infer O
? { [K in keyof O]: O[K] }
: never
type ExcludeEmptyKey<T> = IsEqual<T, ''> extends true ? never : T
type PathConcat<
TKey extends string,
TValue,
N = TrimSlash<TKey>
> = TValue extends string
? ExcludeEmptyKey<N>
:
| ExcludeEmptyKey<N>
| `${N & string}${IsNever<ExcludeEmptyKey<N>> extends true
? ''
: '/'}${UnionPath<TValue>}`
type UnionPath<T> = {
[K in keyof T]-?: PathConcat<K & string, T[K]>
}[keyof T]
type MakeSureLeftSlash<T> = T extends any
? `/${TrimRightSlash<T & string>}`
: never
// exclude `/*`, because it always at the top of the IDE tip list
type Path<T, K = UnionPath<T>> = Exclude<MakeSureLeftSlash<K>, '/*'> | IndexRoutePathname

70
src/.umi/core/plugin.ts Normal file
View File

@@ -0,0 +1,70 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import * as Plugin_0 from 'D:/project/xdnyAdmin/src/app.tsx';
import * as Plugin_1 from '@@/core/helmet.ts';
import * as Plugin_2 from 'D:/project/xdnyAdmin/src/.umi/plugin-access/runtime.tsx';
import * as Plugin_3 from 'D:/project/xdnyAdmin/src/.umi/plugin-initialState/runtime.tsx';
import * as Plugin_4 from 'D:/project/xdnyAdmin/src/.umi/plugin-layout/runtime.tsx';
import * as Plugin_5 from 'D:/project/xdnyAdmin/src/.umi/plugin-locale/runtime.tsx';
import * as Plugin_6 from 'D:/project/xdnyAdmin/src/.umi/plugin-model/runtime.tsx';
import { PluginManager } from 'umi';
function __defaultExport (obj) {
if (obj.default) {
return typeof obj.default === 'function' ? obj.default() : obj.default
}
return obj;
}
export function getPlugins() {
return [
{
apply: __defaultExport(Plugin_0),
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/app.tsx',
},
{
apply: Plugin_1,
path: process.env.NODE_ENV === 'production' ? void 0 : '@@/core/helmet.ts',
},
{
apply: Plugin_2,
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/.umi/plugin-access/runtime.tsx',
},
{
apply: Plugin_3,
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/.umi/plugin-initialState/runtime.tsx',
},
{
apply: Plugin_4,
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/.umi/plugin-layout/runtime.tsx',
},
{
apply: Plugin_5,
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/.umi/plugin-locale/runtime.tsx',
},
{
apply: Plugin_6,
path: process.env.NODE_ENV === 'production' ? void 0 : 'D:/project/xdnyAdmin/src/.umi/plugin-model/runtime.tsx',
},
];
}
export function getValidKeys() {
return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange','antd','getInitialState','layout','locale','qiankun','request',];
}
let pluginManager = null;
export function createPluginManager() {
pluginManager = PluginManager.create({
plugins: getPlugins(),
validKeys: getValidKeys(),
});
return pluginManager;
}
export function getPluginManager() {
return pluginManager;
}

View File

@@ -0,0 +1,368 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { IConfigFromPluginsJoi } from "./pluginConfigJoi.d";
interface IConfigTypes {
codeSplitting: {
jsStrategy: "bigVendors" | "depPerChunk" | "granularChunks";
jsStrategyOptions?: ({
} | undefined);
cssStrategy?: ("mergeAll" | undefined);
cssStrategyOptions?: ({
} | undefined);
};
title: string;
styles: Array<string | {
src?: (string | undefined);
} | {
content?: (string | undefined);
} | { [x: string]: any }>;
scripts: Array<string | {
src?: (string | undefined);
} | {
content?: (string | undefined);
} | { [x: string]: any }>;
routes: Array<{
component?: (string | undefined);
layout?: (false | undefined);
path?: (string | undefined);
redirect?: (string | undefined);
routes?: IConfigTypes['routes'];
wrappers?: (Array<string> | undefined);
} | { [x: string]: any }>;
routeLoader: {
moduleType: "esm" | "cjs";
};
reactRouter5Compat: boolean | {
};
presets: Array<string>;
plugins: Array<string>;
npmClient: "pnpm" | "tnpm" | "cnpm" | "yarn" | "npm";
mountElementId: string;
metas: Array<{
charset?: (string | undefined);
content?: (string | undefined);
"http-equiv"?: (string | undefined);
name?: (string | undefined);
} | { [x: string]: any }>;
links: Array<{
crossorigin?: (string | undefined);
href?: (string | undefined);
hreflang?: (string | undefined);
media?: (string | undefined);
referrerpolicy?: (string | undefined);
rel?: (string | undefined);
sizes?: (any | undefined);
title?: (any | undefined);
type?: (any | undefined);
} | { [x: string]: any }>;
historyWithQuery: {
};
history: {
type: "browser" | "hash" | "memory";
};
headScripts: Array<string | {
src?: (string | undefined);
} | {
content?: (string | undefined);
} | { [x: string]: any }>;
esbuildMinifyIIFE: boolean;
conventionRoutes: {
base?: (string | undefined);
exclude?: (Array<any> | undefined);
};
conventionLayout: boolean;
base: string;
analyze: {
};
writeToDisk: boolean;
theme: { [x: string]: any };
targets: { [x: string]: any };
svgr: { [x: string]: any };
svgo: { [x: string]: any } | boolean;
stylusLoader: { [x: string]: any };
styleLoader: { [x: string]: any };
srcTranspilerOptions: {
esbuild?: ({ [x: string]: any } | undefined);
swc?: ({ [x: string]: any } | undefined);
};
srcTranspiler: "babel" | "esbuild" | "swc";
sassLoader: { [x: string]: any };
runtimePublicPath: {
};
purgeCSS: { [x: string]: any };
publicPath: string;
proxy: { [x: string]: any } | Array<any>;
postcssLoader: { [x: string]: any };
outputPath: string;
normalCSSLoaderModules: { [x: string]: any };
mfsu: {
cacheDirectory?: (string | undefined);
chainWebpack?: (((...args: any[]) => unknown) | undefined);
esbuild?: (boolean | undefined);
exclude?: (Array<string | any> | undefined);
include?: (Array<string> | undefined);
mfName?: (string | undefined);
remoteAliases?: (Array<string> | undefined);
remoteName?: (string | undefined);
runtimePublicPath?: (boolean | undefined);
shared?: ({ [x: string]: any } | undefined);
strategy?: ("eager" | "normal" | undefined);
} | boolean;
mdx: {
loader?: (string | undefined);
loaderOptions?: ({ [x: string]: any } | undefined);
};
manifest: {
basePath?: (string | undefined);
fileName?: (string | undefined);
};
lessLoader: { [x: string]: any };
jsMinifierOptions: { [x: string]: any };
jsMinifier: "esbuild" | "swc" | "terser" | "uglifyJs" | "none";
inlineLimit: number;
ignoreMomentLocale: boolean;
https: {
cert?: (string | undefined);
hosts?: (Array<string> | undefined);
http2?: (boolean | undefined);
key?: (string | undefined);
};
hash: boolean;
forkTSChecker: { [x: string]: any };
fastRefresh: boolean;
extraPostCSSPlugins: Array<any>;
extraBabelPresets: Array<string | Array<any>>;
extraBabelPlugins: Array<string | Array<any>>;
extraBabelIncludes: Array<string | any>;
externals: { [x: string]: any } | string | ((...args: any[]) => unknown);
esm: {
};
devtool: "cheap-source-map" | "cheap-module-source-map" | "eval" | "eval-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | "source-map" | "hidden-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "inline-source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | boolean;
depTranspiler: "babel" | "esbuild" | "swc" | "none";
define: { [x: string]: any };
deadCode: {
context?: (string | undefined);
detectUnusedExport?: (boolean | undefined);
detectUnusedFiles?: (boolean | undefined);
exclude?: (Array<string> | undefined);
failOnHint?: (boolean | undefined);
patterns?: (Array<string> | undefined);
};
cssPublicPath: string;
cssMinifierOptions: { [x: string]: any };
cssMinifier: "cssnano" | "esbuild" | "parcelCSS" | "none";
cssLoaderModules: { [x: string]: any };
cssLoader: { [x: string]: any };
copy: Array<{
from: string;
to: string;
} | string>;
checkDepCssModules?: boolean;
cacheDirectoryPath: string;
babelLoaderCustomize: string;
autoprefixer: { [x: string]: any };
autoCSSModules: boolean;
alias: { [x: string]: any };
crossorigin: boolean | {
includes?: (Array<any> | undefined);
};
esmi: {
cdnOrigin: string;
shimUrl?: (string | undefined);
};
exportStatic: {
extraRoutePaths?: (((...args: any[]) => unknown) | Array<string> | undefined);
ignorePreRenderError?: (boolean | undefined);
};
favicons: Array<string>;
helmet: boolean;
icons: {
autoInstall?: ({
} | undefined);
defaultComponentConfig?: ({
} | undefined);
alias?: ({
} | undefined);
include?: (Array<string> | undefined);
};
mock: {
exclude?: (Array<string> | undefined);
include?: (Array<string> | undefined);
};
mpa: {
template?: (string | undefined);
layout?: (string | undefined);
getConfigFromEntryFile?: (boolean | undefined);
entry?: ({
} | undefined);
};
phantomDependency: {
exclude?: (Array<string> | undefined);
};
polyfill: {
imports?: (Array<string> | undefined);
};
routePrefetch: {
};
terminal: {
};
tmpFiles: boolean;
clientLoader: {
};
routeProps: {
};
ssr: {
serverBuildPath?: (string | undefined);
platform?: (string | undefined);
builder?: ("esbuild" | "webpack" | undefined);
};
lowImport: {
libs?: (Array<any> | undefined);
css?: (string | undefined);
};
vite: {
};
apiRoute: {
platform?: (string | undefined);
};
monorepoRedirect: boolean | {
srcDir?: (Array<string> | undefined);
exclude?: (Array<any> | undefined);
peerDeps?: (boolean | undefined);
};
test: {
};
clickToComponent: {
/** 默认情况下点击将默认编辑器为vscode, 你可以设置编辑器 vscode 或者 vscode-insiders */
editor?: (string | undefined);
};
legacy: {
buildOnly?: (boolean | undefined);
nodeModulesTransform?: (boolean | undefined);
checkOutput?: (boolean | undefined);
};
/** 设置 babel class-properties 启用 loose
@doc https://umijs.org/docs/api/config#classpropertiesloose */
classPropertiesLoose: boolean | {
};
ui: {
};
hmrGuardian: boolean;
verifyCommit: {
scope?: (Array<string> | undefined);
allowEmoji?: (boolean | undefined);
};
run: {
globals?: (Array<string> | undefined);
};
access: { [x: string]: any };
analytics: {
baidu?: (string | undefined);
ga?: (string | undefined);
ga_v2?: (string | undefined);
};
antd: {
dark?: (boolean | undefined);
compact?: (boolean | undefined);
import?: (boolean | undefined);
style?: ("less" | "css" | undefined);
theme?: ({
components: { [x: string]: { [x: string]: any } };
} | { [x: string]: any } | undefined);
appConfig?: ({ [x: string]: any } | undefined);
momentPicker?: (boolean | undefined);
styleProvider?: ({ [x: string]: any } | undefined);
configProvider?: ({
theme: {
components: { [x: string]: { [x: string]: any } };
} | { [x: string]: any };
} | { [x: string]: any } | undefined);
};
dva: {
extraModels?: (Array<string> | undefined);
immer?: ({ [x: string]: any } | undefined);
skipModelValidate?: (boolean | undefined);
};
initialState: {
loading?: (string | undefined);
};
layout: { [x: string]: any };
locale: {
default?: (string | undefined);
useLocalStorage?: (boolean | undefined);
baseNavigator?: (boolean | undefined);
title?: (boolean | undefined);
antd?: (boolean | undefined);
baseSeparator?: (string | undefined);
};
mf: {
name?: (string | undefined);
remotes?: (Array<{
aliasName?: (string | undefined);
name: string;
entry?: (string | undefined);
entries?: ({
} | undefined);
keyResolver?: (string | undefined);
}> | undefined);
shared?: ({ [x: string]: any } | undefined);
library?: ({ [x: string]: any } | undefined);
remoteHash?: (boolean | undefined);
};
model: {
extraModels?: (Array<string> | undefined);
};
moment2dayjs: {
preset?: ("antd" | "antdv3" | "none" | undefined);
plugins?: (Array<string> | undefined);
};
qiankun: {
slave?: ({ [x: string]: any } | undefined);
master?: ({ [x: string]: any } | undefined);
externalQiankun?: (boolean | undefined);
};
reactQuery: {
devtool?: ({ [x: string]: any } | boolean | undefined);
queryClient?: ({ [x: string]: any } | boolean | undefined);
};
request: {
dataField?: (string | undefined);
};
styledComponents: {
babelPlugin?: ({ [x: string]: any } | undefined);
};
tailwindcss: { [x: string]: any };
valtio: {
};
};
type PrettifyWithCloseable<T> = {
[K in keyof T]: T[K] | false;
} & {};
export type IConfigFromPlugins = PrettifyWithCloseable<
IConfigFromPluginsJoi & Partial<IConfigTypes>
>;

49
src/.umi/core/pluginConfigJoi.d.ts vendored Normal file
View File

@@ -0,0 +1,49 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
// Created by Umi Plugin
export interface IConfigFromPluginsJoi {
openAPI?: ({
requestLibPath?: string
schemaPath?: string
mock?: boolean
projectName?: string
apiPrefix?: (string | (() => any))
namespace?: string
hook?: {
customFunctionName?: (() => any)
customClassName?: (() => any)
}
}[] | {
requestLibPath?: string
schemaPath?: string
mock?: boolean
projectName?: string
apiPrefix?: (string | (() => any))
namespace?: string
hook?: {
customFunctionName?: (() => any)
customClassName?: (() => any)
}
})
keepalive?: unknown[]
tabsLayout?: (boolean | {
hasCustomTabs?: boolean
hasDropdown?: boolean
hasFixedHeader?: boolean
})
requestRecord?: {
exclude?: unknown[]
type?: boolean
namespace?: string
comment?: boolean
outputDir?: string
successFilter?: (() => any)
role?: string
mock?: {
outputDir?: string
fileName?: string
usingRole?: string
}
}
}

220
src/.umi/core/polyfill.ts Normal file
View File

@@ -0,0 +1,220 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.error.cause.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.aggregate-error.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.aggregate-error.cause.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.at.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.find-last.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.find-last-index.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.push.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.reduce.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.reduce-right.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.to-reversed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.to-sorted.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.to-spliced.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.array.with.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.map.group-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.group-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.object.has-own.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.promise.any.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.promise.with-resolvers.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.reflect.to-string-tag.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.regexp.flags.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.string.at-alternative.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.string.is-well-formed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.string.replace-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.string.to-well-formed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.at.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.find-last.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.find-last-index.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.set.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.to-reversed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.to-sorted.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/es.typed-array.with.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.suppressed-error.constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.from-async.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.filter-out.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.filter-reject.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.group.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.group-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.group-by-to-map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.group-to-map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.is-template-object.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.last-index.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.last-item.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array.unique-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array-buffer.detached.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array-buffer.transfer.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-disposable-stack.constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.as-indexed-pairs.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.async-dispose.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.drop.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.every.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.filter.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.find.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.flat-map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.for-each.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.indexed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.reduce.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.some.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.take.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.async-iterator.to-array.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.bigint.range.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.composite-key.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.composite-symbol.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.data-view.get-float16.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.data-view.get-uint8-clamped.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.data-view.set-float16.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.data-view.set-uint8-clamped.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.disposable-stack.constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.function.demethodize.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.function.is-callable.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.function.is-constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.function.metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.function.un-this.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.constructor.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.as-indexed-pairs.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.dispose.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.drop.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.every.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.filter.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.find.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.flat-map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.for-each.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.indexed.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.range.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.reduce.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.some.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.take.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.to-array.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.iterator.to-async.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.json.is-raw-json.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.json.parse.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.json.raw-json.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.delete-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.emplace.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.every.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.filter.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.find.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.find-key.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.includes.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.key-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.key-of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.map-keys.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.map-values.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.merge.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.reduce.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.some.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.update.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.update-or-insert.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.map.upsert.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.clamp.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.deg-per-rad.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.degrees.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.fscale.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.f16round.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.iaddh.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.imulh.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.isubh.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.rad-per-deg.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.radians.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.scale.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.seeded-prng.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.signbit.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.math.umulh.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.number.from-string.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.number.range.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.object.iterate-entries.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.object.iterate-keys.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.object.iterate-values.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.observable.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.promise.try.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.define-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.delete-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.get-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.get-metadata-keys.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.get-own-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.get-own-metadata-keys.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.has-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.has-own-metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.reflect.metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.regexp.escape.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.add-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.delete-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.difference.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.difference.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.every.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.filter.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.find.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.intersection.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.intersection.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-disjoint-from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-subset-of.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-subset-of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-superset-of.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.is-superset-of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.join.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.map.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.reduce.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.some.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.symmetric-difference.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.union.v2.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.set.union.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.string.at.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.string.cooked.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.string.code-points.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.string.dedent.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.async-dispose.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.dispose.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.is-registered-symbol.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.is-registered.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.is-well-known-symbol.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.is-well-known.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.matcher.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.metadata.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.metadata-key.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.observable.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.pattern-match.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.symbol.replace-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.from-async.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.filter-out.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.filter-reject.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.group-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.to-spliced.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.typed-array.unique-by.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.uint8-array.from-base64.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.uint8-array.from-hex.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.uint8-array.to-base64.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.uint8-array.to-hex.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-map.delete-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-map.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-map.of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-map.emplace.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-map.upsert.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-set.add-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-set.delete-all.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-set.from.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/esnext.weak-set.of.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.dom-exception.stack.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.immediate.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.self.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.structured-clone.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.url.can-parse.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.url-search-params.delete.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.url-search-params.has.js";
import "D:/project/xdnyAdmin/node_modules/.pnpm/core-js@3.34.0/node_modules/core-js/modules/web.url-search-params.size.js";
import 'D:/project/xdnyAdmin/node_modules/.pnpm/regenerator-runtime@0.13.11/node_modules/regenerator-runtime/runtime.js';
export {};

76
src/.umi/core/route.tsx Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
// src/.umi/core/routeProps.ts
var routeProps_default = {};
export {
routeProps_default as default
};

View File

@@ -0,0 +1,6 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export default {
};

37
src/.umi/core/terminal.ts Normal file
View File

@@ -0,0 +1,37 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
let count = 0;
let groupLevel = 0;
function send(type: string, message?: string) {
if(process.env.NODE_ENV==='production'){
return;
}else{
const encodedMessage = message ? `&m=${encodeURI(message)}` : '';
fetch(`/__umi/api/terminal?type=${type}&t=${Date.now()}&c=${count++}&g=${groupLevel}${encodedMessage}`, { mode: 'no-cors' })
}
}
function prettyPrint(obj: any) {
return JSON.stringify(obj, null, 2);
}
function stringifyObjs(objs: any[]) {
const obj = objs.length > 1 ? objs.map(stringify).join(' ') : objs[0];
return typeof obj === 'object' ? `${prettyPrint(obj)}` : obj.toString();
}
function stringify(obj: any) {
return typeof obj === 'object' ? `${JSON.stringify(obj)}` : obj.toString();
}
const terminal = {
log(...objs: any[]) { send('log', stringifyObjs(objs)) },
info(...objs: any[]) { send('info', stringifyObjs(objs)) },
warn(...objs: any[]) { send('warn', stringifyObjs(objs)) },
error(...objs: any[]) { send('error', stringifyObjs(objs)) },
group() { groupLevel++ },
groupCollapsed() { groupLevel++ },
groupEnd() { groupLevel && --groupLevel },
clear() { send('clear') },
trace(...args: any[]) { console.trace(...args) },
profile(...args: any[]) { console.profile(...args) },
profileEnd(...args: any[]) { console.profileEnd(...args) },
};
export { terminal };

27
src/.umi/exports.ts Normal file
View File

@@ -0,0 +1,27 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
// defineApp
export { defineApp } from './core/defineApp'
export type { RuntimeConfig } from './core/defineApp'
// plugins
export { Access, useAccess, useAccessMarkedRoutes } from 'D:/project/xdnyAdmin/src/.umi/plugin-access';
export { addLocale, setLocale, getLocale, getIntl, useIntl, injectIntl, formatMessage, FormattedMessage, getAllLocales, FormattedDate, FormattedDateParts, FormattedDisplayName, FormattedHTMLMessage, FormattedList, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts, IntlProvider, RawIntlProvider, SelectLang } from 'D:/project/xdnyAdmin/src/.umi/plugin-locale';
export { Provider, useModel } from 'D:/project/xdnyAdmin/src/.umi/plugin-model';
export { useRequest, UseRequestProvider, request, getRequestInstance } from 'D:/project/xdnyAdmin/src/.umi/plugin-request';
// plugins types.d.ts
export * from 'D:/project/xdnyAdmin/src/.umi/plugin-access/types.d';
export * from 'D:/project/xdnyAdmin/src/.umi/plugin-antd/types.d';
export * from 'D:/project/xdnyAdmin/src/.umi/plugin-layout/types.d';
export * from 'D:/project/xdnyAdmin/src/.umi/plugin-request/types.d';
// @umijs/renderer-*
export { createBrowserHistory, createHashHistory, createMemoryHistory, Helmet, HelmetProvider, createSearchParams, generatePath, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams, useAppData, useClientLoaderData, useRouteProps, useSelectedRoutes, useServerLoaderData, renderClient, __getRoot, Link, useRouteData, __useFetcher, withRouter } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
export type { History } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react'
// umi/client/client/plugin
export { ApplyPluginsType, PluginManager } from 'D:/project/xdnyAdmin/node_modules/.pnpm/umi@4.1.0_@babel+core@7.23.7_@types+node@20.10.6_@types+react@18.2.46_eslint@8.35.0_jest@29.7_mfwzemi764gvuaip6qabpjspqe/node_modules/umi/client/client/plugin.js';
export { history, createHistory } from './core/history';
export { terminal } from './core/terminal';
// react ssr
export const useServerInsertedHTML: Function = () => {};
// test
export { TestBrowser } from './testBrowser';

View File

@@ -0,0 +1,7 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { AccessInstance } from './types.d';
export const AccessContext = React.createContext<AccessInstance>(null);

View File

@@ -0,0 +1,87 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React, { PropsWithChildren } from 'react';
import { AccessContext } from './context';
import type { IRoute } from 'umi';
export const useAccess = () => {
return React.useContext(AccessContext);
};
export interface AccessProps {
accessible: boolean;
fallback?: React.ReactNode;
}
export const Access: React.FC<PropsWithChildren<AccessProps>> = (props) => {
if (process.env.NODE_ENV === 'development' && typeof props.accessible !== 'boolean') {
throw new Error('[access] the `accessible` property on <Access /> should be a boolean');
}
return <>{ props.accessible ? props.children : props.fallback }</>;
};
export const useAccessMarkedRoutes = (routes: IRoute[]) => {
const access = useAccess();
const markdedRoutes: IRoute[] = React.useMemo(() => {
const process = (route, parentAccessCode, parentRoute) => {
let accessCode = route.access;
// 用父级的路由检测父级的 accessCode
let detectorRoute = route;
if (!accessCode && parentAccessCode) {
accessCode = parentAccessCode;
detectorRoute = parentRoute;
}
// set default status
route.unaccessible = false;
// check access code
if (typeof accessCode === 'string') {
const detector = access[accessCode];
if (typeof detector === 'function') {
route.unaccessible = !detector(detectorRoute);
} else if (typeof detector === 'boolean') {
route.unaccessible = !detector;
} else if (typeof detector === 'undefined') {
route.unaccessible = true;
}
}
// check children access code
if (route.children?.length) {
const isNoAccessibleChild = !route.children.reduce((hasAccessibleChild, child) => {
process(child, accessCode, route);
return hasAccessibleChild || !child.unaccessible;
}, false);
// make sure parent route is unaccessible if all children are unaccessible
if (isNoAccessibleChild) {
route.unaccessible = true;
}
}
// check children access code
if (route.routes?.length) {
const isNoAccessibleChild = !route.routes.reduce((hasAccessibleChild, child) => {
process(child, accessCode, route);
return hasAccessibleChild || !child.unaccessible;
}, false);
// make sure parent route is unaccessible if all children are unaccessible
if (isNoAccessibleChild) {
route.unaccessible = true;
}
}
return route;
}
return routes.map(route => process(route));
}, [routes.length, access]);
return markdedRoutes;
}

View File

@@ -0,0 +1,23 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import accessFactory from '@/access';
import { useModel } from '@@/plugin-model';
import { AccessContext } from './context';
function Provider(props) {
const { initialState } = useModel('@@initialState');
const access = React.useMemo(() => accessFactory(initialState), [initialState]);
return (
<AccessContext.Provider value={access}>
{ props.children }
</AccessContext.Provider>
);
}
export function accessProvider(container) {
return <Provider>{ container }</Provider>;
}

5
src/.umi/plugin-access/types.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import accessFactory from '@/access';
export type AccessInstance = ReturnType<typeof accessFactory>;

View File

@@ -0,0 +1,53 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import {
ConfigProvider,
} from 'antd';
import { ApplyPluginsType } from 'umi';
import { getPluginManager } from '../core/plugin';
let cacheAntdConfig = null;
const getAntdConfig = () => {
if(!cacheAntdConfig){
cacheAntdConfig = getPluginManager().applyPlugins({
key: 'antd',
type: ApplyPluginsType.modify,
initialValue: {
},
});
}
return cacheAntdConfig;
}
function AntdProvider({ children }) {
let container = children;
const [antdConfig, _setAntdConfig] = React.useState(() => {
const {
appConfig: _,
...finalConfigProvider
} = getAntdConfig();
return finalConfigProvider
});
const setAntdConfig: typeof _setAntdConfig = (newConfig) => {
_setAntdConfig(prev => {
return merge({}, prev, typeof newConfig === 'function' ? newConfig(prev) : newConfig)
})
}
return container;
}
export function rootContainer(children) {
return (
<AntdProvider>
{children}
</AntdProvider>
);
}

View File

@@ -0,0 +1,6 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import type { RuntimeAntdConfig } from './types.d';
export type IRuntimeConfig = {
antd?: RuntimeAntdConfig
};

12
src/.umi/plugin-antd/types.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
type AntdConfig = Prettify<{}
>;
export type RuntimeAntdConfig = (memo: AntdConfig) => AntdConfig;

View File

@@ -0,0 +1,50 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { useState, useEffect, useCallback } from 'react';
import { getInitialState } from '@/app';
export type InitialStateType = Awaited<ReturnType<typeof getInitialState>> | undefined;
const initState = {
initialState: undefined as InitialStateType,
loading: true,
error: undefined,
};
export default () => {
const [state, setState] = useState(initState);
const refresh = useCallback(async () => {
setState((s) => ({ ...s, loading: true, error: undefined }));
try {
const ret = await getInitialState();
setState((s) => ({ ...s, initialState: ret, loading: false }));
} catch (e) {
setState((s) => ({ ...s, error: e, loading: false }));
}
}, []);
const setInitialState = useCallback(
async (
initialState: InitialStateType | ((initialState: InitialStateType) => InitialStateType),
) => {
setState((s) => {
if (typeof initialState === 'function') {
return { ...s, initialState: initialState(s.initialState), loading: false };
}
return { ...s, initialState, loading: false };
});
},
[],
);
useEffect(() => {
refresh();
}, []);
return {
...state,
refresh,
setInitialState,
};
}

View File

@@ -0,0 +1,19 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { useModel } from '@@/plugin-model';
function Loading() { return <div />; }
export default function InitialStateProvider(props: any) {
const appLoaded = React.useRef(false);
const { loading = false } = useModel("@@initialState") || {};
React.useEffect(() => {
if (!loading) {
appLoaded.current = true;
}
}, [loading]);
if (loading && !appLoaded.current) {
return <Loading />;
}
return props.children;
}

View File

@@ -0,0 +1,8 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import Provider from './Provider';
export function dataflowProvider(container) {
return <Provider>{ container }</Provider>;
}

View File

@@ -0,0 +1,5 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export interface IRuntimeConfig {
getInitialState?: () => Promise<Record<string, any>>
}

View File

@@ -0,0 +1,37 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { history, type IRoute } from 'umi';
import { Result, Button } from 'antd';
const Exception: React.FC<{
children: React.ReactNode;
route?: IRoute;
notFound?: React.ReactNode;
noAccessible?: React.ReactNode;
unAccessible?: React.ReactNode;
noFound?: React.ReactNode;
}> = (props) => (
// render custom 404
(!props.route && (props.noFound || props.notFound)) ||
// render custom 403
(props.route?.unaccessible && (props.unAccessible || props.noAccessible)) ||
// render default exception
((!props.route || props.route?.unaccessible) && (
<Result
status={props.route ? '403' : '404'}
title={props.route ? '403' : '404'}
subTitle={props.route ? '抱歉,你无权访问该页面' : '抱歉,你访问的页面不存在'}
extra={
<Button type="primary" onClick={() => history.push('/')}>
</Button>
}
/>
)) ||
// normal render
props.children
);
export default Exception;

View File

@@ -0,0 +1,52 @@
@media screen and (max-width: 480px) {
/* 在小屏幕的时候可以有更好的体验 */
.umi-plugin-layout-container {
width: 100% !important;
}
.umi-plugin-layout-container > * {
border-radius: 0 !important;
}
}
.umi-plugin-layout-menu .anticon {
margin-right: 8px;
}
.umi-plugin-layout-menu .ant-dropdown-menu-item {
min-width: 160px;
}
.umi-plugin-layout-right {
display: flex !important;
float: right;
height: 100%;
margin-left: auto;
overflow: hidden;
}
.umi-plugin-layout-right .umi-plugin-layout-action {
display: flex;
align-items: center;
height: 100%;
padding: 0 12px;
cursor: pointer;
transition: all 0.3s;
}
.umi-plugin-layout-right .umi-plugin-layout-action > i {
color: rgba(255, 255, 255, 0.85);
vertical-align: middle;
}
.umi-plugin-layout-right .umi-plugin-layout-action:hover {
background: rgba(0, 0, 0, 0.025);
}
.umi-plugin-layout-right .umi-plugin-layout-action.opened {
background: rgba(0, 0, 0, 0.025);
}
.umi-plugin-layout-right .umi-plugin-layout-search {
padding: 0 12px;
}
.umi-plugin-layout-right .umi-plugin-layout-search:hover {
background: transparent;
}
.umi-plugin-layout-name {
margin-left: 8px;
}
.umi-plugin-layout-name.umi-plugin-layout-hide-avatar-img {
margin-left: 0;
}

View File

@@ -0,0 +1,195 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
/// <reference types="D:/project/xdnyAdmin/node_modules/@ant-design/pro-components" />
import { Link, useLocation, useNavigate, Outlet, useAppData, useRouteData, matchRoutes } from 'umi';
import type { IRoute } from 'umi';
import React, { useMemo } from 'react';
import {
ProLayout,
} from "D:/project/xdnyAdmin/node_modules/@ant-design/pro-components";
import './Layout.css';
import Logo from './Logo';
import Exception from './Exception';
import { getRightRenderContent } from './rightRender';
import { useModel } from '@@/plugin-model';
import { useAccessMarkedRoutes } from '@@/plugin-access';
import { useIntl } from '@@/plugin-locale';
// 过滤出需要显示的路由, 这里的filterFn 指 不希望显示的层级
const filterRoutes = (routes: IRoute[], filterFn: (route: IRoute) => boolean) => {
if (routes.length === 0) {
return []
}
let newRoutes = []
for (const route of routes) {
const newRoute = {...route };
if (filterFn(route)) {
if (Array.isArray(newRoute.routes)) {
newRoutes.push(...filterRoutes(newRoute.routes, filterFn))
}
} else {
if (Array.isArray(newRoute.children)) {
newRoute.children = filterRoutes(newRoute.children, filterFn);
newRoute.routes = newRoute.children;
}
newRoutes.push(newRoute);
}
}
return newRoutes;
}
// 格式化路由 处理因 wrapper 导致的 菜单 path 不一致
const mapRoutes = (routes: IRoute[]) => {
if (routes.length === 0) {
return []
}
return routes.map(route => {
// 需要 copy 一份, 否则会污染原始数据
const newRoute = {...route}
if (route.originPath) {
newRoute.path = route.originPath
}
if (Array.isArray(route.routes)) {
newRoute.routes = mapRoutes(route.routes);
}
if (Array.isArray(route.children)) {
newRoute.children = mapRoutes(route.children);
}
return newRoute
})
}
export default (props: any) => {
const location = useLocation();
const navigate = useNavigate();
const { clientRoutes, pluginManager } = useAppData();
const initialInfo = (useModel && useModel('@@initialState')) || {
initialState: undefined,
loading: false,
setInitialState: null,
};
const { initialState, loading, setInitialState } = initialInfo;
const userConfig = {
"locale": false,
"navTheme": "light",
"colorPrimary": "#1890ff",
"layout": "mix",
"contentWidth": "Fluid",
"fixedHeader": false,
"fixSiderbar": true,
"colorWeak": false,
"title": "云充电管理后台",
"pwa": true,
"logo": false,
"iconfontUrl": "",
"token": {},
"tailwindcss": {}
};
const { formatMessage } = useIntl();
const runtimeConfig = pluginManager.applyPlugins({
key: 'layout',
type: 'modify',
initialValue: {
...initialInfo
},
});
// 现在的 layout 及 wrapper 实现是通过父路由的形式实现的, 会导致路由数据多了冗余层级, proLayout 消费时, 无法正确展示菜单, 这里对冗余数据进行过滤操作
const newRoutes = filterRoutes(clientRoutes.filter(route => route.id === 'ant-design-pro-layout'), (route) => {
return (!!route.isLayout && route.id !== 'ant-design-pro-layout') || !!route.isWrapper;
})
const [route] = useAccessMarkedRoutes(mapRoutes(newRoutes));
const matchedRoute = useMemo(() => matchRoutes(route.children, location.pathname)?.pop?.()?.route, [location.pathname]);
return (
<ProLayout
route={route}
location={location}
title={userConfig.title || 'ant-design-pro'}
navTheme="dark"
siderWidth={256}
onMenuHeaderClick={(e) => {
e.stopPropagation();
e.preventDefault();
navigate('/');
}}
formatMessage={userConfig.formatMessage || formatMessage}
menu={{ locale: userConfig.locale }}
logo={Logo}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || menuItemProps.children) {
return defaultDom;
}
if (menuItemProps.path && location.pathname !== menuItemProps.path) {
return (
// handle wildcard route path, for example /slave/* from qiankun
<Link to={menuItemProps.path.replace('/*', '')} target={menuItemProps.target}>
{defaultDom}
</Link>
);
}
return defaultDom;
}}
itemRender={(route, _, routes) => {
const { breadcrumbName, title, path } = route;
const label = title || breadcrumbName
const last = routes[routes.length - 1]
if (last) {
if (last.path === path || last.linkPath === path) {
return <span>{label}</span>;
}
}
return <Link to={path}>{label}</Link>;
}}
disableContentMargin
fixSiderbar
fixedHeader
{...runtimeConfig}
rightContentRender={
runtimeConfig.rightContentRender !== false &&
((layoutProps) => {
const dom = getRightRenderContent({
runtimeConfig,
loading,
initialState,
setInitialState,
});
if (runtimeConfig.rightContentRender) {
return runtimeConfig.rightContentRender(layoutProps, dom, {
// BREAK CHANGE userConfig > runtimeConfig
userConfig,
runtimeConfig,
loading,
initialState,
setInitialState,
});
}
return dom;
})
}
>
<Exception
route={matchedRoute}
noFound={runtimeConfig?.noFound}
notFound={runtimeConfig?.notFound}
unAccessible={runtimeConfig?.unAccessible}
noAccessible={runtimeConfig?.noAccessible}
>
{runtimeConfig.childrenRender
? runtimeConfig.childrenRender(<Outlet />, props)
: <Outlet />
}
</Exception>
</ProLayout>
);
}

View File

@@ -0,0 +1,94 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
const LogoIcon: React.FC = () => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 200 200"
>
<defs>
<linearGradient
id="linearGradient-1"
x1="62.102%"
x2="108.197%"
y1="0%"
y2="37.864%"
>
<stop offset="0%" stopColor="#4285EB"></stop>
<stop offset="100%" stopColor="#2EC7FF"></stop>
</linearGradient>
<linearGradient
id="linearGradient-2"
x1="69.644%"
x2="54.043%"
y1="0%"
y2="108.457%"
>
<stop offset="0%" stopColor="#29CDFF"></stop>
<stop offset="37.86%" stopColor="#148EFF"></stop>
<stop offset="100%" stopColor="#0A60FF"></stop>
</linearGradient>
<linearGradient
id="linearGradient-3"
x1="69.691%"
x2="16.723%"
y1="-12.974%"
y2="117.391%"
>
<stop offset="0%" stopColor="#FA816E"></stop>
<stop offset="41.473%" stopColor="#F74A5C"></stop>
<stop offset="100%" stopColor="#F51D2C"></stop>
</linearGradient>
<linearGradient
id="linearGradient-4"
x1="68.128%"
x2="30.44%"
y1="-35.691%"
y2="114.943%"
>
<stop offset="0%" stopColor="#FA8E7D"></stop>
<stop offset="51.264%" stopColor="#F74A5C"></stop>
<stop offset="100%" stopColor="#F51D2C"></stop>
</linearGradient>
</defs>
<g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
<g transform="translate(-20 -20)">
<g transform="translate(20 20)">
<g>
<g fillRule="nonzero">
<g>
<path
fill="url(#linearGradient-1)"
d="M91.588 4.177L4.18 91.513a11.981 11.981 0 000 16.974l87.408 87.336a12.005 12.005 0 0016.989 0l36.648-36.618c4.209-4.205 4.209-11.023 0-15.228-4.208-4.205-11.031-4.205-15.24 0l-27.783 27.76c-1.17 1.169-2.945 1.169-4.114 0l-69.802-69.744c-1.17-1.169-1.17-2.942 0-4.11l69.802-69.745c1.17-1.169 2.944-1.169 4.114 0l27.783 27.76c4.209 4.205 11.032 4.205 15.24 0 4.209-4.205 4.209-11.022 0-15.227L108.581 4.056c-4.719-4.594-12.312-4.557-16.993.12z"
></path>
<path
fill="url(#linearGradient-2)"
d="M91.588 4.177L4.18 91.513a11.981 11.981 0 000 16.974l87.408 87.336a12.005 12.005 0 0016.989 0l36.648-36.618c4.209-4.205 4.209-11.023 0-15.228-4.208-4.205-11.031-4.205-15.24 0l-27.783 27.76c-1.17 1.169-2.945 1.169-4.114 0l-69.802-69.744c-1.17-1.169-1.17-2.942 0-4.11l69.802-69.745c2.912-2.51 7.664-7.596 14.642-8.786 5.186-.883 10.855 1.062 17.009 5.837L108.58 4.056c-4.719-4.594-12.312-4.557-16.993.12z"
></path>
</g>
<path
fill="url(#linearGradient-3)"
d="M153.686 135.855c4.208 4.205 11.031 4.205 15.24 0l27.034-27.012c4.7-4.696 4.7-12.28 0-16.974l-27.27-27.15c-4.218-4.2-11.043-4.195-15.254.013-4.209 4.205-4.209 11.022 0 15.227l18.418 18.403c1.17 1.169 1.17 2.943 0 4.111l-18.168 18.154c-4.209 4.205-4.209 11.023 0 15.228z"
></path>
</g>
<ellipse
cx="100.519"
cy="100.437"
fill="url(#linearGradient-4)"
rx="23.6"
ry="23.581"
></ellipse>
</g>
</g>
</g>
</g>
</svg>
);
};
export default LogoIcon;

View File

@@ -0,0 +1,4 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export default { };

View File

@@ -0,0 +1,4 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export type TempType = string

View File

@@ -0,0 +1,108 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { Avatar, version, Dropdown, Menu, Spin } from 'antd';
import { LogoutOutlined } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@ant-design+icons@4.8.1_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@ant-design/icons';
import { SelectLang } from '@@/plugin-locale';
export function getRightRenderContent (opts: {
runtimeConfig: any,
loading: boolean,
initialState: any,
setInitialState: any,
}) {
if (opts.runtimeConfig.rightRender) {
return opts.runtimeConfig.rightRender(
opts.initialState,
opts.setInitialState,
opts.runtimeConfig,
);
}
const showAvatar = opts.initialState?.avatar || opts.initialState?.name || opts.runtimeConfig.logout;
const disableAvatarImg = opts.initialState?.avatar === false;
const nameClassName = disableAvatarImg ? 'umi-plugin-layout-name umi-plugin-layout-hide-avatar-img' : 'umi-plugin-layout-name';
const avatar =
showAvatar ? (
<span className="umi-plugin-layout-action">
{!disableAvatarImg ?
(
<Avatar
size="small"
className="umi-plugin-layout-avatar"
src={
opts.initialState?.avatar ||
"https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png"
}
alt="avatar"
/>
) : null}
<span className={nameClassName}>{opts.initialState?.name}</span>
</span>
) : null;
if (opts.loading) {
return (
<div className="umi-plugin-layout-right">
<Spin size="small" style={ { marginLeft: 8, marginRight: 8 } } />
</div>
);
}
// 如果没有打开Locale并且头像为空就取消掉这个返回的内容
const langMenu = {
className: "umi-plugin-layout-menu",
selectedKeys: [],
items: [
{
key: "logout",
label: (
<>
<LogoutOutlined />
退
</>
),
onClick: () => {
opts?.runtimeConfig?.logout?.(opts.initialState);
},
},
],
};
// antd@5 和 4.24 之后推荐使用 menu性能更好
let dropdownProps;
if (version.startsWith("5.") || version.startsWith("4.24.")) {
dropdownProps = { menu: langMenu };
} else if (version.startsWith("3.")) {
dropdownProps = {
overlay: (
<Menu>
{langMenu.items.map((item) => (
<Menu.Item key={item.key} onClick={item.onClick}>
{item.label}
</Menu.Item>
))}
</Menu>
),
};
} else { // 需要 antd 4.20.0 以上版本
dropdownProps = { overlay: <Menu {...langMenu} /> };
}
return (
<div className="umi-plugin-layout-right anticon">
{opts.runtimeConfig.logout ? (
<Dropdown {...dropdownProps} overlayClassName="umi-plugin-layout-container">
{avatar}
</Dropdown>
) : (
avatar
)}
<SelectLang />
</div>
);
}

View File

@@ -0,0 +1,25 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import icons from './icons';
function formatIcon(name: string) {
return name
.replace(name[0], name[0].toUpperCase())
.replace(/-(w)/g, function(all, letter) {
return letter.toUpperCase();
});
}
export function patchRoutes({ routes }) {
Object.keys(routes).forEach(key => {
const { icon } = routes[key];
if (icon && typeof icon === 'string') {
const upperIcon = formatIcon(icon);
if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
routes[key].icon = React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
}
}
});
}

View File

@@ -0,0 +1,6 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import type { RunTimeLayoutConfig } from './types.d';
export interface IRuntimeConfig {
layout?: RunTimeLayoutConfig
}

37
src/.umi/plugin-layout/types.d.ts vendored Normal file
View File

@@ -0,0 +1,37 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
/// <reference types="D:/project/xdnyAdmin/node_modules/@ant-design/pro-components" />
import type { ProLayoutProps, HeaderProps } from "D:/project/xdnyAdmin/node_modules/@ant-design/pro-components";
import type InitialStateType from '@@/plugin-initialState/@@initialState';
type InitDataType = ReturnType<typeof InitialStateType>;
import type { IConfigFromPlugins } from '@@/core/pluginConfig';
export type RunTimeLayoutConfig = (initData: InitDataType) => Omit<
ProLayoutProps,
'rightContentRender'
> & {
childrenRender?: (dom: JSX.Element, props: ProLayoutProps) => React.ReactNode;
unAccessible?: JSX.Element;
noFound?: JSX.Element;
logout?: (initialState: InitDataType['initialState']) => Promise<void> | void;
rightContentRender?: ((
headerProps: HeaderProps,
dom: JSX.Element,
props: {
userConfig: IConfigFromPlugins['layout'];
runtimeConfig: RunTimeLayoutConfig;
loading: InitDataType['loading'];
initialState: InitDataType['initialState'];
setInitialState: InitDataType['setInitialState'];
},
) => JSX.Element) | false;
rightRender?: (
initialState: InitDataType['initialState'],
setInitialState: InitDataType['setInitialState'],
runtimeConfig: RunTimeLayoutConfig,
) => JSX.Element;
};

View File

@@ -0,0 +1,499 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React,{ useState } from 'react';
import { Menu, version, Dropdown } from 'antd';
import { ClickParam } from 'antd/es/menu';
import { DropDownProps } from 'antd/es/dropdown';
import { getLocale, getAllLocales, setLocale } from './localeExports';
export interface HeaderDropdownProps extends DropDownProps {
overlayClassName?: string;
placement?:
| 'bottomLeft'
| 'bottomRight'
| 'topLeft'
| 'topCenter'
| 'topRight'
| 'bottomCenter';
}
const HeaderDropdown: React.FC<HeaderDropdownProps> = ({
overlayClassName: cls,
...restProps
}) => (
<Dropdown
overlayClassName={cls}
{...restProps}
/>
);
interface LocalData {
lang: string,
label?: string,
icon?: string,
title?: string,
}
interface SelectLangProps {
globalIconClassName?: string;
postLocalesData?: (locales: LocalData[]) => LocalData[];
onItemClick?: (params: ClickParam) => void;
className?: string;
reload?: boolean;
icon?: React.ReactNode;
style?: React.CSSProperties;
}
const transformArrayToObject = (allLangUIConfig:LocalData[])=>{
return allLangUIConfig.reduce((obj, item) => {
if(!item.lang){
return obj;
}
return {
...obj,
[item.lang]: item,
};
}, {});
}
const defaultLangUConfigMap = {
'ar-EG': {
lang: 'ar-EG',
label: 'العربية',
icon: '🇪🇬',
title: 'لغة'
},
'az-AZ': {
lang: 'az-AZ',
label: 'Azərbaycan dili',
icon: '🇦🇿',
title: 'Dil'
},
'bg-BG': {
lang: 'bg-BG',
label: 'Български език',
icon: '🇧🇬',
title: 'език'
},
'bn-BD': {
lang: 'bn-BD',
label: 'বাংলা',
icon: '🇧🇩',
title: 'ভাষা'
},
'ca-ES': {
lang: 'ca-ES',
label: 'Catalá',
icon: '🇨🇦',
title: 'llengua'
},
'cs-CZ': {
lang: 'cs-CZ',
label: 'Čeština',
icon: '🇨🇿',
title: 'Jazyk'
},
'da-DK': {
lang: 'da-DK',
label: 'Dansk',
icon: '🇩🇰',
title: 'Sprog'
},
'de-DE': {
lang: 'de-DE',
label: 'Deutsch',
icon: '🇩🇪',
title: 'Sprache'
},
'el-GR': {
lang: 'el-GR',
label: 'Ελληνικά',
icon: '🇬🇷',
title: 'Γλώσσα'
},
'en-GB': {
lang: 'en-GB',
label: 'English',
icon: '🇬🇧',
title: 'Language'
},
'en-US': {
lang: 'en-US',
label: 'English',
icon: '🇺🇸',
title: 'Language'
},
'es-ES': {
lang: 'es-ES',
label: 'Español',
icon: '🇪🇸',
title: 'Idioma'
},
'et-EE': {
lang: 'et-EE',
label: 'Eesti',
icon: '🇪🇪',
title: 'Keel'
},
'fa-IR': {
lang: 'fa-IR',
label: 'فارسی',
icon: '🇮🇷',
title: 'زبان'
},
'fi-FI': {
lang: 'fi-FI',
label: 'Suomi',
icon: '🇫🇮',
title: 'Kieli'
},
'fr-BE': {
lang: 'fr-BE',
label: 'Français',
icon: '🇧🇪',
title: 'Langue'
},
'fr-FR': {
lang: 'fr-FR',
label: 'Français',
icon: '🇫🇷',
title: 'Langue'
},
'ga-IE': {
lang: 'ga-IE',
label: 'Gaeilge',
icon: '🇮🇪',
title: 'Teanga'
},
'he-IL': {
lang: 'he-IL',
label: 'עברית',
icon: '🇮🇱',
title: 'שפה'
},
'hi-IN': {
lang: 'hi-IN',
label: 'हिन्दी, हिंदी',
icon: '🇮🇳',
title: 'भाषा: हिन्दी'
},
'hr-HR': {
lang: 'hr-HR',
label: 'Hrvatski jezik',
icon: '🇭🇷',
title: 'Jezik'
},
'hu-HU': {
lang: 'hu-HU',
label: 'Magyar',
icon: '🇭🇺',
title: 'Nyelv'
},
'hy-AM': {
lang: 'hu-HU',
label: 'Հայերեն',
icon: '🇦🇲',
title: 'Լեզու'
},
'id-ID': {
lang: 'id-ID',
label: 'Bahasa Indonesia',
icon: '🇮🇩',
title: 'Bahasa'
},
'it-IT': {
lang: 'it-IT',
label: 'Italiano',
icon: '🇮🇹',
title: 'Linguaggio'
},
'is-IS': {
lang: 'is-IS',
label: 'Íslenska',
icon: '🇮🇸',
title: 'Tungumál'
},
'ja-JP': {
lang: 'ja-JP',
label: '日本語',
icon: '🇯🇵',
title: '言語'
},
'ku-IQ': {
lang: 'ku-IQ',
label: 'کوردی',
icon: '🇮🇶',
title: 'Ziman'
},
'kn-IN': {
lang: 'kn-IN',
label: 'ಕನ್ನಡ',
icon: '🇮🇳',
title: 'ಭಾಷೆ'
},
'ko-KR': {
lang: 'ko-KR',
label: '한국어',
icon: '🇰🇷',
title: '언어'
},
'lv-LV': {
lang: 'lv-LV',
label: 'Latviešu valoda',
icon: '🇱🇮',
title: 'Kalba'
},
'mk-MK': {
lang: 'mk-MK',
label: 'македонски јазик',
icon: '🇲🇰',
title: 'Јазик'
},
'mn-MN': {
lang: 'mn-MN',
label: 'Монгол хэл',
icon: '🇲🇳',
title: 'Хэл'
},
'ms-MY': {
lang: 'ms-MY',
label: 'بهاس ملايو‎',
icon: '🇲🇾',
title: 'Bahasa'
},
'nb-NO': {
lang: 'nb-NO',
label: 'Norsk',
icon: '🇳🇴',
title: 'Språk'
},
'ne-NP': {
lang: 'ne-NP',
label: 'नेपाली',
icon: '🇳🇵',
title: 'भाषा'
},
'nl-BE': {
lang: 'nl-BE',
label: 'Vlaams',
icon: '🇧🇪',
title: 'Taal'
},
'nl-NL': {
lang: 'nl-NL',
label: 'Nederlands',
icon: '🇳🇱',
title: 'Taal'
},
'pl-PL': {
lang: 'pl-PL',
label: 'Polski',
icon: '🇵🇱',
title: 'Język'
},
'pt-BR': {
lang: 'pt-BR',
label: 'Português',
icon: '🇧🇷',
title: 'Idiomas'
},
'pt-PT': {
lang: 'pt-PT',
label: 'Português',
icon: '🇵🇹',
title: 'Idiomas'
},
'ro-RO': {
lang: 'ro-RO',
label: 'Română',
icon: '🇷🇴',
title: 'Limba'
},
'ru-RU': {
lang: 'ru-RU',
label: 'Русский',
icon: '🇷🇺',
title: 'язык'
},
'sk-SK': {
lang: 'sk-SK',
label: 'Slovenčina',
icon: '🇸🇰',
title: 'Jazyk'
},
'sr-RS': {
lang: 'sr-RS',
label: 'српски језик',
icon: '🇸🇷',
title: 'Језик'
},
'sl-SI': {
lang: 'sl-SI',
label: 'Slovenščina',
icon: '🇸🇱',
title: 'Jezik'
},
'sv-SE': {
lang: 'sv-SE',
label: 'Svenska',
icon: '🇸🇪',
title: 'Språk'
},
'ta-IN': {
lang: 'ta-IN',
label: 'தமிழ்',
icon: '🇮🇳',
title: 'மொழி'
},
'th-TH': {
lang: 'th-TH',
label: 'ไทย',
icon: '🇹🇭',
title: 'ภาษา'
},
'tr-TR': {
lang: 'tr-TR',
label: 'Türkçe',
icon: '🇹🇷',
title: 'Dil'
},
'uk-UA': {
lang: 'uk-UA',
label: 'Українська',
icon: '🇺🇰',
title: 'Мова'
},
'vi-VN': {
lang: 'vi-VN',
label: 'Tiếng Việt',
icon: '🇻🇳',
title: 'Ngôn ngữ'
},
'zh-CN': {
lang: 'zh-CN',
label: '简体中文',
icon: '🇨🇳',
title: '语言'
},
'zh-TW': {
lang: 'zh-TW',
label: '繁體中文',
icon: '🇭🇰',
title: '語言'
}
};
export const SelectLang: React.FC<SelectLangProps> = (props) => {
const {
globalIconClassName,
postLocalesData,
onItemClick,
icon,
style,
reload,
...restProps
} = props;
const [selectedLang, setSelectedLang] = useState(() => getLocale());
const changeLang = ({ key }: ClickParam): void => {
setLocale(key, reload);
setSelectedLang(getLocale())
};
const defaultLangUConfig = getAllLocales().map(
(key) =>
defaultLangUConfigMap[key] || {
lang: key,
label: key,
icon: "🌐",
title: key,
}
);
const allLangUIConfig =
postLocalesData?.(defaultLangUConfig) || defaultLangUConfig;
const handleClick = onItemClick
? (params: ClickParam) => onItemClick(params)
: changeLang;
const menuItemStyle = { minWidth: "160px" };
const menuItemIconStyle = { marginRight: "8px" };
const langMenu = {
selectedKeys: [selectedLang],
onClick: handleClick,
items: allLangUIConfig.map((localeObj) => ({
key: localeObj.lang || localeObj.key,
style: menuItemStyle,
label: (
<>
<span role="img" aria-label={localeObj?.label || 'en-US'} style={menuItemIconStyle}>
{localeObj?.icon || '🌐'}
</span>
{localeObj?.label || 'en-US'}
</>
),
})),
};
// antd@5 和 4.24 之后推荐使用 menu性能更好
let dropdownProps;
if (version.startsWith("5.") || version.startsWith("4.24.")) {
dropdownProps = { menu: langMenu };
} else if (version.startsWith("3.")) {
dropdownProps = {
overlay: (
<Menu>
{langMenu.items.map((item) => (
<Menu.Item key={item.key} onClick={item.onClick}>
{item.label}
</Menu.Item>
))}
</Menu>
),
};
} else { // 需要 antd 4.20.0 以上版本
dropdownProps = { overlay: <Menu {...langMenu} /> };
}
const inlineStyle = {
cursor: "pointer",
padding: "12px",
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
fontSize: 18,
verticalAlign: "middle",
...style,
};
return (
<HeaderDropdown {...dropdownProps} placement="bottomRight" {...restProps}>
<span className={globalIconClassName} style={inlineStyle}>
<i className="anticon" title={allLangUIConfig[selectedLang]?.title}>
{ icon ?
icon : (
<svg
viewBox="0 0 24 24"
focusable="false"
width="1em"
height="1em"
fill="currentColor"
aria-hidden="true"
>
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z "
className="css-c4d79v"
/>
</svg>
)}
</i>
</span>
</HeaderDropdown>
);
return <></>
};

View File

@@ -0,0 +1,5 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export { addLocale, setLocale, getLocale, getIntl, useIntl, injectIntl, formatMessage, FormattedMessage, getAllLocales, FormattedDate, FormattedDateParts, FormattedDisplayName, FormattedHTMLMessage, FormattedList, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts, IntlProvider, RawIntlProvider } from './localeExports';
export { SelectLang } from './SelectLang';

View File

@@ -0,0 +1,65 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { ConfigProvider } from 'antd';
import moment from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/bn-bd';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/en';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/fa';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/id';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/ja';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/pt-br';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn';
import 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/zh-tw';
import { RawIntlProvider, getLocale, getDirection , setIntl, getIntl, localeInfo, event, LANG_CHANGE_EVENT } from './localeExports';
export function _onCreate() {
const locale = getLocale();
if (moment?.locale) {
moment.locale(localeInfo[locale]?.momentLocale || '');
}
setIntl(locale);
}
const useIsomorphicLayoutEffect =
typeof window !== 'undefined' &&
typeof window.document !== 'undefined' &&
typeof window.document.createElement !== 'undefined'
? React.useLayoutEffect
: React.useEffect
export const _LocaleContainer = (props:any) => {
const initLocale = getLocale();
const [locale, setLocale] = React.useState(initLocale);
const [intl, setContainerIntl] = React.useState(() => getIntl(locale, true));
const handleLangChange = (locale:string) => {
if (moment?.locale) {
moment.locale(localeInfo[locale]?.momentLocale || 'en');
}
setLocale(locale);
setContainerIntl(getIntl(locale));
};
useIsomorphicLayoutEffect(() => {
event.on(LANG_CHANGE_EVENT, handleLangChange);
return () => {
event.off(LANG_CHANGE_EVENT, handleLangChange);
};
}, []);
const defaultAntdLocale = {
}
const direction = getDirection();
return (
<ConfigProvider direction={direction} locale={localeInfo[locale]?.antd || defaultAntdLocale}>
<RawIntlProvider value={intl}>{props.children}</RawIntlProvider>
</ConfigProvider>
)
};

View File

@@ -0,0 +1,380 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import {
createIntl,
IntlShape,
MessageDescriptor,
} from 'D:/project/xdnyAdmin/node_modules/.pnpm/react-intl@3.12.1_react@18.2.0/node_modules/react-intl';
import { getPluginManager } from '../core/plugin';
import EventEmitter from 'D:/project/xdnyAdmin/node_modules/.pnpm/event-emitter@0.3.5/node_modules/event-emitter';
// @ts-ignore
import warning from 'D:/project/xdnyAdmin/node_modules/.pnpm/warning@4.0.3/node_modules/warning';
export {
createIntl,
};
export {
FormattedDate,
FormattedDateParts,
FormattedDisplayName,
FormattedHTMLMessage,
FormattedList,
FormattedMessage,
FormattedNumber,
FormattedNumberParts,
FormattedPlural,
FormattedRelativeTime,
FormattedTime,
FormattedTimeParts,
IntlContext,
IntlProvider,
RawIntlProvider,
createIntlCache,
defineMessages,
injectIntl,
useIntl,
} from 'D:/project/xdnyAdmin/node_modules/.pnpm/react-intl@3.12.1_react@18.2.0/node_modules/react-intl';
let g_intl: IntlShape;
const useLocalStorage = true;
// @ts-ignore
export const event = new EventEmitter();
export const LANG_CHANGE_EVENT = Symbol('LANG_CHANGE');
import bnBD0 from 'antd/es/locale/bn_BD';
import lang_bnBD0 from "D:/project/xdnyAdmin/src/locales/bn-BD.ts";
import enUS0 from 'antd/es/locale/en_US';
import lang_enUS0 from "D:/project/xdnyAdmin/src/locales/en-US.ts";
import faIR0 from 'antd/es/locale/fa_IR';
import lang_faIR0 from "D:/project/xdnyAdmin/src/locales/fa-IR.ts";
import idID0 from 'antd/es/locale/id_ID';
import lang_idID0 from "D:/project/xdnyAdmin/src/locales/id-ID.ts";
import jaJP0 from 'antd/es/locale/ja_JP';
import lang_jaJP0 from "D:/project/xdnyAdmin/src/locales/ja-JP.ts";
import ptBR0 from 'antd/es/locale/pt_BR';
import lang_ptBR0 from "D:/project/xdnyAdmin/src/locales/pt-BR.ts";
import zhCN0 from 'antd/es/locale/zh_CN';
import lang_zhCN0 from "D:/project/xdnyAdmin/src/locales/zh-CN.ts";
import zhTW0 from 'antd/es/locale/zh_TW';
import lang_zhTW0 from "D:/project/xdnyAdmin/src/locales/zh-TW.ts";
const flattenMessages=(
nestedMessages: Record<string, any>,
prefix = '',
) => {
return Object.keys(nestedMessages).reduce(
(messages: Record<string, any>, key) => {
const value = nestedMessages[key];
const prefixedKey = prefix ? `${prefix}.${key}` : key;
if (typeof value === 'string') {
messages[prefixedKey] = value;
} else {
Object.assign(messages, flattenMessages(value, prefixedKey));
}
return messages;
},
{},
);
}
export const localeInfo: {[key: string]: any} = {
'bn-BD': {
messages: {
...flattenMessages(lang_bnBD0),
},
locale: 'bn-BD',
antd: {
...bnBD0,
},
momentLocale: 'bn-bd',
},
'en-US': {
messages: {
...flattenMessages(lang_enUS0),
},
locale: 'en-US',
antd: {
...enUS0,
},
momentLocale: 'en',
},
'fa-IR': {
messages: {
...flattenMessages(lang_faIR0),
},
locale: 'fa-IR',
antd: {
...faIR0,
},
momentLocale: 'fa',
},
'id-ID': {
messages: {
...flattenMessages(lang_idID0),
},
locale: 'id-ID',
antd: {
...idID0,
},
momentLocale: 'id',
},
'ja-JP': {
messages: {
...flattenMessages(lang_jaJP0),
},
locale: 'ja-JP',
antd: {
...jaJP0,
},
momentLocale: 'ja',
},
'pt-BR': {
messages: {
...flattenMessages(lang_ptBR0),
},
locale: 'pt-BR',
antd: {
...ptBR0,
},
momentLocale: 'pt-br',
},
'zh-CN': {
messages: {
...flattenMessages(lang_zhCN0),
},
locale: 'zh-CN',
antd: {
...zhCN0,
},
momentLocale: 'zh-cn',
},
'zh-TW': {
messages: {
...flattenMessages(lang_zhTW0),
},
locale: 'zh-TW',
antd: {
...zhTW0,
},
momentLocale: 'zh-tw',
},
};
/**
* 增加一个新的国际化语言
* @param name 语言的 key
* @param messages 对应的枚举对象
* @param extraLocales momentLocale, antd 国际化
*/
export const addLocale = (
name: string,
messages: Object,
extraLocales: {
momentLocale:string;
antd: import('antd/es/locale').Locale
},
) => {
if (!name) {
return;
}
// 可以合并
const mergeMessages = localeInfo[name]?.messages
? Object.assign({}, localeInfo[name].messages, messages)
: messages;
// 用户只是追加 messages 时extraLocales 可选
const { momentLocale = localeInfo[name]?.momentLocale, antd = localeInfo[name]?.antd } = extraLocales || {};
const locale = name.split('-')?.join('-')
localeInfo[name] = {
messages: mergeMessages,
locale,
momentLocale: momentLocale,
antd,
};
// 如果这是的 name 和当前的locale 相同需要重新设置一下,不然更新不了
if (locale === getLocale()) {
event.emit(LANG_CHANGE_EVENT, locale);
}
};
const applyRuntimeLocalePlugin = (initialValue: any) => {
return getPluginManager().applyPlugins({
key: 'locale',
type: 'modify',
initialValue
});
}
const _createIntl = (locale: string) => {
const runtimeLocale = applyRuntimeLocalePlugin(localeInfo[locale]);
const { cache, ...config } = runtimeLocale;
return createIntl(config, cache);
}
/**
* 获取当前的 intl 对象,可以在 node 中使用
* @param locale 需要切换的语言类型
* @param changeIntl 是否不使用 g_intl
* @returns IntlShape
*/
export const getIntl = (locale?: string, changeIntl?: boolean) => {
// 如果全局的 g_intl 存在,且不是 setIntl 调用
if (g_intl && !changeIntl && !locale) {
return g_intl;
}
// 获取当前 locale
if (!locale) locale = getLocale();
// 如果存在于 localeInfo 中
if (locale&&localeInfo[locale]) {
return _createIntl(locale);
}
// 不存在需要一个报错提醒
warning(
!locale||!!localeInfo[locale],
`The current popular language does not exist, please check the locales folder!`,
);
// 使用 zh-CN
if (localeInfo["zh-CN"]) {
return _createIntl("zh-CN");
}
// 如果还没有,返回一个空的
return createIntl({
locale: "zh-CN",
messages: {}
});
};
/**
* 切换全局的 intl 的设置
* @param locale 语言的key
*/
export const setIntl = (locale: string) => {
g_intl = getIntl(locale, true);
};
/**
* 获取当前选择的语言
* @returns string
*/
export const getLocale = () => {
const runtimeLocale = applyRuntimeLocalePlugin({});
// runtime getLocale for user define
if (typeof runtimeLocale?.getLocale === 'function') {
return runtimeLocale.getLocale();
}
// please clear localStorage if you change the baseSeparator config
// because changing will break the app
const lang =
navigator.cookieEnabled && typeof localStorage !== 'undefined' && useLocalStorage
? window.localStorage.getItem('umi_locale')
: '';
// support baseNavigator, default true
let browserLang;
const isNavigatorLanguageValid =
typeof navigator !== 'undefined' && typeof navigator.language === 'string';
browserLang = isNavigatorLanguageValid
? navigator.language.split('-').join('-')
: '';
return lang || browserLang || "zh-CN";
};
/**
* 获取当前选择的方向
* @returns string
*/
export const getDirection = () => {
const lang = getLocale();
// array with all prefixs for rtl langueges ex: ar-EG , he-IL
const rtlLangs = ['he', 'ar', 'fa', 'ku']
const direction = rtlLangs.filter(lng => lang.startsWith(lng)).length ? 'rtl' : 'ltr';
return direction;
};
/**
* 切换语言
* @param lang 语言的 key
* @param realReload 是否刷新页面,默认刷新
* @returns string
*/
export const setLocale = (lang: string, realReload: boolean = true) => {
//const { pluginManager } = useAppContext();
//const runtimeLocale = pluginManagerapplyPlugins({
// key: 'locale',
// workaround: 不使用 ApplyPluginsType.modify 是为了避免循环依赖,与 fast-refresh 一起用时会有问题
// type: 'modify',
// initialValue: {},
//});
const updater = () => {
if (getLocale() !== lang) {
if (navigator.cookieEnabled && typeof window.localStorage !== 'undefined' && useLocalStorage) {
window.localStorage.setItem('umi_locale', lang || '');
}
setIntl(lang);
if (realReload) {
window.location.reload();
} else {
event.emit(LANG_CHANGE_EVENT, lang);
// chrome 不支持这个事件。所以人肉触发一下
if (window.dispatchEvent) {
const event = new Event('languagechange');
window.dispatchEvent(event);
}
}
}
}
//if (typeof runtimeLocale?.setLocale === 'function') {
// runtimeLocale.setLocale({
// lang,
// realReload,
// updater: updater,
// });
// return;
//}
updater();
};
let firstWaring = true;
/**
* intl.formatMessage 的语法糖
* @deprecated 使用此 api 会造成切换语言的时候无法自动刷新,请使用 useIntl 或 injectIntl
* @param descriptor { id : string, defaultMessage : string }
* @param values { [key:string] : string }
* @returns string
*/
export const formatMessage: IntlShape['formatMessage'] = (
descriptor: MessageDescriptor,
values: any,
) => {
if (firstWaring) {
warning(
false,
`Using this API will cause automatic refresh when switching languages, please use useIntl or injectIntl.
使用此 api 会造成切换语言的时候无法自动刷新,请使用 useIntl 或 injectIntl。
http://j.mp/37Fkd5Q
`,
);
firstWaring = false;
}
if (!g_intl) {
setIntl(getLocale());
}
return g_intl.formatMessage(descriptor, values);
};
/**
* 获取语言列表
* @returns string[]
*/
export const getAllLocales = () => Object.keys(localeInfo);

View File

@@ -0,0 +1,9 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
// @ts-ignore
import { _LocaleContainer } from './locale';
export function i18nProvider(container: Element) {
return React.createElement(_LocaleContainer, null, container);
}

View File

@@ -0,0 +1,13 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import {
IntlCache,
createIntl,
} from 'D:/project/xdnyAdmin/node_modules/.pnpm/react-intl@3.12.1_react@18.2.0/node_modules/react-intl';
type OptionalIntlConfig = Omit<Parameters<typeof createIntl>[0], 'locale' | 'defaultLocale'>;
export interface IRuntimeConfig {
locale?: {
getLocale?: () => string;
cache?: IntlCache;
} & OptionalIntlConfig;
};

View File

@@ -0,0 +1,183 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
// @ts-ignore
import type { models as rawModels } from '@@/plugin-model/model';
import isEqual from 'D:/project/xdnyAdmin/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js';
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
type Models = typeof rawModels;
type GetNamespaces<M> = {
[K in keyof M]: M[K] extends { namespace: string }
? M[K]['namespace']
: never;
}[keyof M];
type Namespaces = GetNamespaces<Models>;
// @ts-ignore
const Context = React.createContext<{ dispatcher: Dispatcher }>(null);
class Dispatcher {
callbacks: Record<Namespaces, Set<Function>> = {};
data: Record<Namespaces, unknown> = {};
update = (namespace: Namespaces) => {
if (this.callbacks[namespace]) {
this.callbacks[namespace].forEach((cb) => {
try {
const data = this.data[namespace];
cb(data);
} catch (e) {
cb(undefined);
}
});
}
};
}
interface ExecutorProps {
hook: () => any;
onUpdate: (val: any) => void;
namespace: string;
}
function Executor(props: ExecutorProps) {
const { hook, onUpdate, namespace } = props;
const updateRef = useRef(onUpdate);
const initialLoad = useRef(false);
let data: any;
try {
data = hook();
} catch (e) {
console.error(
`plugin-model: Invoking '${namespace || 'unknown'}' model failed:`,
e,
);
}
// 首次执行时立刻返回初始值
useMemo(() => {
updateRef.current(data);
}, []);
// React 16.13 后 update 函数用 useEffect 包裹
useEffect(() => {
if (initialLoad.current) {
updateRef.current(data);
} else {
initialLoad.current = true;
}
});
return null;
}
const dispatcher = new Dispatcher();
export function Provider(props: {
models: Record<string, any>;
children: React.ReactNode;
}) {
return (
<Context.Provider value={{ dispatcher }}>
{Object.keys(props.models).map((namespace) => {
return (
<Executor
key={namespace}
hook={props.models[namespace]}
namespace={namespace}
onUpdate={(val) => {
dispatcher.data[namespace] = val;
dispatcher.update(namespace);
}}
/>
);
})}
{props.children}
</Context.Provider>
);
}
type GetModelByNamespace<M, N> = {
[K in keyof M]: M[K] extends { namespace: string; model: unknown }
? M[K]['namespace'] extends N
? M[K]['model'] extends (...args: any) => any
? ReturnType<M[K]['model']>
: never
: never
: never;
}[keyof M];
type Model<N> = GetModelByNamespace<Models, N>;
type Selector<N, S> = (model: Model<N>) => S;
type SelectedModel<N, T> = T extends (...args: any) => any
? ReturnType<NonNullable<T>>
: Model<N>;
export function useModel<N extends Namespaces>(namespace: N): Model<N>;
export function useModel<N extends Namespaces, S>(
namespace: N,
selector: Selector<N, S>,
): SelectedModel<N, typeof selector>;
export function useModel<N extends Namespaces, S>(
namespace: N,
selector?: Selector<N, S>,
): SelectedModel<N, typeof selector> {
const { dispatcher } = useContext<{ dispatcher: Dispatcher }>(Context);
const selectorRef = useRef(selector);
selectorRef.current = selector;
const [state, setState] = useState(() =>
selectorRef.current
? selectorRef.current(dispatcher.data[namespace])
: dispatcher.data[namespace],
);
const stateRef = useRef<any>(state);
stateRef.current = state;
const isMount = useRef(false);
useEffect(() => {
isMount.current = true;
return () => {
isMount.current = false;
};
}, []);
useEffect(() => {
const handler = (data: any) => {
if (!isMount.current) {
// 如果 handler 执行过程中,组件被卸载了,则强制更新全局 data
// TODO: 需要加个 example 测试
setTimeout(() => {
dispatcher.data[namespace] = data;
dispatcher.update(namespace);
});
} else {
const currentState = selectorRef.current
? selectorRef.current(data)
: data;
const previousState = stateRef.current;
if (!isEqual(currentState, previousState)) {
// 避免 currentState 拿到的数据是老的,从而导致 isEqual 比对逻辑有问题
stateRef.current = currentState;
setState(currentState);
}
}
};
dispatcher.callbacks[namespace] ||= new Set() as any; // rawModels 是 umi 动态生成的文件,导致前面 callback[namespace] 的类型无法推导出来,所以用 as any 来忽略掉
dispatcher.callbacks[namespace].add(handler);
dispatcher.update(namespace);
return () => {
dispatcher.callbacks[namespace].delete(handler);
};
}, [namespace]);
return state;
}

View File

@@ -0,0 +1,8 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import model_1 from 'D:/project/xdnyAdmin/src/.umi/plugin-initialState/@@initialState';
export const models = {
model_1: { namespace: '@@initialState', model: model_1 },
} as const

View File

@@ -0,0 +1,20 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React from 'react';
import { Provider } from './';
import { models as rawModels } from './model';
function ProviderWrapper(props: any) {
const models = React.useMemo(() => {
return Object.keys(rawModels).reduce((memo, key) => {
memo[rawModels[key].namespace] = rawModels[key].model;
return memo;
}, {});
}, []);
return <Provider models={models} {...props}>{ props.children }</Provider>
}
export function dataflowProvider(container, opts) {
return <ProviderWrapper {...opts}>{ container }</ProviderWrapper>;
}

View File

@@ -0,0 +1,31 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import dayjs from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs';
import antdPlugin from 'D:/project/xdnyAdmin/node_modules/.pnpm/antd-dayjs-webpack-plugin@1.0.6_dayjs@1.11.10/node_modules/antd-dayjs-webpack-plugin/src/antd-plugin.js';
import isSameOrBefore from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrBefore';
import isSameOrAfter from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/isSameOrAfter';
import advancedFormat from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/advancedFormat';
import customParseFormat from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/customParseFormat';
import weekday from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/weekday';
import weekYear from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/weekYear';
import weekOfYear from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/weekOfYear';
import isMoment from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/isMoment';
import localeData from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData';
import localizedFormat from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localizedFormat';
import duration from 'D:/project/xdnyAdmin/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/duration';
dayjs.extend(isSameOrBefore);
dayjs.extend(isSameOrAfter);
dayjs.extend(advancedFormat);
dayjs.extend(customParseFormat);
dayjs.extend(weekday);
dayjs.extend(weekYear);
dayjs.extend(weekOfYear);
dayjs.extend(isMoment);
dayjs.extend(localeData);
dayjs.extend(localizedFormat);
dayjs.extend(duration);
dayjs.extend(antdPlugin);

View File

@@ -0,0 +1,39 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { useEffect, useState } from 'react';
import { SwaggerUIBundle } from 'swagger-ui-dist';
import 'swagger-ui-dist/swagger-ui.css';
const App = () => {
const [value, setValue] = useState("openapi" );
useEffect(() => {
SwaggerUIBundle({
url: `/umi-plugins_${value}.json`,
dom_id: '#swagger-ui',
});
}, [value]);
return (
<div
style={{
padding: 24,
}}
>
<select
style={{
position: "fixed",
right: "16px",
top: "8px",
}}
onChange={(e) => setValue(e.target.value)}
>
<option value="openapi">openapi</option>
<option value="swagger">swagger</option>
</select>
<div id="swagger-ui" />
</div>
);
};
export default App;

View File

@@ -0,0 +1,9 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export {
useRequest,
UseRequestProvider,
request,
getRequestInstance,
} from './request';

View File

@@ -0,0 +1,265 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import axios, {
type AxiosInstance,
type AxiosRequestConfig,
type AxiosResponse,
type AxiosError,
} from 'D:/project/xdnyAdmin/node_modules/.pnpm/axios@0.27.2/node_modules/axios';
import useUmiRequest, { UseRequestProvider } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@ahooksjs+use-request@2.8.15_react@18.2.0/node_modules/@ahooksjs/use-request';
import { ApplyPluginsType } from 'umi';
import { getPluginManager } from '../core/plugin';
import {
BaseOptions,
BasePaginatedOptions,
BaseResult,
CombineService,
LoadMoreFormatReturn,
LoadMoreOptions,
LoadMoreOptionsWithFormat,
LoadMoreParams,
LoadMoreResult,
OptionsWithFormat,
PaginatedFormatReturn,
PaginatedOptionsWithFormat,
PaginatedParams,
PaginatedResult,
} from 'D:/project/xdnyAdmin/node_modules/.pnpm/@ahooksjs+use-request@2.8.15_react@18.2.0/node_modules/@ahooksjs/use-request/es/types';
type ResultWithData< T = any > = { data?: T; [key: string]: any };
function useRequest<
R = any,
P extends any[] = any,
U = any,
UU extends U = any,
>(
service: CombineService<R, P>,
options: OptionsWithFormat<R, P, U, UU>,
): BaseResult<U, P>;
function useRequest<R extends ResultWithData = any, P extends any[] = any>(
service: CombineService<R, P>,
options?: BaseOptions<R['data'], P>,
): BaseResult<R['data'], P>;
function useRequest<R extends LoadMoreFormatReturn = any, RR = any>(
service: CombineService<RR, LoadMoreParams<R>>,
options: LoadMoreOptionsWithFormat<R, RR>,
): LoadMoreResult<R>;
function useRequest<
R extends ResultWithData<LoadMoreFormatReturn | any> = any,
RR extends R = any,
>(
service: CombineService<R, LoadMoreParams<R['data']>>,
options: LoadMoreOptions<RR['data']>,
): LoadMoreResult<R['data']>;
function useRequest<R = any, Item = any, U extends Item = any>(
service: CombineService<R, PaginatedParams>,
options: PaginatedOptionsWithFormat<R, Item, U>,
): PaginatedResult<Item>;
function useRequest<Item = any, U extends Item = any>(
service: CombineService<
ResultWithData<PaginatedFormatReturn<Item>>,
PaginatedParams
>,
options: BasePaginatedOptions<U>,
): PaginatedResult<Item>;
function useRequest(service: any, options: any = {}) {
return useUmiRequest(service, {
formatResult: result => result?.data,
requestMethod: (requestOptions: any) => {
if (typeof requestOptions === 'string') {
return request(requestOptions);
}
if (typeof requestOptions === 'object') {
const { url, ...rest } = requestOptions;
return request(url, rest);
}
throw new Error('request options error');
},
...options,
});
}
// request 方法 opts 参数的接口
interface IRequestOptions extends AxiosRequestConfig {
skipErrorHandler?: boolean;
requestInterceptors?: IRequestInterceptorTuple[];
responseInterceptors?: IResponseInterceptorTuple[];
[key: string]: any;
}
interface IRequestOptionsWithResponse extends IRequestOptions {
getResponse: true;
}
interface IRequestOptionsWithoutResponse extends IRequestOptions{
getResponse: false;
}
interface IRequest{
<T = any>(url: string, opts: IRequestOptionsWithResponse): Promise<AxiosResponse<T>>;
<T = any>(url: string, opts: IRequestOptionsWithoutResponse): Promise<T>;
<T = any>(url: string, opts: IRequestOptions): Promise<T>; // getResponse 默认是 false 因此不提供该参数时,只返回 data
<T = any>(url: string): Promise<T>; // 不提供 opts 时,默认使用 'GET' method并且默认返回 data
}
type RequestError = AxiosError | Error
interface IErrorHandler {
(error: RequestError, opts: IRequestOptions): void;
}
type IRequestInterceptorAxios = (config: RequestOptions) => RequestOptions;
type IRequestInterceptorUmiRequest = (url: string, config : RequestOptions) => { url: string, options: RequestOptions };
type IRequestInterceptor = IRequestInterceptorAxios | IRequestInterceptorUmiRequest;
type IErrorInterceptor = (error: Error) => Promise<Error>;
type IResponseInterceptor = <T = any>(response : AxiosResponse<T>) => AxiosResponse<T> ;
type IRequestInterceptorTuple = [IRequestInterceptor , IErrorInterceptor] | [ IRequestInterceptor ] | IRequestInterceptor
type IResponseInterceptorTuple = [IResponseInterceptor, IErrorInterceptor] | [IResponseInterceptor] | IResponseInterceptor
export interface RequestConfig<T = any> extends AxiosRequestConfig {
errorConfig?: {
errorHandler?: IErrorHandler;
errorThrower?: ( res: T ) => void
};
requestInterceptors?: IRequestInterceptorTuple[];
responseInterceptors?: IResponseInterceptorTuple[];
}
let requestInstance: AxiosInstance;
let config: RequestConfig;
const getConfig = (): RequestConfig => {
if (config) return config;
config = getPluginManager().applyPlugins({
key: 'request',
type: ApplyPluginsType.modify,
initialValue: {},
});
return config;
};
const getRequestInstance = (): AxiosInstance => {
if (requestInstance) return requestInstance;
const config = getConfig();
requestInstance = axios.create(config);
config?.requestInterceptors?.forEach((interceptor) => {
if(interceptor instanceof Array){
requestInstance.interceptors.request.use((config) => {
const { url } = config;
if(interceptor[0].length === 2){
const { url: newUrl, options } = interceptor[0](url, config);
return { ...options, url: newUrl };
}
return interceptor[0](config);
}, interceptor[1]);
} else {
requestInstance.interceptors.request.use((config) => {
const { url } = config;
if(interceptor.length === 2){
const { url: newUrl, options } = interceptor(url, config);
return { ...options, url: newUrl };
}
return interceptor(config);
})
}
});
config?.responseInterceptors?.forEach((interceptor) => {
interceptor instanceof Array ?
requestInstance.interceptors.response.use(interceptor[0], interceptor[1]):
requestInstance.interceptors.response.use(interceptor);
});
// 当响应的数据 success 是 false 的时候,抛出 error 以供 errorHandler 处理。
requestInstance.interceptors.response.use((response) => {
const { data } = response;
if(data?.success === false && config?.errorConfig?.errorThrower){
config.errorConfig.errorThrower(data);
}
return response;
})
return requestInstance;
};
const request: IRequest = (url: string, opts: any = { method: 'GET' }) => {
const requestInstance = getRequestInstance();
const config = getConfig();
const { getResponse = false, requestInterceptors, responseInterceptors } = opts;
const requestInterceptorsToEject = requestInterceptors?.map((interceptor) => {
if(interceptor instanceof Array){
return requestInstance.interceptors.request.use((config) => {
const { url } = config;
if(interceptor[0].length === 2){
const { url: newUrl, options } = interceptor[0](url, config);
return { ...options, url: newUrl };
}
return interceptor[0](config);
}, interceptor[1]);
} else {
return requestInstance.interceptors.request.use((config) => {
const { url } = config;
if(interceptor.length === 2){
const { url: newUrl, options } = interceptor(url, config);
return { ...options, url: newUrl };
}
return interceptor(config);
})
}
});
const responseInterceptorsToEject = responseInterceptors?.map((interceptor) => {
return interceptor instanceof Array ?
requestInstance.interceptors.response.use(interceptor[0], interceptor[1]):
requestInstance.interceptors.response.use(interceptor);
});
return new Promise((resolve, reject)=>{
requestInstance
.request({...opts, url})
.then((res)=>{
requestInterceptorsToEject?.forEach((interceptor) => {
requestInstance.interceptors.request.eject(interceptor);
});
responseInterceptorsToEject?.forEach((interceptor) => {
requestInstance.interceptors.response.eject(interceptor);
});
resolve(getResponse ? res : res.data);
})
.catch((error)=>{
requestInterceptorsToEject?.forEach((interceptor) => {
requestInstance.interceptors.request.eject(interceptor);
});
responseInterceptorsToEject?.forEach((interceptor) => {
requestInstance.interceptors.response.eject(interceptor);
});
try {
const handler =
config?.errorConfig?.errorHandler;
if(handler)
handler(error, opts, config);
} catch (e) {
reject(e);
}
reject(error);
})
})
}
export {
useRequest,
UseRequestProvider,
request,
getRequestInstance,
};
export type {
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
AxiosError,
RequestError,
IResponseInterceptor as ResponseInterceptor,
IRequestOptions as RequestOptions,
IRequest as Request,
};

View File

@@ -0,0 +1,6 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import type { RequestConfig } from './types.d'
export type IRuntimeConfig = {
request?: RequestConfig
};

12
src/.umi/plugin-request/types.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
export type {
RequestConfig,
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
AxiosError,
RequestError,
ResponseInterceptor,
RequestOptions,
Request } from './request';

View File

@@ -0,0 +1,345 @@
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style:
}
::-ms-backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style:
}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style:
}
.container {
width: 100%
}
@media (min-width: 640px) {
.container {
max-width: 640px
}
}
@media (min-width: 768px) {
.container {
max-width: 768px
}
}
@media (min-width: 1024px) {
.container {
max-width: 1024px
}
}
@media (min-width: 1280px) {
.container {
max-width: 1280px
}
}
@media (min-width: 1536px) {
.container {
max-width: 1536px
}
}
.visible {
visibility: visible
}
.fixed {
position: fixed
}
.m-12 {
margin: 3rem
}
.mr-6 {
margin-right: 1.5rem
}
.block {
display: block
}
.flex {
display: -webkit-box;
display: -ms-flexbox;
display: flex
}
.grid {
display: grid
}
.hidden {
display: none
}
.h-2 {
height: 0.5rem
}
.h-6 {
height: 1.5rem
}
.w-2 {
width: 0.5rem
}
.w-20 {
width: 5rem
}
.w-28 {
width: 7rem
}
.w-52 {
width: 13rem
}
.max-w-\[712px\] {
max-width: 712px
}
.transform {
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
}
.cursor-pointer {
cursor: pointer
}
.items-center {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center
}
.justify-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between
}
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.border-2 {
border-width: 2px
}
.border-solid {
border-style: solid
}
.border-indigo-600 {
--tw-border-opacity: 1;
border-color: rgb(79 70 229 / var(--tw-border-opacity))
}
.text-7xl {
font-size: 4.5rem;
line-height: 1
}
.italic {
font-style: italic
}
.leading-6 {
line-height: 1.5rem
}
.text-blue-500 {
--tw-text-opacity: 1;
color: rgb(59 130 246 / var(--tw-text-opacity))
}
.text-red-600 {
--tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity))
}
.underline {
text-decoration-line: underline
}
.filter {
-webkit-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)
}
.transition {
-webkit-transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, -webkit-box-shadow, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, -webkit-box-shadow, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-box-shadow, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;
-webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-transition-duration: 150ms;
transition-duration: 150ms
}
.hover\:text-blue-500:hover {
--tw-text-opacity: 1;
color: rgb(59 130 246 / var(--tw-text-opacity))
}

View File

@@ -0,0 +1,39 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import { fork } from 'child_process';
import { merge } from 'lodash';
import { join } from 'path';
type ArgsType = { port: number; scene: string };
export const startMock = (args?: ArgsType) => {
const { port, scene } = merge(
{
port: 7000,
scene: 'default',
},
args
);
return new Promise<{
close: () => void;
}>((resolve, reject) => {
const proc = fork(join(__dirname, './startMock.js'), [], {
env: {
scene,
port: String(port),
},
});
proc.on('exit', (code) => {
if (code !== 0) {
reject(new Error(`Mock server exited with code ${code}`));
}
});
resolve({
close: () => {
proc.kill();
},
});
});
};

53
src/.umi/startMock.js Normal file
View File

@@ -0,0 +1,53 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
var express = require('express');
var fs = require('fs');
var { join } = require('path');
var { parse } = require('url');
var { scene, port } = process.env;
var getCachePath = (scene2) => {
return join(
process.cwd(),
'types',
'cache',
'mock',
(scene2 === 'default' ? '' : `${scene2}.`) + 'mock.cache.js'
);
};
var cachePath = getCachePath(scene);
if (!fs.existsSync(cachePath)) {
throw new Error(`mock cache file not found: ${cachePath}`);
}
fs.copyFileSync(
cachePath,
join(process.cwd(), 'mock', 'requestRecord.mock.js')
);
var mockFile = require(join(process.cwd(), 'mock', `requestRecord.mock.js`));
var app = express();
var server = app.listen(port, () => {
console.log(
'[Request Mock] Mock server is running at http://localhost:%s',
port
);
});
app.get('*', (req, res) => {
const { url } = req;
const key = `GET ${parse(url).pathname}`;
if (mockFile[key]) {
res.json(mockFile[key]);
} else {
res.status(404).send(`Mock key ${key} Not Found`);
}
});
app.post('*', (req, res) => {
const { url } = req;
const key = `POST ${parse(url).pathname}`;
if (mockFile[key]) {
res.json(mockFile[key]);
} else {
res.status(404).send(`Mock key ${key} Not Found`);
}
});
process.on('exit', () => {
server.close();
});

89
src/.umi/testBrowser.tsx Normal file
View File

@@ -0,0 +1,89 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import React, { useEffect, useState } from 'react';
import { ApplyPluginsType } from 'umi';
import { renderClient, RenderClientOpts } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
import { createHistory } from './core/history';
import { createPluginManager } from './core/plugin';
import { getRoutes } from './core/route';
import type { Location } from 'history';
import 'D:/project/xdnyAdmin/src/global.less';
import 'D:/project/xdnyAdmin/src/global.tsx';
import 'antd/dist/reset.css';
const publicPath = '/';
const runtimePublicPath = false;
type TestBrowserProps = {
location?: Partial<Location>;
historyRef?: React.MutableRefObject<Location>;
};
export function TestBrowser(props: TestBrowserProps) {
const pluginManager = createPluginManager();
const [context, setContext] = useState<RenderClientOpts | undefined>(
undefined
);
useEffect(() => {
const genContext = async () => {
const { routes, routeComponents } = await getRoutes(pluginManager);
// allow user to extend routes
await pluginManager.applyPlugins({
key: 'patchRoutes',
type: ApplyPluginsType.event,
args: {
routes,
routeComponents,
},
});
const contextOpts = pluginManager.applyPlugins({
key: 'modifyContextOpts',
type: ApplyPluginsType.modify,
initialValue: {},
});
const basename = contextOpts.basename || '/';
const history = createHistory({
type: 'memory',
basename,
});
const context = {
routes,
routeComponents,
pluginManager,
rootElement: contextOpts.rootElement || document.getElementById('root'),
publicPath,
runtimePublicPath,
history,
basename,
components: true,
};
const modifiedContext = pluginManager.applyPlugins({
key: 'modifyClientRenderOpts',
type: ApplyPluginsType.modify,
initialValue: context,
});
return modifiedContext;
};
genContext().then((context) => {
setContext(context);
if (props.location) {
context?.history?.push(props.location);
}
if (props.historyRef) {
props.historyRef.current = context?.history;
}
});
}, []);
if (context === undefined) {
return <div id="loading" />;
}
const Children = renderClient(context);
return (
<React.Fragment>
<Children />
</React.Fragment>
);
}

43
src/.umi/tsconfig.json Normal file
View File

@@ -0,0 +1,43 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"moduleResolution": "node",
"importHelpers": true,
"noEmit": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"sourceMap": true,
"baseUrl": "../../",
"strict": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"paths": {
"@/*": [
"src/*"
],
"@@/*": [
"src/.umi/*"
],
"@umijs/max": [
"D:\\project\\xdnyAdmin\\node_modules\\.pnpm\\umi@4.1.0_@babel+core@7.23.7_@types+node@20.10.6_@types+react@18.2.46_eslint@8.35.0_jest@29.7_mfwzemi764gvuaip6qabpjspqe\\node_modules\\umi"
],
"@umijs/max/typings": [
"src/.umi/typings"
]
}
},
"include": [
"../../.umirc.ts",
"../../**/*.d.ts",
"../../**/*.ts",
"../../**/*.tsx"
]
}

136
src/.umi/typings.d.ts vendored Normal file
View File

@@ -0,0 +1,136 @@
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
type CSSModuleClasses = { readonly [key: string]: string }
declare module '*.css' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.scss' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.sass' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.less' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.styl' {
const classes: CSSModuleClasses
export default classes
}
declare module '*.stylus' {
const classes: CSSModuleClasses
export default classes
}
// images
declare module '*.jpg' {
const src: string
export default src
}
declare module '*.jpeg' {
const src: string
export default src
}
declare module '*.png' {
const src: string
export default src
}
declare module '*.gif' {
const src: string
export default src
}
declare module '*.svg' {
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<
SVGSVGElement
> & { title?: string }>;
const src: string
export default src
}
declare module '*.ico' {
const src: string
export default src
}
declare module '*.webp' {
const src: string
export default src
}
declare module '*.avif' {
const src: string
export default src
}
// media
declare module '*.mp4' {
const src: string
export default src
}
declare module '*.webm' {
const src: string
export default src
}
declare module '*.ogg' {
const src: string
export default src
}
declare module '*.mp3' {
const src: string
export default src
}
declare module '*.wav' {
const src: string
export default src
}
declare module '*.flac' {
const src: string
export default src
}
declare module '*.aac' {
const src: string
export default src
}
// fonts
declare module '*.woff' {
const src: string
export default src
}
declare module '*.woff2' {
const src: string
export default src
}
declare module '*.eot' {
const src: string
export default src
}
declare module '*.ttf' {
const src: string
export default src
}
declare module '*.otf' {
const src: string
export default src
}
// other
declare module '*.wasm' {
const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Exports>
export default initWasm
}
declare module '*.webmanifest' {
const src: string
export default src
}
declare module '*.pdf' {
const src: string
export default src
}
declare module '*.txt' {
const src: string
export default src
}

78
src/.umi/umi.ts Normal file
View File

@@ -0,0 +1,78 @@
// @ts-nocheck
// This file is generated by Umi automatically
// DO NOT CHANGE IT MANUALLY!
import './core/polyfill';
import 'D:/project/xdnyAdmin/src/global.less';
import 'D:/project/xdnyAdmin/src/global.tsx';
import 'antd/dist/reset.css';
import { renderClient } from 'D:/project/xdnyAdmin/node_modules/.pnpm/@umijs+renderer-react@4.1.0_react-dom@18.1.0_react@18.1.0__react@18.1.0/node_modules/@umijs/renderer-react';
import { getRoutes } from './core/route';
import { createPluginManager } from './core/plugin';
import { createHistory } from './core/history';
import { ApplyPluginsType } from 'umi';
import 'D:/project/xdnyAdmin/src/.umi/plugin-tailwindcss/tailwind.css';
const publicPath = "/";
const runtimePublicPath = false;
async function render() {
const pluginManager = createPluginManager();
const { routes, routeComponents } = await getRoutes(pluginManager);
// allow user to extend routes
await pluginManager.applyPlugins({
key: 'patchRoutes',
type: ApplyPluginsType.event,
args: {
routes,
routeComponents,
},
});
const contextOpts = pluginManager.applyPlugins({
key: 'modifyContextOpts',
type: ApplyPluginsType.modify,
initialValue: {},
});
const basename = contextOpts.basename || '/';
const historyType = contextOpts.historyType || 'browser';
const history = createHistory({
type: historyType,
basename,
...contextOpts.historyOpts,
});
return (pluginManager.applyPlugins({
key: 'render',
type: ApplyPluginsType.compose,
initialValue() {
const context = {
routes,
routeComponents,
pluginManager,
rootElement: contextOpts.rootElement || document.getElementById('root'),
publicPath,
runtimePublicPath,
history,
historyType,
basename,
callback: contextOpts.callback,
};
const modifiedContext = pluginManager.applyPlugins({
key: 'modifyClientRenderOpts',
type: ApplyPluginsType.modify,
initialValue: context,
});
return renderClient(modifiedContext);
},
}))();
}
import './plugin-moment2dayjs/runtime.tsx'
render();
window.g_umi = {
version: '4.1.0',
};