Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions ui/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ Store 内部协调状态时可直接引用同入口的具体 Store,避免聚
- 共享规则与功能本地实现分别按专题文档维护,不为单页需求提前提升公共代码。
- 不手工修改 `src/components.d.ts` 等生成文件,通过正常开发或构建流程生成。

## Import 顺序

所有 Vue / TypeScript 文件按以下顺序排列导入,组间不加空行:

1. 框架与第三方依赖;`vue`、`vue-router`、`pinia` 固定优先,其他按路径排序。
2. 所有来源的 `import type` 集中排列,然后是 `@/api/enums` 枚举,最后是 API。
3. 组件与功能依赖:先 `@/` 共享组件和功能模块,再相对路径依赖。
4. 公共模块:常量、Store、工具、路由、国际化等。
5. `@/permission` 或其 `index.ts` 入口固定最后。

组内路径和命名导入成员按字母序排列;混合导入中的显式 `type` 成员拆为 `import type`。
不改写路径或导入别名。无绑定导入(如样式和初始化模块)、执行语句及注释作为排序边界,
保留其顺序与关联;带内部注释的导入声明保留成员写法。
仅含 inline type 成员的值导入保留原写法,避免改为 `import type` 后丢失模块初始化副作用。
规则由 `eslint-rules/import-order.mjs` 实现,通过 `npx eslint <文件或目录> --fix` 自动整理。
生成的声明文件不参与手工整理。

## 验证

只改文档:核对代码、路径引用、Prettier 格式及 `git diff --check`。
Expand Down
2 changes: 2 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ OSS 文件接口。前端业务接口需要可用的后端服务。

