diff --git a/web/.gitignore b/web/.gitignore index 881931c083f4a467fc5aa1adb6aebc0de7ac5c2a..4cbac851d246e4a77f8a950a5205c792258a712f 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -2,8 +2,8 @@ /.env.local /.umirc.local.ts /config/config.local.ts -/src/.umi -/src/.umi-production +/src/.umi/* +/src/.umi-production/* /src/.umi-test /dist .swc diff --git a/web/.umirc.ts b/web/.umirc.ts index ef815ac40ab6681dfb5a352d02f2eed796cebfb9..4b4b804b6a937c89de7d09c0c717a80d5cb887bb 100644 --- a/web/.umirc.ts +++ b/web/.umirc.ts @@ -8,6 +8,7 @@ export default defineConfig({ npmClient: 'npm', base: '/', publicPath: '/client/dist/', + esbuildMinifyIIFE: true, icons: { }, @@ -17,12 +18,12 @@ export default defineConfig({ }, plugins: ['@umijs/plugins/dist/dva'], dva: {}, - proxy: { - '/v1': { - 'target': 'http://54.80.112.79:9380/', - 'changeOrigin': true, - 'pathRewrite': { '^/v1': '/v1' }, - }, - }, + // proxy: { + // '/v1': { + // 'target': 'http://54.80.112.79:9380/', + // 'changeOrigin': true, + // 'pathRewrite': { '^/v1': '/v1' }, + // }, + // }, }); diff --git a/web/package-lock.json b/web/package-lock.json index b9bfbcf95a22f7ab673575bb6146aa136531a6bc..a3ae3d0cde6c5946281cf2d1ba2ef98817b002c2 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,5 +1,5 @@ { - "name": "client", + "name": "web", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/web/src/.umi/core/EmptyRoute.tsx b/web/src/.umi/core/EmptyRoute.tsx deleted file mode 100644 index bee45a6f7c334d5203071c7f0653bb219e647533..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/EmptyRoute.tsx +++ /dev/null @@ -1,9 +0,0 @@ -// @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 ; -} diff --git a/web/src/.umi/core/defineApp.ts b/web/src/.umi/core/defineApp.ts deleted file mode 100644 index dceaed698329c863a95ce7d8070a7d926219c4e3..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/defineApp.ts +++ /dev/null @@ -1,17 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import type { IRuntimeConfig as Plugin0 } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/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 - -export function defineApp(config: RuntimeConfig): RuntimeConfig { - return config; -} diff --git a/web/src/.umi/core/helmet.ts b/web/src/.umi/core/helmet.ts deleted file mode 100644 index d1c92d17924ca4f2913fe022abd33a44bdc4a85c..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/helmet.ts +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import React from 'react'; -import { HelmetProvider } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react'; -import { context } from './helmetContext'; - -export const innerProvider = (container) => { - return React.createElement(HelmetProvider, { context }, container); -} diff --git a/web/src/.umi/core/helmetContext.ts b/web/src/.umi/core/helmetContext.ts deleted file mode 100644 index 2faa97137d1c3fb5fabdb27e463f3994ad149a56..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/helmetContext.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -export const context = {}; diff --git a/web/src/.umi/core/history.ts b/web/src/.umi/core/history.ts deleted file mode 100644 index e367c6a3480e908c2a1230ee0d5fad6bdbd344c7..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/history.ts +++ /dev/null @@ -1,66 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import { createHashHistory, createMemoryHistory, createBrowserHistory } from 'C:/Users/zfc/Desktop/docgpt/client/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 }; diff --git a/web/src/.umi/core/historyIntelli.ts b/web/src/.umi/core/historyIntelli.ts deleted file mode 100644 index 40318dada64580fe5959a9a86b914f11cd9d0905..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/historyIntelli.ts +++ /dev/null @@ -1,132 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import { getRoutes } from './route' -import type { History } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react' - -type Routes = Awaited>['routes'] -type AllRoute = Routes[keyof Routes] -type IsRoot = 'parentId' extends keyof T ? false : true - -// show `/` in not `layout / wrapper` only -type GetAllRouteWithoutLayout = Item extends any - ? 'isWrapper' extends keyof Item - ? never - : 'isLayout' extends keyof Item - ? never - : Item - : never -type AllRouteWithoutLayout = GetAllRouteWithoutLayout -type IndexRoutePathname = '/' extends AllRouteWithoutLayout['path'] - ? '/' - : never - -type GetChildrens = T extends any - ? IsRoot extends true - ? never - : T - : never -type Childrens = GetChildrens -type Root = Exclude -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 -> = IsNever extends true - ? '' - : Item extends AllRoute - ? { - [Key in Item['path'] as TrimSlash]: UnionMerge< - RouteObject - > - } - : never - -type GetRootRouteObject = Item extends Root - ? { - [K in Item['path'] as TrimSlash]: UnionMerge> - } - : never -type MergedResult = UnionMerge> - -// --- patch history types --- - -type HistoryTo = Parameters['0'] -type HistoryPath = Exclude - -type UmiPathname = Path | (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 `/${infer R}` - ? TrimLeftSlash - : T -type TrimRightSlash = T extends `${infer R}/` - ? TrimRightSlash - : T -type TrimSlash = TrimLeftSlash> - -type IsNever = [T] extends [never] ? true : false -type IsEqual = (() => G extends A ? 1 : 2) extends () => G extends B - ? 1 - : 2 - ? true - : false - -type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( - k: infer I -) => void - ? I - : never -type UnionMerge = UnionToIntersection extends infer O - ? { [K in keyof O]: O[K] } - : never - -type ExcludeEmptyKey = IsEqual extends true ? never : T - -type PathConcat< - TKey extends string, - TValue, - N = TrimSlash -> = TValue extends string - ? ExcludeEmptyKey - : - | ExcludeEmptyKey - | `${N & string}${IsNever> extends true - ? '' - : '/'}${UnionPath}` - -type UnionPath = { - [K in keyof T]-?: PathConcat -}[keyof T] - -type MakeSureLeftSlash = T extends any - ? `/${TrimRightSlash}` - : never - -// exclude `/*`, because it always at the top of the IDE tip list -type Path> = Exclude, '/*'> | IndexRoutePathname diff --git a/web/src/.umi/core/plugin.ts b/web/src/.umi/core/plugin.ts deleted file mode 100644 index a3c6a54c6d62ac20676293cd1299fb374af3e0ae..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/plugin.ts +++ /dev/null @@ -1,45 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import * as Plugin_0 from '@@/core/helmet.ts'; -import * as Plugin_1 from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/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: Plugin_0, - path: process.env.NODE_ENV === 'production' ? void 0 : '@@/core/helmet.ts', - }, - { - apply: Plugin_1, - path: process.env.NODE_ENV === 'production' ? void 0 : 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/runtime.tsx', - }, - ]; -} - -export function getValidKeys() { - return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange','dva',]; -} - -let pluginManager = null; - -export function createPluginManager() { - pluginManager = PluginManager.create({ - plugins: getPlugins(), - validKeys: getValidKeys(), - }); - - - return pluginManager; -} - -export function getPluginManager() { - return pluginManager; -} diff --git a/web/src/.umi/core/pluginConfig.ts b/web/src/.umi/core/pluginConfig.ts deleted file mode 100644 index 0ffd054f46ed4981c0ed6038673f9b57cefb51ae..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/pluginConfig.ts +++ /dev/null @@ -1,292 +0,0 @@ -// @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; - scripts: Array; - routes: Array<{ - component?: (string | undefined); - layout?: (false | undefined); - path?: (string | undefined); - redirect?: (string | undefined); - routes?: IConfigTypes['routes']; - wrappers?: (Array | undefined); -} | { [x: string]: any }>; - routeLoader: { - moduleType: "esm" | "cjs"; -}; - reactRouter5Compat: boolean | { - -}; - presets: Array; - plugins: Array; - 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; - esbuildMinifyIIFE: boolean; - conventionRoutes: { - base?: (string | undefined); - exclude?: (Array | 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; - postcssLoader: { [x: string]: any }; - outputPath: string; - normalCSSLoaderModules: { [x: string]: any }; - mfsu: { - cacheDirectory?: (string | undefined); - chainWebpack?: (((...args: any[]) => unknown) | undefined); - esbuild?: (boolean | undefined); - exclude?: (Array | undefined); - include?: (Array | undefined); - mfName?: (string | undefined); - remoteAliases?: (Array | 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 | undefined); - http2?: (boolean | undefined); - key?: (string | undefined); -}; - hash: boolean; - forkTSChecker: { [x: string]: any }; - fastRefresh: boolean; - extraPostCSSPlugins: Array; - extraBabelPresets: Array>; - extraBabelPlugins: Array>; - extraBabelIncludes: Array; - 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 | undefined); - failOnHint?: (boolean | undefined); - patterns?: (Array | 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 | undefined); -}; - esmi: { - cdnOrigin: string; - shimUrl?: (string | undefined); -}; - exportStatic: { - extraRoutePaths?: (((...args: any[]) => unknown) | Array | undefined); - ignorePreRenderError?: (boolean | undefined); -}; - favicons: Array; - helmet: boolean; - icons: { - autoInstall?: ({ - -} | undefined); - defaultComponentConfig?: ({ - -} | undefined); - alias?: ({ - -} | undefined); - include?: (Array | undefined); -}; - mock: { - exclude?: (Array | undefined); - include?: (Array | undefined); -}; - mpa: { - template?: (string | undefined); - layout?: (string | undefined); - getConfigFromEntryFile?: (boolean | undefined); - entry?: ({ - -} | undefined); -}; - phantomDependency: { - exclude?: (Array | undefined); -}; - polyfill: { - imports?: (Array | undefined); -}; - routePrefetch: { - -}; - terminal: { - -}; - tmpFiles: boolean; - clientLoader: { - -}; - routeProps: { - -}; - ssr: { - serverBuildPath?: (string | undefined); - platform?: (string | undefined); - builder?: ("esbuild" | "webpack" | undefined); -}; - lowImport: { - libs?: (Array | undefined); - css?: (string | undefined); -}; - vite: { - -}; - apiRoute: { - platform?: (string | undefined); -}; - monorepoRedirect: boolean | { - srcDir?: (Array | undefined); - exclude?: (Array | 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 | undefined); - allowEmoji?: (boolean | undefined); -}; - run: { - globals?: (Array | undefined); -}; - dva: { - extraModels?: (Array | undefined); - immer?: ({ [x: string]: any } | undefined); - skipModelValidate?: (boolean | undefined); -}; -}; - -type PrettifyWithCloseable = { - [K in keyof T]: T[K] | false; -} & {}; - -export type IConfigFromPlugins = PrettifyWithCloseable< - IConfigFromPluginsJoi & Partial ->; diff --git a/web/src/.umi/core/pluginConfigJoi.d.ts b/web/src/.umi/core/pluginConfigJoi.d.ts deleted file mode 100644 index 215e7b52c3d71b7fa03f63c340f2d64061b986c7..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/pluginConfigJoi.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -// Created by Umi Plugin - -export interface IConfigFromPluginsJoi { - -} diff --git a/web/src/.umi/core/polyfill.ts b/web/src/.umi/core/polyfill.ts deleted file mode 100644 index 2ae5f04898d937263546fe5be972d29bb504a564..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/polyfill.ts +++ /dev/null @@ -1,220 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.error.cause.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.aggregate-error.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.aggregate-error.cause.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.at.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.find-last.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.find-last-index.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.push.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.reduce.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.reduce-right.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-reversed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-sorted.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-spliced.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.with.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.map.group-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.object.group-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.object.has-own.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.promise.any.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.promise.with-resolvers.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.reflect.to-string-tag.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.regexp.flags.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.at-alternative.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.is-well-formed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.replace-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.to-well-formed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.at.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.find-last.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.find-last-index.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.set.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.to-reversed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.to-sorted.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.with.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.suppressed-error.constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.from-async.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.filter-out.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.filter-reject.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-by-to-map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-to-map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.is-template-object.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.last-index.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.last-item.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.unique-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.detached.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.transfer.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-disposable-stack.constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.as-indexed-pairs.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.async-dispose.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.drop.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.every.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.filter.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.find.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.flat-map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.for-each.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.indexed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.reduce.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.some.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.take.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.to-array.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.bigint.range.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.composite-key.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.composite-symbol.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.get-float16.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.get-uint8-clamped.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.set-float16.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.set-uint8-clamped.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.disposable-stack.constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.demethodize.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.is-callable.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.is-constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.un-this.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.constructor.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.as-indexed-pairs.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.dispose.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.drop.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.every.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.filter.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.find.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.flat-map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.for-each.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.indexed.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.range.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.reduce.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.some.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.take.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.to-array.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.to-async.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.is-raw-json.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.parse.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.raw-json.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.delete-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.emplace.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.every.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.filter.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.find.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.find-key.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.includes.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.key-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.key-of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.map-keys.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.map-values.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.merge.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.reduce.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.some.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.update.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.update-or-insert.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.upsert.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.clamp.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.deg-per-rad.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.degrees.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.fscale.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.f16round.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.iaddh.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.imulh.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.isubh.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.rad-per-deg.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.radians.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.scale.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.seeded-prng.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.signbit.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.umulh.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.number.from-string.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.number.range.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-entries.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-keys.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-values.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.observable.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.promise.try.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.define-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.delete-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-own-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.has-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.has-own-metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.regexp.escape.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.add-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.delete-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.difference.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.difference.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.every.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.filter.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.find.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.intersection.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.intersection.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-disjoint-from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-subset-of.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-subset-of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-superset-of.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-superset-of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.join.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.map.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.reduce.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.some.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.symmetric-difference.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.union.v2.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.union.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.at.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.cooked.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.code-points.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.dedent.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.async-dispose.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.dispose.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-registered-symbol.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-registered.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-well-known-symbol.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-well-known.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.matcher.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.metadata.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.metadata-key.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.observable.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.pattern-match.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.replace-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.from-async.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.filter-out.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.filter-reject.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.group-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.to-spliced.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.unique-by.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.from-base64.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.from-hex.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.to-base64.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.to-hex.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.delete-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.emplace.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.upsert.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.add-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.delete-all.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.from.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.of.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.dom-exception.stack.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.immediate.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.self.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.structured-clone.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url.can-parse.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.delete.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.has.js"; -import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.size.js"; -import 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/preset-umi/node_modules/regenerator-runtime/runtime.js'; -export {}; diff --git a/web/src/.umi/core/route.tsx b/web/src/.umi/core/route.tsx deleted file mode 100644 index 9632e50b8c83a502a0c42f9a0714911471ad8d0b..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/route.tsx +++ /dev/null @@ -1,22 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import React from 'react'; - -export async function getRoutes() { - const routes = {"1":{"path":"/login","layout":false,"id":"1"},"2":{"path":"/","redirect":"/knowledge","parentId":"@@/global-layout","id":"2"},"3":{"id":"3","name":"知识库","icon":"home","auth":[3,4,100],"path":"/knowledge","pathname":"knowledge","parentId":"@@/global-layout"},"4":{"id":"4","name":"知识库","icon":"home","auth":[3,4,100],"path":"/knowledge/add/*","pathname":"knowledge","parentId":"@@/global-layout"},"5":{"id":"5","name":"聊天","icon":"home","auth":[3,4,100],"path":"/chat","pathname":"chat","parentId":"@@/global-layout"},"6":{"id":"6","name":"设置","icon":"home","auth":[3,4,100],"path":"/setting","pathname":"setting","parentId":"@@/global-layout"},"7":{"id":"7","name":"文件","icon":"file","auth":[3,4,100],"path":"/file","pathname":"file","parentId":"@@/global-layout"},"8":{"path":"/*","layout":false,"id":"8"},"@@/global-layout":{"id":"@@/global-layout","path":"/","isLayout":true}} as const; - return { - routes, - routeComponents: { -'1': React.lazy(() => import(/* webpackChunkName: "p__login__index" */'@/pages/login/index.tsx')), -'2': React.lazy(() => import(/* webpackChunkName: "layouts__index" */'@/layouts/index.tsx')), -'3': React.lazy(() => import(/* webpackChunkName: "p__knowledge__index" */'@/pages/knowledge/index.tsx')), -'4': React.lazy(() => import(/* webpackChunkName: "p__add-knowledge__index" */'@/pages/add-knowledge/index.tsx')), -'5': React.lazy(() => import(/* webpackChunkName: "p__chat__index" */'@/pages/chat/index.tsx')), -'6': React.lazy(() => import(/* webpackChunkName: "p__setting__index" */'@/pages/setting/index.tsx')), -'7': React.lazy(() => import(/* webpackChunkName: "p__file__index" */'@/pages/file/index.tsx')), -'8': React.lazy(() => import(/* webpackChunkName: "p__404" */'@/pages/404.jsx')), -'@@/global-layout': React.lazy(() => import(/* webpackChunkName: "layouts__index" */'C:/Users/zfc/Desktop/docgpt/client/src/layouts/index.tsx')), -}, - }; -} diff --git a/web/src/.umi/core/terminal.ts b/web/src/.umi/core/terminal.ts deleted file mode 100644 index b07942d59d1cfccd89bf9804bc6bd4223d5f8a2d..0000000000000000000000000000000000000000 --- a/web/src/.umi/core/terminal.ts +++ /dev/null @@ -1,37 +0,0 @@ -// @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 }; diff --git a/web/src/.umi/exports.ts b/web/src/.umi/exports.ts deleted file mode 100644 index e210dcbf58a0b7908360dc8b7de4de28b7788cea..0000000000000000000000000000000000000000 --- a/web/src/.umi/exports.ts +++ /dev/null @@ -1,22 +0,0 @@ -// @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 { connect, useDispatch, useStore, useSelector, getDvaApp } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva'; -export { Icon } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-icons'; -// plugins types.d.ts -export * from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/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 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react'; -export type { History } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react' -// umi/client/client/plugin -export { ApplyPluginsType, PluginManager } from 'C:/Users/zfc/Desktop/docgpt/client/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'; diff --git a/web/src/.umi/plugin-dva/dva.tsx b/web/src/.umi/plugin-dva/dva.tsx deleted file mode 100644 index 2bd9789940cf26ce6905eae4369d23d1b419b230..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/dva.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -// It's faked dva -// aliased to @umijs/plugins/templates/dva -import { create, Provider } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/plugins/libs/dva.tsx'; -import createLoading from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/dva-loading/dist/index.js'; - -import React, { useRef } from 'react'; -import { history, ApplyPluginsType, useAppData } from 'umi'; -import { models } from './models'; - -let dvaApp: any; - -export function RootContainer(props: any) { - const { pluginManager } = useAppData(); - const app = useRef(); - const runtimeDva = pluginManager.applyPlugins({ - key: 'dva', - type: ApplyPluginsType.modify, - initialValue: {}, - }); - if (!app.current) { - app.current = create( - { - history, - ...(runtimeDva.config || {}), - }, - { - initialReducer: {}, - setupMiddlewares(middlewares: Function[]) { - return [...middlewares]; - }, - setupApp(app: IDvaApp) { - app._history = history; - }, - }, - ); - dvaApp = app.current; - app.current.use(createLoading()); - - - - (runtimeDva.plugins || []).forEach((p) => { - app.current.use(p); - }); - for (const id of Object.keys(models)) { - app.current.model({ - namespace: models[id].namespace, - ...models[id].model, - }); - } - app.current.start(); - } - return {props.children}; -} - -export function getDvaApp() { - return dvaApp; -} diff --git a/web/src/.umi/plugin-dva/index.ts b/web/src/.umi/plugin-dva/index.ts deleted file mode 100644 index 6c2f0f75d34ec813de71d26c2d49d3d95d26c09e..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -export { connect, useDispatch, useStore, useSelector } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/plugins/libs/dva.tsx'; -export { getDvaApp } from './dva'; diff --git a/web/src/.umi/plugin-dva/models.ts b/web/src/.umi/plugin-dva/models.ts deleted file mode 100644 index 89d4fc255c6176cd21ec0893b334c77913c41cd8..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/models.ts +++ /dev/null @@ -1,20 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import model_1 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/components/knowledge-file/model'; -import model_2 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/components/knowledge-setting/model'; -import model_3 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/model'; -import model_4 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/chat/model'; -import model_5 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/knowledge/model'; -import model_6 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/login/model'; -import model_7 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/setting/model'; - -export const models = { -model_1: { namespace: 'add-knowledge.components.knowledge-file.model', model: model_1 }, -model_2: { namespace: 'add-knowledge.components.knowledge-setting.model', model: model_2 }, -model_3: { namespace: 'add-knowledge.model', model: model_3 }, -model_4: { namespace: 'chat.model', model: model_4 }, -model_5: { namespace: 'knowledge.model', model: model_5 }, -model_6: { namespace: 'login.model', model: model_6 }, -model_7: { namespace: 'setting.model', model: model_7 }, -} as const diff --git a/web/src/.umi/plugin-dva/runtime.tsx b/web/src/.umi/plugin-dva/runtime.tsx deleted file mode 100644 index 504d89ceb107d3cefbf2f295278d9131ec03e8c4..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/runtime.tsx +++ /dev/null @@ -1,9 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import React from 'react'; -import { RootContainer } from './dva'; - -export function dataflowProvider(container, opts) { - return React.createElement(RootContainer, opts, container); -} diff --git a/web/src/.umi/plugin-dva/runtimeConfig.d.ts b/web/src/.umi/plugin-dva/runtimeConfig.d.ts deleted file mode 100644 index aa3f59fb69ff2fbbc90a3b656842ca664521349e..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/runtimeConfig.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -export interface IRuntimeConfig { - dva?: { - config?: { - initialState?: Record; - onError?: any; - onStateChange?: any; - onAction?: any; - onHmr?: any; - onReducer?: any; - onEffect?: any; - extraReducers?: any; - extraEnhancers?: any; - [key: string]: any; - }, - plugins?: string[]; - } -} diff --git a/web/src/.umi/plugin-dva/types.d.ts b/web/src/.umi/plugin-dva/types.d.ts deleted file mode 100644 index 555f6b8cdd59fbf17907f88a17d883bc3872eafe..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-dva/types.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import type { History } from 'umi'; - -export interface ConnectProps { - dispatch?: Dispatch; -} -type RequiredConnectProps = Required -export type ConnectRC< - T = {}, - > = React.ForwardRefRenderFunction; -interface Action { - type: T -} -interface AnyAction extends Action { - // Allows any extra properties to be defined in an action. - [extraProps: string]: any -} -interface Dispatch { - (action: T): T -} -interface EffectsCommandMap { - put: (action: A) => any, - call: Function, - select: Function, - take: Function, - cancel: Function, - [key: string]: any, -} -interface Action { - type: T -} -export type Reducer = (prevState: S, action: A) => S; -export type Effect = (action: AnyAction, effects: EffectsCommandMap) => void; -type EffectType = 'takeEvery' | 'takeLatest' | 'watcher' | 'throttle'; -type EffectWithType = [Effect, { type: EffectType }]; -export type Subscription = (api: SubscriptionAPI, done: Function) => void; - -export interface ReducersMapObject { - [key: string]: Reducer, -} -export interface EffectsMapObject { - [key: string]: Effect | EffectWithType, -} -export interface SubscriptionAPI { - dispatch: Dispatch, - history: History, -} -export interface SubscriptionsMapObject { - [key: string]: Subscription, -} -export interface DvaModel> { - namespace: string, - state?: T, - reducers?: R, - effects?: E, - subscriptions?: SubscriptionsMapObject, -} diff --git a/web/src/.umi/plugin-icons/icons.tsx b/web/src/.umi/plugin-icons/icons.tsx deleted file mode 100644 index 3ce469b2baf2508822b5e263434e669b4c1a9d01..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-icons/icons.tsx +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import React from 'react'; -const localGoogle = props => ; -export { localGoogle }; -const localGithub = props => ; -export { localGithub }; diff --git a/web/src/.umi/plugin-icons/index.css b/web/src/.umi/plugin-icons/index.css deleted file mode 100644 index cef01b6f2c43a404520bab4687ad00085807cba1..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-icons/index.css +++ /dev/null @@ -1,27 +0,0 @@ -.umiIconDoNotUseThisHover { - display: none; -} -.umiIconDoNotUseThis:hover svg { - display: none; -} -.umiIconDoNotUseThis:hover .umiIconDoNotUseThisHover { - display: inline-block; -} -.umiIconLoadingCircle { - display: inline-block; - -webkit-animation: loadingCircle 1s infinite linear; - animation: umiIconLoadingCircle 1s linear infinite; -} - -@-webkit-keyframes umiIconLoadingCircle { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@keyframes umiIconLoadingCircle { - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} diff --git a/web/src/.umi/plugin-icons/index.tsx b/web/src/.umi/plugin-icons/index.tsx deleted file mode 100644 index c96240f741e1822c796d83fb6ef8dde531fb9a04..0000000000000000000000000000000000000000 --- a/web/src/.umi/plugin-icons/index.tsx +++ /dev/null @@ -1,243 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import React from 'react'; -import * as iconsMap from './icons'; -import './index.css'; - -const alias = {}; -type AliasKeys = keyof typeof alias; -const localIcons = ["github","google"] as const; -type LocalIconsKeys = typeof localIcons[number]; - -type IconCollections = 'academicons' | - 'akar-icons' | - 'ant-design' | - 'arcticons' | - 'basil' | - 'bi' | - 'bpmn' | - 'brandico' | - 'bx' | - 'bxl' | - 'bxs' | - 'bytesize' | - 'carbon' | - 'charm' | - 'ci' | - 'cib' | - 'cif' | - 'cil' | - 'circle-flags' | - 'circum' | - 'clarity' | - 'codicon' | - 'cryptocurrency-color' | - 'cryptocurrency' | - 'dashicons' | - 'ei' | - 'el' | - 'emblemicons' | - 'emojione-monotone' | - 'emojione-v1' | - 'emojione' | - 'entypo-social' | - 'entypo' | - 'eos-icons' | - 'ep' | - 'et' | - 'eva' | - 'fa-brands' | - 'fa-regular' | - 'fa-solid' | - 'fa' | - 'fa6-brands' | - 'fa6-regular' | - 'fa6-solid' | - 'fad' | - 'fe' | - 'feather' | - 'file-icons' | - 'flag' | - 'flagpack' | - 'flat-color-icons' | - 'flat-ui' | - 'fluent-emoji-flat' | - 'fluent-emoji-high-contrast' | - 'fluent-emoji' | - 'fluent-mdl2' | - 'fluent' | - 'fontelico' | - 'fontisto' | - 'foundation' | - 'fxemoji' | - 'gala' | - 'game-icons' | - 'geo' | - 'gg' | - 'gis' | - 'gridicons' | - 'grommet-icons' | - 'healthicons' | - 'heroicons-outline' | - 'heroicons-solid' | - 'heroicons' | - 'humbleicons' | - 'ic' | - 'icomoon-free' | - 'icon-park-outline' | - 'icon-park-solid' | - 'icon-park-twotone' | - 'icon-park' | - 'iconoir' | - 'icons8' | - 'il' | - 'ion' | - 'iwwa' | - 'jam' | - 'la' | - 'line-md' | - 'logos' | - 'ls' | - 'lucide' | - 'majesticons' | - 'maki' | - 'map' | - 'material-symbols' | - 'mdi-light' | - 'mdi' | - 'medical-icon' | - 'memory' | - 'mi' | - 'mingcute' | - 'mono-icons' | - 'nimbus' | - 'nonicons' | - 'noto-v1' | - 'noto' | - 'octicon' | - 'oi' | - 'ooui' | - 'openmoji' | - 'pajamas' | - 'pepicons-pop' | - 'pepicons-print' | - 'pepicons' | - 'ph' | - 'pixelarticons' | - 'prime' | - 'ps' | - 'quill' | - 'radix-icons' | - 'raphael' | - 'ri' | - 'si-glyph' | - 'simple-icons' | - 'simple-line-icons' | - 'skill-icons' | - 'subway' | - 'svg-spinners' | - 'system-uicons' | - 'tabler' | - 'teenyicons' | - 'topcoat' | - 'twemoji' | - 'typcn' | - 'uil' | - 'uim' | - 'uis' | - 'uit' | - 'uiw' | - 'vaadin' | - 'vs' | - 'vscode-icons' | - 'websymbol' | - 'whh' | - 'wi' | - 'wpf' | - 'zmdi' | - 'zondicons'; -type Icon = `${IconCollections}:${string}`; - -interface IUmiIconProps extends React.SVGAttributes { - icon: AliasKeys | Icon | `local:${LocalIconsKeys}`; - hover?: AliasKeys | string; - className?: string; - viewBox?: string; - width?: string; - height?: string; - style?: any; - spin?: boolean; - rotate?: number | string; - flip?: 'vertical' | 'horizontal' | 'horizontal,vertical' | 'vertical,horizontal'; -} - -export const Icon = React.forwardRef((props, ref) => { - const { icon, hover, style, className = '' , rotate, spin, flip, ...extraProps } = props; - const iconName = normalizeIconName(alias[icon] || icon); - const Component = iconsMap[iconName]; - if (!Component) { - // TODO: give a error icon when dev, to help developer find the error - return null; - } - const HoverComponent = hover ? iconsMap[normalizeIconName(alias[hover] || hover)] : null; - const cls = spin ? 'umiIconLoadingCircle' : undefined; - const svgStyle = {}; - const transform: string[] = []; - if (rotate) { - const rotateDeg = normalizeRotate(rotate); - transform.push(`rotate(${rotateDeg}deg)`); - } - if (flip) { - const flipMap = flip.split(',').reduce((memo, item) => { - memo[item] = 1; - return memo; - }, {}); - if (flipMap.vertical) { - transform.push(`rotateY(180deg)`); - } - if (flipMap.horizontal) { - transform.push(`rotateX(180deg)`); - } - } - if (transform.length) { - const transformStr = transform.join(''); - svgStyle.msTransform = transformStr; - svgStyle.transform = transformStr; - } - - const spanClassName = HoverComponent ? 'umiIconDoNotUseThis ' : '' + className; - const spanClass = spanClassName ? { className: spanClassName } : {}; - - return ( - - - { - HoverComponent ? : null - } - - ); -}); - -function normalizeRotate(rotate: number | string) { - if (typeof rotate === 'number') { - return rotate * 90; - } - if (typeof rotate === 'string') { - if (rotate.endsWith('deg')) { - return parseInt(rotate, 10); - } - if (rotate.endsWith('%')) { - return parseInt(rotate, 10) / 100 * 360; - } - return 0; - } -} - -function camelCase(str: string) { - return str.replace(/\//g, '-').replace(/-([a-zA-Z]|[1-9])/g, (g) => g[1].toUpperCase()); -} - -function normalizeIconName(name: string) { - return camelCase(name.replace(':', '-')); -} diff --git a/web/src/.umi/testBrowser.tsx b/web/src/.umi/testBrowser.tsx deleted file mode 100644 index 00f4134f3865c489224a3865afb1cf9b31b1d481..0000000000000000000000000000000000000000 --- a/web/src/.umi/testBrowser.tsx +++ /dev/null @@ -1,87 +0,0 @@ -// @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 'C:/Users/zfc/Desktop/docgpt/client/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'; - - -const publicPath = '/'; -const runtimePublicPath = false; - -type TestBrowserProps = { - location?: Partial; - historyRef?: React.MutableRefObject; -}; - -export function TestBrowser(props: TestBrowserProps) { - const pluginManager = createPluginManager(); - const [context, setContext] = useState( - 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
; - } - - const Children = renderClient(context); - return ( - - - - ); -} diff --git a/web/src/.umi/tsconfig.json b/web/src/.umi/tsconfig.json deleted file mode 100644 index d9971abc561dfcf35b32823a73ca780a7842975b..0000000000000000000000000000000000000000 --- a/web/src/.umi/tsconfig.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "moduleResolution": "bundler", - "importHelpers": true, - "noEmit": true, - "jsx": "react-jsx", - "esModuleInterop": true, - "sourceMap": true, - "baseUrl": "../../", - "strict": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "paths": { - "@/*": [ - "src/*" - ], - "@@/*": [ - "src/.umi/*" - ], - "umi": [ - "C:\\Users\\zfc\\Desktop\\docgpt\\client\\node_modules\\umi" - ], - "umi/typings": [ - "src/.umi/typings" - ] - } - }, - "include": [ - "../../.umirc.ts", - "../../**/*.d.ts", - "../../**/*.ts", - "../../**/*.tsx" - ] -} diff --git a/web/src/.umi/typings.d.ts b/web/src/.umi/typings.d.ts deleted file mode 100644 index 19725a340daa4bc1e23e8ba06e01f7b2ecf2450f..0000000000000000000000000000000000000000 --- a/web/src/.umi/typings.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -// 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 & { 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 - 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 -} diff --git a/web/src/.umi/umi.ts b/web/src/.umi/umi.ts deleted file mode 100644 index 9e3e220cd5315b5ea19ad35ebec64486fae84bba..0000000000000000000000000000000000000000 --- a/web/src/.umi/umi.ts +++ /dev/null @@ -1,76 +0,0 @@ -// @ts-nocheck -// This file is generated by Umi automatically -// DO NOT CHANGE IT MANUALLY! -import './core/polyfill'; - -import { renderClient } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react'; -import { getRoutes } from './core/route'; -import { createPluginManager } from './core/plugin'; -import { createHistory } from './core/history'; -import { ApplyPluginsType } from 'umi'; - - -const publicPath = "/client/dist/"; -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 || 'hash'; - - 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); - }, - }))(); -} - - -render(); - -window.g_umi = { - version: '4.1.0', -}; diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/createModal.tsx b/web/src/pages/add-knowledge/components/knowledge-chunk/createModal.tsx new file mode 100644 index 0000000000000000000000000000000000000000..8414bfc4e2e4f1b03eb09172215ebd2b3fa4d385 --- /dev/null +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/createModal.tsx @@ -0,0 +1,99 @@ +import React, { useEffect, useState } from 'react' +import { connect, Dispatch } from 'umi'; +import i18n from 'i18next'; +import { useTranslation, Trans } from 'react-i18next' +import { Input, Modal, Form } from 'antd' +import styles from './index.less'; +import type { chunkModelState } from './model' +import EditTag from './editTag' + +type FieldType = { + content_ltks?: string; +}; +interface kFProps { + dispatch: Dispatch; + chunkModel: chunkModelState; + getChunkList: () => void; + doc_id: string +} +const Index: React.FC = ({ chunkModel, dispatch, getChunkList, doc_id }) => { + const { isShowCreateModal, chunk_id, chunkInfo } = chunkModel + const [important_kwd, setImportantKwd] = useState(['Unremovable', 'Tag 2', 'Tag 3']); + const { t } = useTranslation() + const handleCancel = () => { + dispatch({ + type: 'chunkModel/updateState', + payload: { + isShowCreateModal: false + } + }); + }; + useEffect(() => { + if (chunk_id && isShowCreateModal) { + dispatch({ + type: 'chunkModel/get_chunk', + payload: { + chunk_id + }, + callback(info: any) { + console.log(info) + const { content_ltks, important_kwd = [] } = info + form.setFieldsValue({ content_ltks }) + setImportantKwd(important_kwd) + } + }); + } + }, [chunk_id, isShowCreateModal]) + const [form] = Form.useForm() + const handleOk = async () => { + try { + const values = await form.validateFields(); + dispatch({ + type: 'chunkModel/create_hunk', + payload: { + content_ltks: values.content_ltks, + doc_id, + chunk_id, + important_kwd + }, + callback: () => { + dispatch({ + type: 'chunkModel/updateState', + payload: { + isShowCreateModal: false + } + }); + getChunkList && getChunkList() + } + }); + + } catch (errorInfo) { + console.log('Failed:', errorInfo); + } + }; + + return ( + +
+ + label="chunk 内容" + name="content_ltks" + rules={[{ required: true, message: 'Please input name!' }]} + > + + + + +
+ + + ); +} +export default connect(({ chunkModel, loading }) => ({ chunkModel, loading }))(Index); diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/editTag.tsx b/web/src/pages/add-knowledge/components/knowledge-chunk/editTag.tsx new file mode 100644 index 0000000000000000000000000000000000000000..c5a0878d06e2779e252206bbdebd320866a75845 --- /dev/null +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/editTag.tsx @@ -0,0 +1,142 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { PlusOutlined } from '@ant-design/icons'; +import type { InputRef } from 'antd'; +import { Input, Space, Tag, theme, Tooltip } from 'antd'; +interface editTagsProps { + tags: any[], + setTags: (tags: any[]) => void +} +const App: React.FC = ({ tags, setTags }) => { + const { token } = theme.useToken(); + + const [inputVisible, setInputVisible] = useState(false); + const [inputValue, setInputValue] = useState(''); + const [editInputIndex, setEditInputIndex] = useState(-1); + const [editInputValue, setEditInputValue] = useState(''); + const inputRef = useRef(null); + const editInputRef = useRef(null); + + useEffect(() => { + if (inputVisible) { + inputRef.current?.focus(); + } + }, [inputVisible]); + + useEffect(() => { + editInputRef.current?.focus(); + }, [editInputValue]); + + const handleClose = (removedTag: string) => { + const newTags = tags.filter((tag) => tag !== removedTag); + console.log(newTags); + setTags(newTags); + }; + + const showInput = () => { + setInputVisible(true); + }; + + const handleInputChange = (e: React.ChangeEvent) => { + setInputValue(e.target.value); + }; + + const handleInputConfirm = () => { + if (inputValue && !tags.includes(inputValue)) { + setTags([...tags, inputValue]); + } + setInputVisible(false); + setInputValue(''); + }; + + const handleEditInputChange = (e: React.ChangeEvent) => { + setEditInputValue(e.target.value); + }; + + const handleEditInputConfirm = () => { + const newTags = [...tags]; + newTags[editInputIndex] = editInputValue; + setTags(newTags); + setEditInputIndex(-1); + setEditInputValue(''); + }; + + const tagInputStyle: React.CSSProperties = { + width: 64, + height: 22, + marginInlineEnd: 8, + verticalAlign: 'top', + }; + + const tagPlusStyle: React.CSSProperties = { + height: 22, + background: token.colorBgContainer, + borderStyle: 'dashed', + }; + + return ( + + {tags.map((tag, index) => { + if (editInputIndex === index) { + return ( + + ); + } + const isLongTag = tag.length > 20; + const tagElem = ( + handleClose(tag)} + > + { + if (index !== 0) { + setEditInputIndex(index); + setEditInputValue(tag); + e.preventDefault(); + } + }} + > + {isLongTag ? `${tag.slice(0, 20)}...` : tag} + + + ); + return isLongTag ? ( + + {tagElem} + + ) : ( + tagElem + ); + })} + {inputVisible ? ( + + ) : ( + + 添加关键词 + + )} + + ); +}; + +export default App; \ No newline at end of file diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/index.less b/web/src/pages/add-knowledge/components/knowledge-chunk/index.less new file mode 100644 index 0000000000000000000000000000000000000000..f4f42fb995d9e2d53c2b456ba6609af666244845 --- /dev/null +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/index.less @@ -0,0 +1,70 @@ +.chunkPage { + padding: 24px; + + display: flex; + height: calc(100vh - 112px); + flex-direction: column; + + .filter { + margin: 10px 0; + display: flex; + height: 32px; + justify-content: space-between; + } + + .pageContent { + flex: 1; + width: 100%; + padding-right: 12px; + overflow-y: auto; + + .spin { + min-height: 400px; + } + } + + .pageFooter { + height: 32px; + } +} + +.container { + height: 100px; + display: flex; + flex-direction: column; + justify-content: space-between; + + .content { + display: flex; + justify-content: space-between; + + .context { + flex: 1; + // width: 207px; + height: 88px; + overflow: hidden; + } + } + + .footer { + height: 20px; + + .text { + margin-left: 10px; + } + } +} + +.card { + :global { + .ant-card-body { + padding: 10px; + margin: 0; + } + + margin-bottom: 10px; + } + + cursor: pointer; + +} \ No newline at end of file diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx b/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..076820914be9b188d0fd970b90a710ef41732c47 --- /dev/null +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx @@ -0,0 +1,224 @@ +import React, { useEffect, useState, useCallback } from 'react'; +import { useNavigate, connect, Dispatch } from 'umi' +import { Card, Row, Col, Input, Select, Switch, Pagination, Spin, Button, Popconfirm } from 'antd'; +import { MinusSquareOutlined, DeleteOutlined, } from '@ant-design/icons'; +import type { PaginationProps } from 'antd'; +import { api_host } from '@/utils/api' +import CreateModal from './createModal' + + +import styles from './index.less' +import { debounce } from 'lodash'; +import type { chunkModelState } from './model' +interface chunkProps { + dispatch: Dispatch; + chunkModel: chunkModelState; + doc_id: string +} +const Index: React.FC = ({ chunkModel, dispatch, doc_id }) => { + const [keywords, SetKeywords] = useState('') + const [available_int, setAvailableInt] = useState(-1) + const navigate = useNavigate() + const [pagination, setPagination] = useState({ page: 1, size: 30 }) + // const [datas, setDatas] = useState(data) + const { data = [], total, loading } = chunkModel + console.log(chunkModel) + const getChunkList = (value?: string) => { + dispatch({ + type: 'chunkModel/updateState', + payload: { + loading: true + } + }); + interface payloadType { + doc_id: string; + keywords?: string; + available_int?: number + } + const payload: payloadType = { + doc_id, + keywords: value || keywords, + available_int + } + if (payload.available_int === -1) { + delete payload.available_int + } + dispatch({ + type: 'chunkModel/chunk_list', + payload: { + ...payload, + ...pagination + } + }); + } + const confirm = (id: string) => { + console.log(id) + dispatch({ + type: 'chunkModel/rm_chunk', + payload: { + chunk_ids: [id] + }, + callback: getChunkList + }); + }; + const handleEditchunk = (chunk_id?: string) => { + dispatch({ + type: 'chunkModel/updateState', + payload: { + isShowCreateModal: true, + chunk_id + }, + callback: getChunkList + }); + } + const onShowSizeChange: PaginationProps['onShowSizeChange'] = (page, size) => { + setPagination({ page, size }) + }; + const switchChunk = (id: string, available_int: boolean) => { + dispatch({ + type: 'chunkModel/updateState', + payload: { + loading: true + } + }); + dispatch({ + type: 'chunkModel/switch_chunk', + payload: { + chunk_ids: [id], + available_int: Number(available_int), + doc_id + }, + callback: getChunkList + }); + } + + useEffect(() => { + getChunkList() + }, [doc_id, available_int, pagination]) + const debounceChange = debounce(getChunkList, 300) + const debounceCallback = useCallback((value: string) => debounceChange(value), []) + const handleInputChange = (e: React.ChangeEvent) => { + const value = e.target.value + SetKeywords(value) + debounceCallback(value) + } + const handleSelectChange = (value: number) => { + setAvailableInt(value) + } + console.log('loading', loading) + return (<> +
+
+
+ + +
@@ -210,7 +220,7 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
- + }; diff --git a/web/src/pages/add-knowledge/components/knowledge-file/model.ts b/web/src/pages/add-knowledge/components/knowledge-file/model.ts index 4f62d0394b88d733013daeda50d243d44123ec86..a1146865f555afb1ede4ca04e1f731c394068b47 100644 --- a/web/src/pages/add-knowledge/components/knowledge-file/model.ts +++ b/web/src/pages/add-knowledge/components/knowledge-file/model.ts @@ -1,15 +1,42 @@ import { message } from 'antd'; -import { addParam } from '@/utils'; +import { Effect, Reducer, Subscription } from 'umi' import kbService from '@/services/kbService'; -const Model = { +export interface kFModelState { + isShowCEFwModal: boolean; + isShowTntModal: boolean; + isShowSegmentSetModal: boolean; + loading: boolean; + tenantIfo: any; + data: any[] +} +export interface kFModelType { + namespace: 'kFModel'; + state: kFModelState; + effects: { + createKf: Effect; + updateKf: Effect; + getKfDetail: Effect; + getKfList: Effect; + updateDocumentStatus: Effect; + document_rm: Effect; + document_create: Effect; + document_change_parser: Effect; + }; + reducers: { + updateState: Reducer; + }; + subscriptions: { setup: Subscription }; +} +const Model: kFModelType = { namespace: 'kFModel', state: { isShowCEFwModal: false, isShowTntModal: false, isShowSegmentSetModal: false, loading: false, - tenantIfo: {} + tenantIfo: {}, + data: [] }, subscriptions: { setup({ dispatch, history }) { diff --git a/web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx b/web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx index 4853b23c89cfb6498a02f410b20da164140a4526..ae3881fbbe66031fef1ffabc37a18c4321f9d6a3 100644 --- a/web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx @@ -1,15 +1,22 @@ -import { connect } from 'umi'; +import React from 'react'; +import { connect, Dispatch } from 'umi'; import i18n from 'i18next'; -import { useTranslation, Trans } from 'react-i18next' -import { Input, Modal, Form, Tag, Space } from 'antd' -import { rsaPsw } from '@/utils' +import { useTranslation, } from 'react-i18next' +import { Modal, Tag, Space } from 'antd' import { useEffect, useState } from 'react'; import styles from './index.less'; +import type { kFModelState } from './model' +import type { settingModelState } from '@/pages/setting/model' const { CheckableTag } = Tag; -type FieldType = { - name?: string; -}; -const Index = ({ kFModel, settingModel, dispatch, getKfList, parser_id, doc_id }) => { +interface kFProps { + dispatch: Dispatch; + kFModel: kFModelState; + settingModel: settingModelState; + getKfList: () => void; + parser_id: string; + doc_id: string; +} +const Index: React.FC = ({ kFModel, settingModel, dispatch, getKfList, parser_id, doc_id }) => { const [selectedTag, setSelectedTag] = useState('') const { tenantIfo = {} } = settingModel const { parser_ids = '' } = tenantIfo diff --git a/web/src/pages/add-knowledge/components/knowledge-file/upload.tsx b/web/src/pages/add-knowledge/components/knowledge-file/upload.tsx index 1c2f7c9617a89933aa4d65d67cca45505f173ffa..60ae46e2b6d30abb94a2ea43c1950d371bc7077f 100644 --- a/web/src/pages/add-knowledge/components/knowledge-file/upload.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-file/upload.tsx @@ -1,20 +1,23 @@ import React from 'react'; import { connect } from 'umi' -import { UploadOutlined } from '@ant-design/icons'; import type { UploadProps } from 'antd'; -import { Button, message, Upload } from 'antd'; +import { Button, Upload } from 'antd'; import uploadService from '@/services/uploadService' - - -const Index = ({ kb_id, getKfList }) => { - console.log(kb_id) - const createRequest = async function ({ file, onSuccess, onError }) { +interface PropsType { + kb_id: string; + getKfList: () => void +} +type UploadRequestOption = Parameters< + NonNullable +>[0]; +const Index: React.FC = ({ kb_id, getKfList }) => { + const createRequest: (props: UploadRequestOption) => void = async function ({ file, onSuccess, onError }) { const { retcode, data } = await uploadService.uploadFile(file, kb_id); if (retcode === 0) { - onSuccess(data, file); + onSuccess && onSuccess(data, file); } else { - onError(data); + onError && onError(data); } getKfList && getKfList() }; diff --git a/web/src/pages/add-knowledge/components/knowledge-setting/index.tsx b/web/src/pages/add-knowledge/components/knowledge-setting/index.tsx index 50026330da6346985a11741f47146d3c85ee4b58..67286f441f413c83d187f85cdd19de5af3b3fcef 100644 --- a/web/src/pages/add-knowledge/components/knowledge-setting/index.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-setting/index.tsx @@ -1,6 +1,8 @@ import React, { useEffect, useState } from 'react'; -import { useNavigate, connect } from 'umi' -import { Button, Form, Input, InputNumber, Radio, Select, Tag, Space, Avatar, Divider, List, Skeleton } from 'antd'; +import { useNavigate, connect, Dispatch } from 'umi' +import { Button, Form, Input, Radio, Select, Tag, Space, } from 'antd'; +import type { kSModelState } from './model' +import type { settingModelState } from '@/pages/setting/model' import styles from './index.less' const { CheckableTag } = Tag; const layout = { @@ -10,41 +12,17 @@ const layout = { }; const { Option } = Select /* eslint-disable no-template-curly-in-string */ -const validateMessages = { - required: '${label} is required!', - types: { - email: '${label} is not a valid email!', - number: '${label} is not a valid number!', - }, - number: { - range: '${label} must be between ${min} and ${max}', - }, -}; -/* eslint-enable no-template-curly-in-string */ - -interface DataType { - gender: string; - name: { - title: string; - first: string; - last: string; - }; - email: string; - picture: { - large: string; - medium: string; - thumbnail: string; - }; - nat: string; +interface kSProps { + dispatch: Dispatch; + kSModel: kSModelState; + settingModel: settingModelState; + kb_id: string } -const tags = [{ title: '研报' }, { title: '法律' }, { title: '简历' }, { title: '说明书' }, { title: '书籍' }, { title: '演讲稿' }] - -const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => { +const Index: React.FC = ({ settingModel, kSModel, dispatch, kb_id }) => { let navigate = useNavigate(); const { tenantIfo = {} } = settingModel const { parser_ids = '', embd_id = '' } = tenantIfo - const { id = '' } = props const [form] = Form.useForm(); useEffect(() => { @@ -53,12 +31,12 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => { payload: { } }); - if (id) { + if (kb_id) { dispatch({ type: 'kSModel/getKbDetail', payload: { - kb_id: id + kb_id }, callback(detail: any) { console.log(detail) @@ -69,20 +47,20 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => { }); } - }, [id]) + }, [kb_id]) const [selectedTag, setSelectedTag] = useState('') const values = Form.useWatch([], form); console.log(values, '......变化') const onFinish = () => { form.validateFields().then( () => { - if (id) { + if (kb_id) { dispatch({ type: 'kSModel/updateKb', payload: { ...values, parser_id: selectedTag, - kb_id: id, + kb_id, embd_id: undefined } }); @@ -94,7 +72,7 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => { parser_id: selectedTag }, callback(id: string) { - navigate(`/knowledge/add/setting?activeKey=file&id=${id}`); + navigate(`/knowledge/add/setting?activeKey=file&id=${kb_id}`); } }); } @@ -140,7 +118,7 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => { hasFeedback rules={[{ required: true, message: 'Please select your country!' }]} > - {embd_id.split(',').map((item: string) => { return })} diff --git a/web/src/pages/add-knowledge/components/knowledge-setting/model.ts b/web/src/pages/add-knowledge/components/knowledge-setting/model.ts index 197ad044ad6f0f2ee5458390632bc8e88f5b7158..42e33a5b3e2c047e392f6765e6a224b2e3ffaa61 100644 --- a/web/src/pages/add-knowledge/components/knowledge-setting/model.ts +++ b/web/src/pages/add-knowledge/components/knowledge-setting/model.ts @@ -1,8 +1,27 @@ import { message } from 'antd'; -import { addParam } from '@/utils'; +import { Effect, Reducer, Subscription } from 'umi' import kbService from '@/services/kbService'; -const Model = { +export interface kSModelState { + isShowPSwModal: boolean; + isShowTntModal: boolean; + loading: boolean; + tenantIfo: any +} +export interface kSModelType { + namespace: 'kSModel'; + state: kSModelState; + effects: { + createKb: Effect; + updateKb: Effect; + getKbDetail: Effect; + }; + reducers: { + updateState: Reducer; + }; + subscriptions: { setup: Subscription }; +} +const Model: kSModelType = { namespace: 'kSModel', state: { isShowPSwModal: false, diff --git a/web/src/pages/add-knowledge/index.tsx b/web/src/pages/add-knowledge/index.tsx index 3becb3f7b330bb616d2aa08a481154472e91fc82..7cdcb18d7de4c6be10590f83ba4f72602a0be5dd 100644 --- a/web/src/pages/add-knowledge/index.tsx +++ b/web/src/pages/add-knowledge/index.tsx @@ -1,7 +1,7 @@ -import { connect, useNavigate, useLocation } from 'umi' -import React, { useMemo, useState, useEffect } from 'react'; +import { connect, useNavigate, useLocation, Dispatch } from 'umi' +import React, { useState, useEffect } from 'react'; import type { MenuProps } from 'antd'; -import { Radio, Space, Tabs, Menu } from 'antd'; +import { Menu } from 'antd'; import { ToolOutlined, BarsOutlined, @@ -10,17 +10,24 @@ import { import File from './components/knowledge-file' import Setting from './components/knowledge-setting' import Search from './components/knowledge-search' +import Chunk from './components/knowledge-chunk' import styles from './index.less' import { getWidth } from '@/utils' +import { kAModelState } from './model' -const Index: React.FC = ({ kAModel, dispatch }) => { +interface kAProps { + dispatch: Dispatch; + kAModel: kAModelState; +} +const Index: React.FC = ({ kAModel, dispatch }) => { const [collapsed, setCollapsed] = useState(false); - const { id, activeKey } = kAModel + const { id, activeKey, doc_id } = kAModel const [windowWidth, setWindowWidth] = useState(getWidth()); let navigate = useNavigate(); const location = useLocation(); // 标记一下 + console.log(doc_id, '>>>>>>>>>>>>>doc_id') useEffect(() => { const widthSize = () => { const width = getWidth() @@ -44,7 +51,9 @@ const Index: React.FC = ({ kAModel, dispatch }) => { dispatch({ type: 'kAModel/updateState', payload: { - ...map + doc_id: undefined, + ...map, + } }); }, [location]) @@ -94,9 +103,11 @@ const Index: React.FC = ({ kAModel, dispatch }) => { />
- {activeKey === 'file' && } - {activeKey === 'setting' && } - {activeKey === 'search' && } + {activeKey === 'file' && !doc_id && } + {activeKey === 'setting' && } + {activeKey === 'search' && } + {activeKey === 'file' && !!doc_id && } +
diff --git a/web/src/pages/add-knowledge/model.ts b/web/src/pages/add-knowledge/model.ts index 1372b2126ef6db2e87f010908854bed864749950..6f1871bcf0e55ef2c5ce65022c3cab6ea4145014 100644 --- a/web/src/pages/add-knowledge/model.ts +++ b/web/src/pages/add-knowledge/model.ts @@ -1,8 +1,27 @@ +import { Effect, Reducer, Subscription } from 'umi' import { message } from 'antd'; -import { addParam } from '@/utils'; import kbService from '@/services/kbService'; +export interface kAModelState { + isShowPSwModal: boolean; + isShowTntModal: boolean; + loading: boolean; + tenantIfo: any; + activeKey: string; + id: string; + doc_id: string +} +export interface kAModelType { + namespace: 'kAModel'; + state: kAModelState; + effects: { -const Model = { + }; + reducers: { + updateState: Reducer; + }; + subscriptions: { setup: Subscription }; +} +const Model: kAModelType = { namespace: 'kAModel', state: { isShowPSwModal: false, @@ -10,7 +29,8 @@ const Model = { loading: false, tenantIfo: {}, activeKey: 'setting', - id: '' + id: '', + doc_id: '' }, subscriptions: { diff --git a/web/src/pages/chat/index.tsx b/web/src/pages/chat/index.tsx index 3e1b4d0ac5f82a0be7ac39fb5040315876b214d2..64445f6b493cfa0625f402149adf7b04dac1b3c6 100644 --- a/web/src/pages/chat/index.tsx +++ b/web/src/pages/chat/index.tsx @@ -1,19 +1,15 @@ -import React, { FC } from 'react'; -import { IndexModelState, ConnectProps, Loading, connect } from 'umi'; +import React from 'react'; +import { connect, Dispatch } from 'umi'; +import type { chatModelState } from './model' -interface PageProps extends ConnectProps { - index: IndexModelState; - loading: boolean; +interface chatProps { + chatModel: chatModelState; + dispatch: Dispatch } -const IndexPage: FC = ({ index, dispatch }) => { - const { name } = index; - return
chat: {name}
; +const View: React.FC = ({ chatModel, dispatch }) => { + const { name } = chatModel; + return
chat:{name}
; }; -export default connect( - ({ index, loading }: { index: IndexModelState; loading: Loading }) => ({ - index, - loading: loading.models.index, - }), -)(IndexPage); \ No newline at end of file +export default connect(({ chatModel, loading }) => ({ chatModel, loading }))(View); \ No newline at end of file diff --git a/web/src/pages/chat/model.ts b/web/src/pages/chat/model.ts index 94d6b4e47e2af3e4e93bc2200bb09c00302d81d4..103c978c9e0cd89d2a0ae5916c27e0986c686a48 100644 --- a/web/src/pages/chat/model.ts +++ b/web/src/pages/chat/model.ts @@ -1,25 +1,23 @@ -import { Effect, ImmerReducer, Reducer, Subscription } from 'umi'; +import { Effect, Reducer, Subscription } from 'umi'; -export interface IndexModelState { +export interface chatModelState { name: string; } -export interface IndexModelType { - namespace: 'index'; - state: IndexModelState; +export interface chatModelType { + namespace: 'chatModel'; + state: chatModelState; effects: { query: Effect; }; reducers: { - save: Reducer; - // 启用 immer 之后 - // save: ImmerReducer; + save: Reducer; }; subscriptions: { setup: Subscription }; } -const IndexModel: IndexModelType = { - namespace: 'index', +const Model: chatModelType = { + namespace: 'chatModel', state: { name: 'kate', }, @@ -34,10 +32,6 @@ const IndexModel: IndexModelType = { ...action.payload, }; }, - // 启用 immer 之后 - // save(state, action) { - // state.name = action.payload; - // }, }, subscriptions: { setup({ dispatch, history }) { @@ -49,4 +43,4 @@ const IndexModel: IndexModelType = { }, }; -export default IndexModel; \ No newline at end of file +export default Model; \ No newline at end of file diff --git a/web/src/pages/file/index.tsx b/web/src/pages/file/index.tsx index c690f18ad79769484e4d8ec27a4f050de34cfb4d..a9310e3d9a84afe8e80349e69f26d1ac55ac3951 100644 --- a/web/src/pages/file/index.tsx +++ b/web/src/pages/file/index.tsx @@ -20,7 +20,7 @@ const App: React.FC = () => { } useEffect(() => { const timer = setInterval(() => { - setFileList((fileList) => { + setFileList((fileList: any) => { const percent = fileList[0]?.percent if (percent + 10 >= 100) { clearInterval(timer) diff --git a/web/src/pages/knowledge/index.tsx b/web/src/pages/knowledge/index.tsx index 48025bcd8e06715c28db6ea6d4c89adf849a86ca..dfb3c280933fd7f272f47ff9505d36ddab6b3b89 100644 --- a/web/src/pages/knowledge/index.tsx +++ b/web/src/pages/knowledge/index.tsx @@ -1,20 +1,20 @@ import React, { useEffect, useState, } from 'react'; -import { useNavigate, connect } from 'umi' +import { useNavigate, connect, Dispatch } from 'umi' import { Card, List, Popconfirm, message, FloatButton, Row, Col } from 'antd'; import { MinusSquareOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import styles from './index.less' import { formatDate } from '@/utils/date' - -const dd = [{ - title: 'Title 4', - text: '4', - des: '111' -}] -const Index: React.FC = ({ knowledgeModel, dispatch }) => { +import type { knowledgeModelState } from './model' +interface KnowledgeProps { + dispatch: Dispatch; + knowledgeModel: knowledgeModelState +} +const Index: React.FC = ({ knowledgeModel, dispatch }) => { const navigate = useNavigate() // const [datas, setDatas] = useState(data) - const { data } = knowledgeModel - const confirm = (id) => { + const { data = [] } = knowledgeModel + console.log(knowledgeModel) + const confirm = (id: string) => { dispatch({ type: 'knowledgeModel/rmKb', payload: { @@ -49,8 +49,8 @@ const Index: React.FC = ({ knowledgeModel, dispatch }) => { } type="primary" style={{ right: 24, top: 100 }} /> { - data.map((item, index) => { - return (
+ data.map((item: any) => { + return ( { handleEditKnowledge(item.id) }} > @@ -63,7 +63,7 @@ const Index: React.FC = ({ knowledgeModel, dispatch }) => { { + onConfirm={(e: any) => { e.stopPropagation(); e.nativeEvent.stopImmediatePropagation() confirm(item.id) diff --git a/web/src/pages/knowledge/model.ts b/web/src/pages/knowledge/model.ts index 0e5090f795d4e2fb7693145110eb722cb8783339..d90a8e72bfa3fd6c002ca1fb90ed9021fa38bd53 100644 --- a/web/src/pages/knowledge/model.ts +++ b/web/src/pages/knowledge/model.ts @@ -1,8 +1,24 @@ +import { Effect, Reducer, Subscription } from 'umi' import { message } from 'antd'; -import { addParam } from '@/utils'; import kbService from '@/services/kbService'; -const Model = { +export interface knowledgeModelState { + loading: boolean; + data: any[] +} +export interface knowledgegModelType { + namespace: 'knowledgeModel'; + state: knowledgeModelState; + effects: { + rmKb: Effect; + getList: Effect; + }; + reducers: { + updateState: Reducer; + }; + subscriptions: { setup: Subscription }; +} +const Model: knowledgegModelType = { namespace: 'knowledgeModel', state: { loading: false, diff --git a/web/src/pages/login/index.tsx b/web/src/pages/login/index.tsx index d992feda319c7e61aa9c9a731dc16b3580b9bb3c..e15fa19b9c6c5141c9caa8b7c092bd291bd6da26 100644 --- a/web/src/pages/login/index.tsx +++ b/web/src/pages/login/index.tsx @@ -3,6 +3,7 @@ import { Input, Form, Button, Checkbox } from 'antd'; import styles from './index.less'; import { rsaPsw } from '@/utils' import { useState, useEffect, FC } from 'react'; + interface LoginProps { dispatch: Dispatch; } diff --git a/web/src/pages/login/model.ts b/web/src/pages/login/model.ts index b886ab3aca619af77e11d6b8baccb9a5e4911382..d95187e9f1f9fbe8ee1575634431cf8a08e79c21 100644 --- a/web/src/pages/login/model.ts +++ b/web/src/pages/login/model.ts @@ -1,15 +1,30 @@ +import { Effect, Reducer, Subscription } from 'umi' import { message } from 'antd'; -import { addParam } from '@/utils'; import userService from '@/services/userService'; -const Model = { +export interface loginModelState { + list: any[]; + info: any; + visible: boolean; +} +export interface logingModelType { + namespace: 'loginModel'; + state: loginModelState; + effects: { + login: Effect; + register: Effect; + }; + reducers: { + updateState: Reducer; + }; + subscriptions: { setup: Subscription }; +} +const Model: logingModelType = { namespace: 'loginModel', state: { list: [], info: {}, visible: false, - pagination: {}, - campaignInfo: {} }, subscriptions: { setup({ dispatch, history }) { diff --git a/web/src/pages/setting/List.tsx b/web/src/pages/setting/List.tsx index f54b75292599dc385f5258d44dc050faf14ca348..86e0a3bf66605199a0fc01a8af0c49a98bf26439 100644 --- a/web/src/pages/setting/List.tsx +++ b/web/src/pages/setting/List.tsx @@ -9,7 +9,6 @@ import { useEffect, useState, FC } from 'react'; import { RadarChartOutlined } from '@ant-design/icons'; import { ProCard } from '@ant-design/pro-components'; import { Button, Tag, Row, Col, Card } from 'antd'; -import { divide } from 'lodash'; interface DataType { diff --git a/web/src/pages/setting/SAKModal.tsx b/web/src/pages/setting/SAKModal.tsx index ffdd72b15f2c3bdc3b81b9892152d9ce34a2c27c..94da17bb457cd72c8ff79c4930a3910efe623d19 100644 --- a/web/src/pages/setting/SAKModal.tsx +++ b/web/src/pages/setting/SAKModal.tsx @@ -3,7 +3,6 @@ import i18n from 'i18next'; import { FC } from 'react' import { useTranslation, Trans } from 'react-i18next' import { Input, Modal, Form } from 'antd' -import { rsaPsw } from '@/utils' import styles from './index.less'; type FieldType = { diff --git a/web/src/pages/setting/SSModal.tsx b/web/src/pages/setting/SSModal.tsx index 19e5617c83d8ee6bedd52bc334ac366a99823dd4..c6b2f34cdd0f03cd8fa6d086f110ad01b98b3ef1 100644 --- a/web/src/pages/setting/SSModal.tsx +++ b/web/src/pages/setting/SSModal.tsx @@ -3,7 +3,6 @@ import { FC } from 'react' import i18n from 'i18next'; import { useTranslation, Trans } from 'react-i18next' import { Input, Modal, Form, Select } from 'antd' -import { rsaPsw } from '@/utils' import styles from './index.less'; type FieldType = { diff --git a/web/src/pages/setting/index.tsx b/web/src/pages/setting/index.tsx index d21e14a000f82f05ae76e70736990e2954343a8f..fdf15429b335da2f7e29cd33baf336a4a5c12ee2 100644 --- a/web/src/pages/setting/index.tsx +++ b/web/src/pages/setting/index.tsx @@ -1,7 +1,7 @@ import { connect, Dispatch } from 'umi'; import i18n from 'i18next'; import { useTranslation, Trans } from 'react-i18next' -import { Button, Input, Modal, Form, FloatButton, Table } from 'antd' +import { Button, FloatButton } from 'antd' import styles from './index.less'; diff --git a/web/src/pages/setting/model.ts b/web/src/pages/setting/model.ts index 49e781ddba973a74639da7416367e23d6a496a0f..4800ff1a67b6e6774c1e0654e6b1aa1296de5a23 100644 --- a/web/src/pages/setting/model.ts +++ b/web/src/pages/setting/model.ts @@ -1,8 +1,6 @@ import { Effect, Reducer, Subscription } from 'umi'; import { message } from 'antd'; -import { addParam } from '@/utils'; import userService from '@/services/userService'; -import { rearg } from 'lodash'; export interface settingModelState { isShowPSwModal: boolean; diff --git a/web/src/services/kbService.ts b/web/src/services/kbService.ts index 9e03475aaa234b059b79b4ec3bf3e5c5725dc128..688fce21245b3aaca5a7d3d56a275547d17ef0f5 100644 --- a/web/src/services/kbService.ts +++ b/web/src/services/kbService.ts @@ -7,7 +7,16 @@ const { update_kb, rm_kb, get_kb_detail, - kb_list, get_document_list, document_change_status, document_rm, document_create, document_change_parser } = api; + kb_list, + get_document_list, + document_change_status, + document_rm, + document_create, + document_change_parser, + chunk_list, + create_chunk, + set_chunk, + get_chunk, switch_chunk, rm_chunk } = api; interface kbService { createKb: () => void; updateKb: () => void; @@ -19,9 +28,16 @@ interface kbService { document_rm: () => void; document_create: () => void; document_change_parser: () => void; + chunk_list: () => void; + create_chunk: () => void; + set_chunk: () => void; + get_chunk: () => void; + switch_chunk: () => void; + rm_chunk: () => void; } const kbService: kbService = registerServer( { + // 知识库管理 createKb: { url: create_kb, method: 'post' @@ -42,6 +58,7 @@ const kbService: kbService = registerServer( url: kb_list, method: 'get' }, + // 文件管理 get_document_list: { url: get_document_list, method: 'get' @@ -62,6 +79,31 @@ const kbService: kbService = registerServer( url: document_change_parser, method: 'post' }, + // chunk管理 + chunk_list: { + url: chunk_list, + method: 'post' + }, + create_chunk: { + url: create_chunk, + method: 'post' + }, + set_chunk: { + url: set_chunk, + method: 'post' + }, + get_chunk: { + url: get_chunk, + method: 'get' + }, + switch_chunk: { + url: switch_chunk, + method: 'post' + }, + rm_chunk: { + url: rm_chunk, + method: 'post' + }, }, request diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts index 19599ad5d128aec6f693e0c0ea8656417683b97e..a88c857e43c6e8d575a9ba475768b399ead37d02 100644 --- a/web/src/utils/api.ts +++ b/web/src/utils/api.ts @@ -1,7 +1,7 @@ -let api_host = `/v1`; +let api_host = `http://54.80.112.79:9380/v1`; export { api_host }; @@ -24,6 +24,7 @@ export default { set_api_key: `${api_host}/llm/set_api_key`, + //知识库管理 kb_list: `${api_host}/kb/list`, create_kb: `${api_host}/kb/create`, @@ -31,6 +32,16 @@ export default { rm_kb: `${api_host}/kb/rm`, get_kb_detail: `${api_host}/kb/detail`, + // chunk管理 + chunk_list: `${api_host}/chunk/list`, + create_chunk: `${api_host}/chunk/create`, + set_chunk: `${api_host}/chunk/set`, + get_chunk: `${api_host}/chunk/get`, + switch_chunk: `${api_host}/chunk/switch`, + rm_chunk: `${api_host}/chunk/rm`, + + + // 上传 upload: `${api_host}/document/upload`, get_document_list: `${api_host}/document/list`, diff --git a/web/src/utils/request.ts b/web/src/utils/request.ts index 74227ffd907d8f1c02db526c950ddea25b93d1b0..781ea67f6eca5bd7629874c7eb73f2e995f6c96c 100644 --- a/web/src/utils/request.ts +++ b/web/src/utils/request.ts @@ -1,7 +1,6 @@ import { extend } from 'umi-request'; import { notification, message } from 'antd'; -import _ from 'lodash'; import api from '@/utils/api'; const { login } = api; @@ -27,18 +26,39 @@ const retcodeMessage = { 503: '服务不可用,服务器暂时过载或维护。', 504: '网关超时。' }; - +type retcode = + | 200 + | 201 + | 202 + | 204 + | 400 + | 401 + | 403 + | 404 + | 406 + | 410 + | 422 + | 500 + | 502 + | 503 + | 504; /** * 异常处理程序 */ -const errorHandler = (error: any) => { +interface responseType { + retcode: number; + data: any; + retmsg: string; + status: number +} +const errorHandler = (error: { response: Response, message: string }): Response => { const { response } = error; // 手动中断请求 abort if (error.message === ABORT_REQUEST_ERR_MESSAGE) { console.log('user abort request'); } else { if (response && response.status) { - const errorText = retcodeMessage[response.status] || response.statusText; + const errorText = retcodeMessage[response.status as retcode] || response.statusText; const { status, url } = response; notification.error({ message: `请求错误 ${status}: ${url}`, @@ -59,14 +79,11 @@ const errorHandler = (error: any) => { */ const request = extend({ errorHandler, // 默认错误处理 - // credentials: 'include', // 默认请求是否带上cookie timeout: 3000000, getResponse: true }); -request.interceptors.request.use((url, options) => { - let prefix = ''; - console.log(url) +request.interceptors.request.use((url: string, options: any) => { const Authorization = localStorage.getItem('Authorization') return { url, @@ -84,9 +101,10 @@ request.interceptors.request.use((url, options) => { /* * 请求response拦截器 * */ -request.interceptors.response.use(async (response, request) => { + +request.interceptors.response.use(async (response: any, request) => { console.log(response, request) - const data = await response.clone().json(); + const data: responseType = await response.clone().json(); // response 拦截 if (data.retcode === 401 || data.retcode === 401) {