`npm run lint` 当前仅配置了 `run-s "lint:*"`,但尚未定义任何 `lint:*` 子脚本,不能作为已执行
ESLint 检查的依据。需要检查代码时,可运行 `npx eslint <待检查的文件或目录>`。
导入顺序由项目 ESLint 规则检查,使用 `npx eslint <文件或目录> --fix` 自动整理;
分组与顺序见 [AGENTS.md](AGENTS.md#import-顺序)。

路由菜单、知识库角色权限与问题分段关联回归测试使用 Node 内置测试运行器:`node --test tests/*.test.mjs`。

Expand Down
4 changes: 4 additions & 0 deletions ui/eslint-rules/import-order.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { Rule } from 'eslint'

declare const importOrder: Rule.RuleModule
export default importOrder
115 changes: 115 additions & 0 deletions ui/eslint-rules/import-order.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// 项目导入分组;无绑定导入、注释和可执行语句作为排序边界。
import path from 'node:path'

const compare = (left, right) => (left < right ? -1 : left > right ? 1 : 0)
const frameworks = ['vue', 'vue-router', 'pinia']

function groupOf(source, isType, filename) {
if (isType) return 1
const resolved = source.startsWith('.') ? path.resolve(path.dirname(filename), source).replaceAll('\\', '/') : source
if (/(?:@\/|\/src\/)api\/enums(?:\/|\.|$)/.test(resolved)) return 2
if (/(?:@\/|\/src\/)api\//.test(resolved)) return 3
if (!source.startsWith('.') && !source.startsWith('@/')) return 0
if (/^@\/permission(?:\/index(?:\.ts)?)?$/.test(source)) return 6
if (source.startsWith('.') || /^@\/(?:components|layout|views|workflow-canvas|conversation-panel|assets)\//.test(source)) return 4
return 5
}

function renderImport(node, specifiers, isType, code) {
const prefix = isType ? 'import type ' : 'import '
const defaults = specifiers.filter((specifier) => specifier.type !== 'ImportSpecifier')
const named = specifiers
.filter((specifier) => specifier.type === 'ImportSpecifier')
.sort((left, right) => compare(left.imported.name ?? left.imported.value, right.imported.name ?? right.imported.value))
const bindings = defaults.map((specifier) => code.getText(specifier))
if (named.length) {
const names = named.map((specifier) =>
specifier.importKind === 'type' ? code.getText(specifier).replace(/^type\s+/, '') : code.getText(specifier),
)
const singleLine = `{ ${names.join(', ')} }`
const length = prefix.length + [...bindings, singleLine].join(', ').length + code.getText(node.source).length + 6
// 与 .prettierrc.json 的 printWidth 保持一致。
bindings.push(length > 150 ? `{\n${names.map((name) => ` ${name},`).join('\n')}\n}` : singleLine)
}
return `${prefix}${bindings.join(', ')} from ${code.getText(node.source)}${code.text.slice(node.source.range[1], node.range[1])}`
}

export default {
meta: {
type: 'layout',
fixable: 'code',
schema: [],
messages: { order: '按框架、类型、枚举、API、组件与功能、公共模块、perm 的顺序整理导入。' },
},
create(context) {
const code = context.sourceCode
function check(nodes) {
if (!nodes.length) return
const entries = nodes.flatMap((node) => {
// 带内部注释的声明原样保留,避免改变注释的作用对象。
if (code.getCommentsInside(node).length) {
return [
{ source: node.source.value, group: groupOf(node.source.value, node.importKind === 'type', context.filename), text: code.getText(node) },
]
}
const types = node.specifiers.filter((specifier) => node.importKind === 'type' || specifier.importKind === 'type')
const values = node.specifiers.filter((specifier) => !types.includes(specifier))
return [
[types, true],
[values, false],
]
.filter(([specifiers]) => specifiers.length)
.map(([specifiers, isType]) => ({
source: node.source.value,
group: groupOf(node.source.value, isType, context.filename),
text: renderImport(node, specifiers, isType, code),
}))
})
entries.sort((left, right) => {
if (left.group !== right.group) return left.group - right.group
if (left.group === 0) {
const rank = (source) => (frameworks.includes(source) ? frameworks.indexOf(source) : frameworks.length)
if (rank(left.source) !== rank(right.source)) return rank(left.source) - rank(right.source)
}
if (left.group === 4 && left.source.startsWith('@/') !== right.source.startsWith('@/')) return left.source.startsWith('@/') ? -1 : 1
return compare(left.source, right.source)
})
const replacement = entries.map((entry) => entry.text).join('\n')
const range = [nodes[0].range[0], nodes.at(-1).range[1]]
if (code.text.slice(...range) !== replacement) {
context.report({ node: nodes[0], messageId: 'order', fix: (fixer) => fixer.replaceTextRange(range, replacement) })
}
}
return {
Program(program) {
let block = []
for (const node of program.body) {
// 仅含 inline type 的值导入在 verbatimModuleSyntax 下仍会执行模块。
// 保留声明及位置,避免拆分后丢失初始化副作用。
const inlineTypesOnly =
node.type === 'ImportDeclaration' &&
node.importKind !== 'type' &&
node.specifiers.length > 0 &&
node.specifiers.every((specifier) => specifier.importKind === 'type')
const previous = block.at(-1)
const gap = previous ? code.text.slice(previous.range[1], node.range[0]) : ''
const leadingComment =
node.type === 'ImportDeclaration' && code.getCommentsBefore(node).some((comment) => comment.loc.end.line >= node.loc.start.line - 1)
// 不跨越声明、初始化、样式导入或注释调整模块执行次序。
if (node.type !== 'ImportDeclaration' || !node.specifiers.length || inlineTypesOnly || leadingComment || gap.trim()) {
check(block)
block = []
}
if (node.type === 'ImportDeclaration' && node.specifiers.length && !inlineTypesOnly && !leadingComment) {
const trailingComment = code.getCommentsAfter(node).some((comment) => comment.loc.start.line === node.loc.end.line)
if (trailingComment) {
check(block)
block = []
} else block.push(node)
}
}
check(block)
},
}
},
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the ESLint rule (import grouping/sorting)

Bugs / Correctness issues

  1. specifiers.filter((s) => !types.includes(s)) is O(n²) — Array.prototype.includes on types is linear. For imports this is negligible, but new Set(types) or a simple specifier.importKind !== 'type' predicate is cleaner. More importantly, in an inline mixed import (e.g. import { A, type B } from 'x'), splitting into two import lines changes semantics only mildly — but the split path runs when node.importKind !== 'type', and the resulting value statement keeps all non-type specifiers. That's fine, but the emitted renderImport(node, values, false, …) reuses code.getText(node.source) and slices trailing text from node.source.range[1] to node.range[1]. If the original had a semicolon after the source (no assertions), that works; if it had import attributes / assertions (assert { type: 'json' }) they are preserved by the slice — good. However the same slice is applied to both the type sub-import and the value sub-import, so an attribute clause would end up duplicated onto the type import (which is illegal). Worth guarding.

  2. inlineTypesOnly detection vs. types filter inconsistency. In check, you decide "all specifiers are type" per-node with node.importKind === 'type' || specifier.importKind === 'type'. In Program, inlineTypesOnly uses node.type === 'ImportDeclaration' while elsewhere you consistently test node.type === 'ImportDeclaration'. Then later again if (node.type === 'ImportDeclaration' && …). Minor redundancy, not a bug. But the comment says such imports are kept in place to preserve side effects — yet groupOf for a pure import type node returns group 1 regardless of whether the source is external/relative. So a import type from ./local will be sorted among other type imports before runtime imports. That matches most conventions; just confirm intent.

  3. length > 150 magic number. The comment says it mirrors .prettierrc.json printWidth, but 150 is hard-coded. If prettier config changes, this silently diverges. Better to read it once (or at least define a named constant const PRINT_WIDTH = 150).

  4. Length calculation is approximate. prefix.length + [...bindings, singleLine].join(', ').length + code.getText(node.source).length + 6 — the + 6 accounts for ' from ' and ';'? ' from ' is 6 chars, yes, plus possibly a trailing ; on another line. This approximation ignores the trailing slice (attributes, comments). For typical cases it's fine; for correctness, compute against the fully rendered string instead:

    const candidate = `${prefix}${[...bindings, singleLine].join(', ')} from ${code.getText(node.source)}${tail}`

    and check candidate.length > PRINT_WIDTH.

  5. compare(left.imported.name ?? left.imported.value, …) doesn't handle ImportNamespaceSpecifier/ImportDefaultSpecifier in named — those never appear there because of the filter, so it's fine, but left.imported may be undefined for import { type Foo } where the middle AST differs across parsers (ImportSpecifier.imported is always present, so OK). Still, ?? '' fallback would be safer.

  6. source regexes assume @/ and /src/ without an anchor. For instance some-lib/src/api/foo (a published package with a src folder reused verbatim) would land in group 3. Rare but possible. Consider anchoring one segment less aggressively or documenting.

  7. path.resolve(...).replaceAll('\\', '/') — path.resolve requires filename to be absolute; context.filename is, so fine. But resolving aliases like @/api/enums cannot go through path.resolve (it produces nonsense paths). The subsequent regex still matches the literal @/api/enums, so behavior is unaffected — but the resolved value is misleading. Split alias handling from relative handling for clarity.

  8. leadingComment check uses comment.loc.end.line >= node.loc.start.line - 1. That treats a comment on the previous line as attached even if separated by a blank line (blank line should de-attach). Also, comments have already been used to reset the block via gap.trim() — if there's a comment in the gap, gap.trim() is non-empty, so leadingComment is effectively redundant there except for the case where the comment sits between the import and the previous statement with no other text. Simplify: rely on gap.trim().

  9. trailingComment for the block boundary. On a trailing same-line comment you check(block) and block = [], then push nothing — meaning the current node starts a fresh block but is never pushed. Next iteration, previous is undefined, so gap is '', treating the next import as adjacent. This can produce wrong grouping across the commented import. Should be:

    if (trailingComment) { check(block); block = []; continue-ish }
    else block.push(node)

    As written, after a trailing-comment import, the following import becomes the start of a new block spanning from that import onwards — which loses the commented import entirely from ordering. Whether intended (freeze position) or not, document it.

  10. range = [nodes[0].range[0], nodes.at(-1).range[1]] — this replaces the whole span including inter-import blank lines. Since entries.map(text).join('\n') emits no blank lines, deliberate blank-line groupings between imports are destroyed. Most format-preserving rules re-emit with one blank line between groups. Confirm this is desired; otherwise you're fighting Prettier/dev expectations.

  11. node.specifiers.length guard — bare import 'x.css' resets the block. Good, but a side-effect import between otherwise-sortable imports means the sort is never re-established after it. Consider starting a fresh block after it (push nothing, then continue — but previous must be undefined so the gap check restarts). Currently that's exactly what happens because block=[]; fine.

  12. Type-only default imports: import type Foo from 'x' — defaults includes Foo, but the specifier's importKind is 'value' on the specifier itself (parser moves it to node level). Fine. But import { type A } where entire list is type triggers inlineTypesOnly, skipping sort — intentional but silently skips these; add a comment.

  13. Missing importKind === 'typeof' handling (TS pre-verbatim syntax). Low risk under modern TS.

  14. Repeated calls to code.getText(specifier) / code.getText(node.source) within loops — cheap but renderImport recomputes code.getText(node.source) twice. Store once.

  15. type in meta is 'layout'. Valid, but import ordering is usually 'suggestion'; both work. For meta.messages, adding an English message alongside is optional — enterprise lint configs often require i18n consistency; the Chinese message is consistent here.

  16. No docs field in meta. Add at least { description } for tooling/introspection.

  17. Schema empty array — fine, but if printWidth were made configurable, schema would need updating.

  18. The fix only reports on nodes[0]. If a fix fails repeatedly ESLint disables autofix for the file. Fine, but multiple report entries per problematic block would give clearer errors. Optional.

Style / minor

  • flatMap producing arrays of objects is fine; readability could be improved by extracting the "split into type/value pair" logic.
  • Comment mentions perm but the sorting regex targets /^@\/permission/. Consistency: rename comment to match, e.g. "permission".
  • frameworks.indexOf(source) inside sort → memoize with a Map for clarity (trivial perf).
  • _entry.text joins with '\n' while original may use \r\n on Windows (code.text is raw). Consider normalizing or joining with the detected EOL from the first node's line break.

Summary of recommended fixes (priority order)

Priority Item
High #9 – block reset after trailing comment drops the node
High #10 – confirm blank-line preservation strategy
High #1 – don't duplicate import attributes to the synthetic type import
Medium #4/#3 – compute length from rendered string; extract PRINT_WIDTH
Medium #8 – simplify double leading-comment checks (blank-line aware)
Low #6 – anchor src/api regex not to match third-party paths
Low Cleanups: named constants, docs, memoized framework rank, remove redundant node.type === 'ImportDeclaration' guards

Overall the rule logic is solid and defensively guards execution order — the main real risks are the trailing-comment block reset and the loss of intentional blank-line grouping.

9 changes: 6 additions & 3 deletions ui/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { globalIgnores } from 'eslint/config'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import pluginOxlint from 'eslint-plugin-oxlint'
import skipFormatting from 'eslint-config-prettier/flat'
import pluginOxlint from 'eslint-plugin-oxlint'
import pluginVue from 'eslint-plugin-vue'
import { globalIgnores } from 'eslint/config'
import importOrder from './eslint-rules/import-order.mjs'

// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
// import { configureVueProject } from '@vue/eslint-config-typescript'
Expand All @@ -25,7 +26,9 @@ export default defineConfigWithVueTs(
skipFormatting,

{
plugins: { project: { rules: { 'import-order': importOrder } } },
rules: {
'project/import-order': 'error',
'vue/multi-word-component-names': ['error', { ignores: ['index'] }],
},
},
Expand Down
8 changes: 4 additions & 4 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import { computed } from 'vue'
import 'dayjs/locale/zh-cn'
import 'dayjs/locale/zh-tw'
import { useI18n } from 'vue-i18n'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { RouterView } from 'vue-router'
import en from 'element-plus/es/locale/lang/en'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import zhTw from 'element-plus/es/locale/lang/zh-tw'
import { normalizeLocale } from '@/locales/config'
import { RouterView } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { TOOLTIP_SHOW_DELAY } from '@/components/global/mk-tooltip/constants'
import { normalizeLocale } from '@/locales/config'

const { locale } = useI18n({ useScope: 'global' })
const elementLocales = { 'zh-CN': zhCn, 'en-US': en, 'zh-Hant': zhTw }
Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/admin/auth/base-info.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** 提供 Admin 登录前所需的平台公开信息接口。 */

import { get } from '../core/request'
import type { LoginConfig } from '@/api/types'
import type { BaseProfile, ThemeInfo } from './types'
import type { LoginConfig } from '@/api/types'
import { get } from '../core/request'

/** 获取平台版本、许可信息及登录加密公钥。 */
const getBaseProfile = () => {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/admin/auth/current-user.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** 提供 Admin 登录后的当前用户接口。 */

import { get, post } from '../core/request'
import type { ListItem } from '@/api/types'
import type { PasswordRequest } from '../core/types'
import type { CurrentUserInfo } from './types'
import type { ListItem } from '@/api/types'
import { get, post } from '../core/request'

/** 获取当前登录用户、权限、语言及可用工作空间。 */
const getCurrentUserInfo = () => {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/admin/auth/external-login.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** 提供 Admin 第三方认证、扫码登录及客户端授权回调接口。 */

import { get } from '../core/request'
import type { ExternalAuthSetting, QrCodeSource } from '@/api/types'
import type { LoginResponse } from './types'
import type { ExternalAuthSetting, QrCodeSource } from '@/api/types'
import { get } from '../core/request'

/** 获取外部认证方式的跳转配置。 */
const getExternalAuthSetting = (authType: string) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/auth/forgot-password.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** 提供 Admin 忘记密码页面发送验证码与重置密码的接口。 */

import { post } from '../core/request'
import type { ResetPasswordRequest, SendEmailRequest } from '@/api/types/login'
import { post } from '../core/request'

/** 向指定邮箱发送用于重置密码的验证码。 */
const postSendVerificationCode = (email: string) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/auth/license.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, put } from '../core/request'
import type { LicenseProfile } from '@/api/types'
import { get, put } from '../core/request'

/** 获取当前平台的授权信息。 */
const getLicense = () => get<LicenseProfile>('/license/profile')
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** 提供 Admin 普通账号登录、LDAP 登录、登出和验证码接口。 */

import { get, post } from '../core/request'
import type { CaptchaResponse, LoginRequest, LoginResponse } from './types'
import { get, post } from '../core/request'

/** 使用账号和密码登录 Admin 应用。 */
const postLogin = (loginRequest: LoginRequest) => {
Expand Down
9 changes: 5 additions & 4 deletions ui/src/api/admin/core/request.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/** 提供 Admin API 的 Axios 实例与常用 HTTP 请求封装。 */

import axios, { AxiosHeaders, type AxiosRequestConfig, type AxiosResponse, type AxiosProgressEvent, type InternalAxiosRequestConfig } from 'axios'
import router from '@/router/admin'
import { useStore } from '@/stores'
import axios, { AxiosHeaders } from 'axios'
import type { ApiResponse } from './types'
import type { Dict } from '@/api/types'
import { MsgError } from '@/utils/message'
import type { AxiosProgressEvent, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'
import { ADMIN_API_BASE_PATH } from '@/api/constants'
import router from '@/router/admin'
import { useStore } from '@/stores'
import { MsgError } from '@/utils/message'

const DEFAULT_TIMEOUT = 30 * 60 * 1000 // 30 minutes

Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/admin/file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AxiosProgressEvent } from 'axios'
import { postUpload, del, get } from './core/request'
import type { FileSourceType, UrlFileContent } from '@/api/types'
import type { AxiosProgressEvent } from 'axios'
import { del, get, postUpload } from './core/request'

/** 上传资源文件,支持可选的进度回调与取消操作。 */
const postUploadFile = (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/model-provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, post } from './core/request'
import type { BaseModelOption, DynamicFormField, ModelProviderItem, ModelTypeOption } from '@/api/types'
import { get, post } from './core/request'

const prefix = '/provider'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ApplicationStoreResponse, Dict, KnowledgeWorkflowStoreResponse, ToolStoreResponse, ToolWorkflowStoreResponse } from '@/api/types'
import { get } from './core/request'
import type { ApplicationStoreResponse, KnowledgeWorkflowStoreResponse, Dict, ToolStoreResponse, ToolWorkflowStoreResponse } from '@/api/types'

/** 获取工具商店列表。 */
const getStoreToolList = (query?: Dict<unknown>) => {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/api-key.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { del, get, post, put } from '../core/request'
import type { ParamsPage, ResponsePage } from '../core/types'
import type { ApiKeyPayload, ApiKeyRecord, Dict } from '@/api/types'
import { del, get, post, put } from '../core/request'

const prefix = '/system/api_key'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, post, put } from '../../core/request'
import type { QrLoginPlatform, QrLoginPlatformPayload } from '@/api/types'
import { get, post, put } from '../../core/request'

const prefix = '/chat_user/auth/platform/source'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/chat-management/chat-user-auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, post, put } from '../../core/request'
import type { AuthProviderSettingPayload, AuthProviderType, OptionItem } from '@/api/types'
import { get, post, put } from '../../core/request'

const prefix = '/chat_user/auth'

Expand Down
4 changes: 2 additions & 2 deletions ui/src/api/admin/system/chat-management/chat-user-groups.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { del, get, post } from '../../core/request'
import type { ParamsPage, ResponsePage } from '../../core/types'
import type { ChatUserGroupMember, ChatUserGroupPayload, ListItem, Dict } from '@/api/types'
import type { ChatUserGroupMember, ChatUserGroupPayload, Dict, ListItem } from '@/api/types'
import { del, get, post } from '../../core/request'

const prefix = '/system/group'

Expand Down
8 changes: 4 additions & 4 deletions ui/src/api/admin/system/chat-management/chat-user.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { del, get, post, put } from '../../core/request'
import type { ParamsPage, ResponsePage, PasswordRequest } from '../../core/types'
import type { ParamsPage, PasswordRequest, ResponsePage } from '../../core/types'
import type {
BatchSetChatUserGroupsRequest,
BatchSetChatUserQuotaRequest,
BatchSetChatUserQuotaResult,
BatchSetChatUserGroupsRequest,
ChatUserBase,
ChatUser,
ChatUserBase,
ChatUserPayload,
ChatUserQuota,
ChatUserQuotaPayload,
ChatUserSyncResult,
ChatUserUpdateRequest,
Dict,
} from '@/api/types'
import { del, get, post, put } from '../../core/request'

const prefix = '/system/chat_user'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/chat-management/portal-setting.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, put } from '../../core/request'
import type { PortalSetting, PortalSettingPayload } from '@/api/types'
import { get, put } from '../../core/request'

/** 获取门户基本信息与访问配置。 */
const getPortalSetting = () => get<PortalSetting>('/portal')
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get } from '../core/request'
import type { CommonUserOption, Dict, SystemUserOption } from '@/api/types'
import { get } from '../core/request'

/** 获取默认密码。 */
const getDefaultPassword = () => {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/api/admin/system/homepage.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { get, getExportFile } from '../core/request'
import type { ParamsPage, ResponsePage } from '../core/types'
import type {
HomeApplicationAggregation,
HomeDateRange,
HomeKnowledgeAggregation,
HomeToolAggregation,
HomeModelAggregation,
HomeDateRange,
HomeMonitoringDay,
HomeRankingKind,
HomeRankingRecord,
HomeToolAggregation,
} from '@/api/types'
import { get, getExportFile } from '../core/request'

const prefix = `/system/homepage`

Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/operate-log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { postExportExcel, get, post } from '../core/request'
import type { ParamsPage, ResponsePage } from '../core/types'
import type { Dict, OperateLog, OperateLogMenuOption } from '@/api/types'
import { get, post, postExportExcel } from '../core/request'

const prefix = '/operate_log'

Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/admin/system/resource-authorization.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { get, put } from '../core/request'
import type { Dict, ResourceAuthorizationType, ResourcePermissionItem, ResourcePermissionPayload } from '@/api/types'
import { get, put } from '../core/request'

/** 系统管理用户资源授权 */
const prefix = (workspaceId: string) => `/workspace/${workspaceId}/user_resource_permission`
Expand Down
Loading
Loading