Pre Merge pull request !5 from xingyu/feat/new_eslint

pull/5/MERGE
xingyu 2023-04-27 09:51:26 +00:00 committed by Gitee
commit 10c3156182
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
822 changed files with 26224 additions and 25121 deletions

91
.commitlintrc.js Normal file
View File

@ -0,0 +1,91 @@
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name.replace(/s$/, ''));
// precomputed scope
const scopeComplete = execSync('git status --porcelain || true')
.toString()
.trim()
.split('\n')
.find((r) => ~r.indexOf('M src'))
?.replace(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '');
/** @type {import('cz-git').UserConfig} */
module.exports = {
ignores: [(commit) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release'],
],
},
prompt: {
/** @use `yarn commit :f` */
alias: {
f: 'docs: fix typos',
r: 'docs: update README',
s: 'style: update code format',
b: 'build: bump dependencies',
c: 'chore: update config',
},
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
defaultScope: scopeComplete,
scopes: [...scopes, 'mock'],
allowEmptyIssuePrefixs: false,
allowCustomIssuePrefixs: false,
// English
typesAppend: [
{ value: 'wip', name: 'wip: work in process' },
{ value: 'workflow', name: 'workflow: workflow improvements' },
{ value: 'types', name: 'types: type definition file changes' },
],
// 中英文对照版
// messages: {
// type: '选择你要提交的类型 :',
// scope: '选择一个提交范围 (可选):',
// customScope: '请输入自定义的提交范围 :',
// subject: '填写简短精炼的变更描述 :\n',
// body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
// breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
// footerPrefixsSelect: '选择关联issue前缀 (可选):',
// customFooterPrefixs: '输入自定义issue前缀 :',
// footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
// confirmCommit: '是否提交或修改commit ?',
// },
// types: [
// { value: 'feat', name: 'feat: 新增功能' },
// { value: 'fix', name: 'fix: 修复缺陷' },
// { value: 'docs', name: 'docs: 文档变更' },
// { value: 'style', name: 'style: 代码格式' },
// { value: 'refactor', name: 'refactor: 代码重构' },
// { value: 'perf', name: 'perf: 性能优化' },
// { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
// { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
// { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
// { value: 'revert', name: 'revert: 回滚 commit' },
// { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
// { value: 'wip', name: 'wip: 正在开发中' },
// { value: 'workflow', name: 'workflow: 工作流程改进' },
// { value: 'types', name: 'types: 类型定义文件修改' },
// ],
// emptyScopesAlias: 'empty: 不填写',
// customScopesAlias: 'custom: 自定义',
},
};

View File

@ -8,6 +8,9 @@ node_modules
dist dist
/public /public
/docs /docs
.husky
.local .local
/bin /bin
Dockerfile Dockerfile
**/dist/**
__tests__

View File

@ -1,53 +1,68 @@
module.exports = { module.exports = {
root: true, root: true,
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:jsonc/recommended-with-jsonc',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:n/recommended',
'plugin:import/recommended',
'plugin:regexp/recommended',
],
env: { env: {
browser: true, browser: true,
node: true, node: true,
es6: true es6: true,
}, },
parser: 'vue-eslint-parser', parser: 'vue-eslint-parser',
plugins: ['vue'],
parserOptions: { parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module', sourceType: 'module',
jsxPragma: 'React', jsxPragma: 'React',
ecmaFeatures: { ecmaFeatures: {
jsx: true jsx: true,
} },
project: './tsconfig.*?.json',
createDefaultProgram: false,
extraFileExtensions: ['.vue'],
}, },
extends: ['plugin:vue/vue3-recommended', 'prettier', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], plugins: ['vue', '@typescript-eslint', 'import', 'simple-import-sort'],
rules: { rules: {
'max-len': ['error', { code: 140, tabWidth: 2, ignoreComments: true }], 'max-len': ['error', { code: 140, tabWidth: 2, ignoreComments: true }],
'vue/script-setup-uses-vars': 'error', 'no-console': 'warn',
'@typescript-eslint/ban-ts-ignore': 'off', 'no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', 'no-case-declarations': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off', 'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off', 'space-before-function-paren': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off', 'simple-import-sort/imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off', 'simple-import-sort/exports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off', 'import/no-unresolved': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'error', 'error',
{ {
argsIgnorePattern: '^_', argsIgnorePattern: '^_',
varsIgnorePattern: '^_' varsIgnorePattern: '^_',
} },
], ],
'no-unused-vars': [ '@typescript-eslint/ban-ts-comment': 'off',
'error', '@typescript-eslint/ban-types': 'off',
{ '@typescript-eslint/explicit-function-return-type': 'off',
argsIgnorePattern: '^_', '@typescript-eslint/no-explicit-any': 'off',
varsIgnorePattern: '^_' '@typescript-eslint/no-var-requires': 'off',
} '@typescript-eslint/no-use-before-define': 'off',
], '@typescript-eslint/no-non-null-assertion': 'off',
'space-before-function-paren': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/script-setup-uses-vars': 'error',
'vue/no-reserved-component-names': 'off',
'vue/custom-event-name-casing': 'off',
'vue/attributes-order': 'off', 'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off', 'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off', 'vue/html-closing-bracket-newline': 'off',
@ -57,18 +72,134 @@ module.exports = {
'vue/attribute-hyphenation': 'off', 'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off', 'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off', 'vue/require-explicit-emits': 'off',
'vue/prefer-import-from-vue': 'off',
'vue/html-self-closing': [ 'vue/html-self-closing': [
'error', 'error',
{ {
html: { html: {
void: 'always', void: 'always',
normal: 'never', normal: 'never',
component: 'always' component: 'always',
}, },
svg: 'always', svg: 'always',
math: 'always' math: 'always',
} },
], ],
'vue/multi-word-component-names': 'off' 'vue/multi-word-component-names': 'off',
} eqeqeq: ['warn', 'always', { null: 'never' }],
} 'no-debugger': 'error',
'no-empty': ['warn', { allowEmptyCatch: true }],
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
'n/no-missing-import': 'off',
'n/no-unpublished-import': 'off',
'n/no-unsupported-features/es-syntax': [
'error',
{
version: '>=18.0.0',
ignores: [],
},
],
'n/no-extraneous-import': [
'error',
{
allowModules: ['unbuild', '@vben/vite-config'],
},
],
'prettier/prettier': 'error',
'import/no-unresolved': 'off',
'object-shorthand': ['error', 'always', { ignoreConstructors: false, avoidQuotes: true }],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': false,
},
],
/**
* 强制关键字前后有一个空格
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
*/
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': [
'error',
{
before: true,
after: true,
overrides: {
return: { after: true },
throw: { after: true },
case: { after: true },
},
},
],
/**
* 禁止出现空函数普通函数 async/await/generator箭头函数类上的方法除外
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
*/
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error',
{
allow: ['arrowFunctions', 'functions', 'methods'],
},
],
/**
* 优先使用 interface 而不是 type 定义对象类型
* @link https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
*/
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/ban-types': 'error',
'vue/attributes-order': 'error',
'vue/require-default-prop': 'error',
'vue/require-explicit-emits': 'error',
'vue/prefer-import-from-vue': 'error',
'vue/multiline-html-element-content-newline': 'error',
'vue/html-closing-bracket-newline': 'error',
'vue/one-component-per-file': 'error',
'vue/custom-event-name-casing': 'error',
},
overrides: [
{
files: ['*.json', '*.json5', '*.jsonc'],
parser: 'jsonc-eslint-parser',
},
{
files: ['**.test.ts'],
rules: {
'no-console': 'off',
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
rules: {
'jsonc/sort-keys': 'off',
},
},
],
globals: { defineOptions: 'readonly' },
ignorePatterns: ['**/vendor/**', '**/dist/**', '**/node_modules/**'],
settings: {
'import/resolver': {
node: { extensions: ['.ts', '.d.ts', '.tsx'] },
},
'import/ignore': ['node_modules'],
},
};

9
.lintstagedrc Normal file
View File

@ -0,0 +1,9 @@
// .lintstagedrc.js
module.exports = {
'*.{js,jsx,ts,tsx}': ['prettier --cache --ignore-unknown --write', 'eslint --cache --fix'],
'{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --cache --write--parser json'],
'package.json': ['prettier --cache --write'],
'*.vue': ['prettier --write', 'eslint --cache --fix', 'stylelint --fix'],
'*.{scss,less,styl,html}': ['prettier --cache --ignore-unknown --write', 'stylelint --fix'],
'*.md': ['prettier --cache --ignore-unknown --write'],
};

View File

@ -1,8 +0,0 @@
// .lintstagedrc.js
module.exports = {
'*.js': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .js'],
'*.ts': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .ts'],
'*.vue': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .vue'],
'*.tsx': ['prettier --config prettier.config.js --write', 'eslint --fix --ext .tsx'],
'*.json': 'prettier --config prettier.config.js --write'
}

View File

@ -1,9 +1,11 @@
/dist/* dist
.local .local
.output.js .output.js
/node_modules/** node_modules
.nvmrc
**/*.svg **/*.svg
**/*.sh **/*.sh
/public/* public
.npmrc

27
.prettierrc.js Normal file
View File

@ -0,0 +1,27 @@
module.exports = {
printWidth: 140,
// tab宽度为2空格
tabWidth: 2,
semi: true,
vueIndentScriptAndStyle: false,
singleQuote: true,
trailingComma: 'all',
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
plugins: ['prettier-plugin-packagejson'],
overrides: [
{
files: '.*rc',
options: {
parser: 'json',
},
},
{
files: '*.html',
options: {
parser: 'html',
},
},
],
};

View File

@ -1,3 +1,3 @@
/dist/* dist
/public/* public
public/* __tests__

View File

@ -1,42 +1,56 @@
module.exports = { module.exports = {
root: true, root: true,
plugins: ['stylelint-order'], plugins: ['stylelint-order', 'stylelint-prettier'],
extends: ['stylelint-config-standard'], extends: ['stylelint-config-standard', 'stylelint-config-recess-order'],
customSyntax: 'postcss-html', overrides: [
{
files: ['**/*.(css|html|vue)'],
customSyntax: 'postcss-html',
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue'],
},
],
rules: { rules: {
'prettier/prettier': true,
'at-rule-no-unknown': null,
'selector-not-notation': null,
'import-notation': null,
'function-no-unknown': null, 'function-no-unknown': null,
'selector-class-pattern': null, 'selector-class-pattern': null,
'selector-pseudo-class-no-unknown': [ 'selector-pseudo-class-no-unknown': [
true, true,
{ {
ignorePseudoClasses: ['global'] ignorePseudoClasses: ['global', 'deep'],
} },
], ],
'selector-pseudo-element-no-unknown': [ 'selector-pseudo-element-no-unknown': [
true, true,
{ {
ignorePseudoElements: ['v-deep'] ignorePseudoElements: ['v-deep'],
} },
], ],
'at-rule-no-unknown': [ 'at-rule-no-unknown': [
true, true,
{ {
ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen', 'function', 'if', 'each', 'include', 'mixin'] ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen', 'function', 'if', 'each', 'include', 'mixin'],
} },
], ],
'media-feature-range-notation': null,
'no-empty-source': null, 'no-empty-source': null,
'string-quotes': null,
'import-notation': null, 'import-notation': null,
'named-grid-areas-no-invalid': null, 'named-grid-areas-no-invalid': null,
'no-descending-specificity': null, 'no-descending-specificity': null,
'font-family-no-missing-generic-family-keyword': null, 'font-family-no-missing-generic-family-keyword': null,
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before': [ 'rule-empty-line-before': [
'always', 'always',
{ {
ignore: ['after-comment', 'first-nested'] ignore: ['after-comment', 'first-nested'],
} },
], ],
'unit-no-unknown': [true, { ignoreUnits: ['rpx'] }],
'order/order': [ 'order/order': [
[ [
'dollar-variables', 'dollar-variables',
@ -45,42 +59,20 @@ module.exports = {
'declarations', 'declarations',
{ {
type: 'at-rule', type: 'at-rule',
name: 'supports' name: 'supports',
}, },
{ {
type: 'at-rule', type: 'at-rule',
name: 'media' name: 'media',
}, },
'rules' {
type: 'at-rule',
name: 'include',
},
'rules',
], ],
{ severity: 'warning' } { severity: 'error' },
] ],
}, },
ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'], ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'],
overrides: [ };
{
files: ['*.vue', '**/*.vue', '*.html', '**/*.html'],
extends: ['stylelint-config-recommended'],
rules: {
'keyframes-name-pattern': null,
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep', 'global']
}
],
'selector-pseudo-element-no-unknown': [
true,
{
ignorePseudoElements: ['v-deep', 'v-global', 'v-slotted']
}
]
}
},
{
files: ['*.less', '**/*.less'],
customSyntax: 'postcss-less',
extends: ['stylelint-config-standard', 'stylelint-config-recommended-vue']
}
]
}

53
.vscode/settings.json vendored
View File

@ -1,12 +1,12 @@
{ {
"typescript.tsdk": "./node_modules/typescript/lib", "typescript.tsdk": "./node_modules/typescript/lib",
"volar.tsPlugin": true,
"volar.tsPluginStatus": false,
"npm.packageManager": "pnpm",
"editor.tabSize": 2, "editor.tabSize": 2,
"prettier.printWidth": 140, // "prettier.printWidth": 140, //
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"files.eol": "\n", "files.eol": "\n",
"npm.packageManager": "pnpm",
"eslint.packageManager": "pnpm",
"stylelint.packageManager": "pnpm",
"search.exclude": { "search.exclude": {
"**/node_modules": true, "**/node_modules": true,
"**/*.log": true, "**/*.log": true,
@ -57,23 +57,20 @@
}, },
"stylelint.enable": true, "stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"], "stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"@/": "${workspaceRoot}/src"
},
"[javascriptreact]": { "[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[typescript]": { "[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[typescriptreact]": { "[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[html]": { "[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[css]": { "[css]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[less]": { "[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
@ -85,7 +82,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}, },
"[vue]": { "[vue]": {
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
@ -104,14 +102,10 @@
"i18n-ally.enabledFrameworks": ["vue", "react"], "i18n-ally.enabledFrameworks": ["vue", "react"],
"cSpell.words": [ "cSpell.words": [
"vben", "vben",
"windicss",
"tailwind",
"browserslist", "browserslist",
"tailwindcss", "tailwindcss",
"esnext", "esnext",
"antv", "antv",
"tinymce",
"qrcode",
"sider", "sider",
"pinia", "pinia",
"sider", "sider",
@ -121,10 +115,10 @@
"esno", "esno",
"vitejs", "vitejs",
"sortablejs", "sortablejs",
"mockjs",
"codemirror", "codemirror",
"iconify", "iconify",
"commitlint", "commitlint",
"vditor",
"echarts", "echarts",
"cropperjs", "cropperjs",
"logicflow", "logicflow",
@ -132,30 +126,11 @@
"zxcvbn", "zxcvbn",
"lintstagedrc", "lintstagedrc",
"brotli", "brotli",
"tailwindcss",
"sider", "sider",
"pnpm", "pnpm",
"antd" "antd",
], "unref"
"vetur.format.scriptInitialIndent": true,
"vetur.format.styleInitialIndent": true,
"vetur.validation.script": false,
"MicroPython.executeButton": [
{
"text": "▶",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
], ],
// //
"explorer.fileNesting.enabled": true, "explorer.fileNesting.enabled": true,
@ -164,7 +139,9 @@
"*.ts": "$(capture).test.ts, $(capture).test.tsx", "*.ts": "$(capture).test.ts, $(capture).test.tsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx", "*.tsx": "$(capture).test.ts, $(capture).test.tsx",
"*.env": "$(capture).env.*", "*.env": "$(capture).env.*",
"package.json": "pnpm-lock.yaml,yarn.lock,LICENSE,README*,CHANGELOG*,CNAME,.gitattributes,.gitignore,prettier.config.js,stylelint.config.js,commitlint.config.js,.stylelintignore,.prettierignore,.gitpod.yml,.eslintrc.js,.eslintignore" "CHANGELOG.md": "CHANGELOG*",
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,README*,.npmrc,.browserslistrc,.nvmrc",
".eslintrc.js": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.js,.prettierrc.js,.stylelintrc.js,.lintstagedrc"
}, },
"terminal.integrated.scrollback": 10000 "terminal.integrated.scrollback": 10000
} }

View File

@ -9,7 +9,7 @@
如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。 如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。
## 原框架地址 各位大佬点个star ## 原框架地址 各位大佬点个 star
- [gitee](https://gitee.com/xingyuv/vue-vben-admin) - [gitee](https://gitee.com/xingyuv/vue-vben-admin)
- [github](https://github.com/xingyuv/vue-vben-admin) - [github](https://github.com/xingyuv/vue-vben-admin)
@ -29,24 +29,24 @@
- 系统管理 页面适配 99% - 系统管理 页面适配 99%
- 基础设施 页面适配 99% - 基础设施 页面适配 99%
- 支付管理 页面适配 99% - 支付管理 页面适配 99%
- 公众号 页面适配 40% - 公众号 页面适配 40%
- 仿钉钉工作流 进行中40% 预计5月底 - 仿钉钉工作流 进行中 40% 预计 5 月底
- 升级 antdv 4.0 预计5月底 - 升级 antdv 4.0 预计 5 月底
## 框架 ## 框架
| 框架 | 说明 | 版本 | | 框架 | 说明 | 版本 |
| --- | --- | --- | | -------------------------------------------------------------------- | ------------------------- | ------ |
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 | | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.3 | | [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.3 |
| [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.19 | | [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.19 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 | | [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 | | [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 | | [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 | | [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 |
| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 | | [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 |
| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 | | [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 |
<p align="center"> <p align="center">
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview1.png"> <img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview1.png">
@ -54,7 +54,6 @@
<img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview3.png"> <img alt="VbenAdmin Logo" width="100%" src="https://anncwb.github.io/anncwb/images/preview3.png">
</p> </p>
## 准备 ## 准备
- [node](http://nodejs.org/) 和 [git](https://git-scm.com/) -项目开发环境 - [node](http://nodejs.org/) 和 [git](https://git-scm.com/) -项目开发环境

View File

@ -1,69 +1,69 @@
import { generate } from '@ant-design/colors' import { generate } from '@ant-design/colors';
export const primaryColor = '#0960bd' export const primaryColor = '#0960bd';
export const darkMode = 'light' export const darkMode = 'light';
type Fn = (...arg: any) => any type Fn = (...arg: any) => any;
type GenerateTheme = 'default' | 'dark' type GenerateTheme = 'default' | 'dark';
export interface GenerateColorsParams { export interface GenerateColorsParams {
mixLighten: Fn mixLighten: Fn;
mixDarken: Fn mixDarken: Fn;
tinycolor: any tinycolor: any;
color?: string color?: string;
} }
export function generateAntColors(color: string, theme: GenerateTheme = 'default') { export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
return generate(color, { return generate(color, {
theme theme,
}) });
} }
export function getThemeColors(color?: string) { export function getThemeColors(color?: string) {
const tc = color || primaryColor const tc = color || primaryColor;
const lightColors = generateAntColors(tc) const lightColors = generateAntColors(tc);
const primary = lightColors[5] const primary = lightColors[5];
const modeColors = generateAntColors(primary, 'dark') const modeColors = generateAntColors(primary, 'dark');
return [...lightColors, ...modeColors] return [...lightColors, ...modeColors];
} }
export function generateColors({ color = primaryColor, mixLighten, mixDarken, tinycolor }: GenerateColorsParams) { export function generateColors({ color = primaryColor, mixLighten, mixDarken, tinycolor }: GenerateColorsParams) {
const arr = new Array(19).fill(0) const arr = new Array(19).fill(0);
const lightens = arr.map((_t, i) => { const lightens = arr.map((_t, i) => {
return mixLighten(color, i / 5) return mixLighten(color, i / 5);
}) });
const darkens = arr.map((_t, i) => { const darkens = arr.map((_t, i) => {
return mixDarken(color, i / 5) return mixDarken(color, i / 5);
}) });
const alphaColors = arr.map((_t, i) => { const alphaColors = arr.map((_t, i) => {
return tinycolor(color) return tinycolor(color)
.setAlpha(i / 20) .setAlpha(i / 20)
.toRgbString() .toRgbString();
}) });
const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.')) const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.'));
const tinycolorLightens = arr const tinycolorLightens = arr
.map((_t, i) => { .map((_t, i) => {
return tinycolor(color) return tinycolor(color)
.lighten(i * 5) .lighten(i * 5)
.toHexString() .toHexString();
}) })
.filter((item) => item !== '#ffffff') .filter((item) => item !== '#ffffff');
const tinycolorDarkens = arr const tinycolorDarkens = arr
.map((_t, i) => { .map((_t, i) => {
return tinycolor(color) return tinycolor(color)
.darken(i * 5) .darken(i * 5)
.toHexString() .toHexString();
}) })
.filter((item) => item !== '#000000') .filter((item) => item !== '#000000');
return [...lightens, ...darkens, ...alphaColors, ...shortAlphaColors, ...tinycolorDarkens, ...tinycolorLightens].filter( return [...lightens, ...darkens, ...alphaColors, ...shortAlphaColors, ...tinycolorDarkens, ...tinycolorLightens].filter(
(item) => !item.includes('-') (item) => !item.includes('-'),
) );
} }

View File

@ -1,6 +1,6 @@
/** /**
* The name of the configuration file entered in the production environment * The name of the configuration file entered in the production environment
*/ */
export const GLOB_CONFIG_FILE_NAME = '_app.config.js' export const GLOB_CONFIG_FILE_NAME = '_app.config.js';
export const OUTPUT_DIR = 'dist' export const OUTPUT_DIR = 'dist';

View File

@ -1,21 +1,21 @@
import { generateAntColors, primaryColor } from '../config/themeConfig' import { generateAntColors, primaryColor } from '../config/themeConfig';
import { getThemeVariables } from 'ant-design-vue/dist/theme' import { getThemeVariables } from 'ant-design-vue/dist/theme';
import { resolve } from 'path' import { resolve } from 'path';
/** /**
* less global variable * less global variable
*/ */
export function generateModifyVars(dark = false) { export function generateModifyVars(dark = false) {
const palettes = generateAntColors(primaryColor) const palettes = generateAntColors(primaryColor);
const primary = palettes[5] const primary = palettes[5];
const primaryColorObj: Record<string, string> = {} const primaryColorObj: Record<string, string> = {};
for (let index = 0; index < 10; index++) { for (let index = 0; index < 10; index++) {
primaryColorObj[`primary-${index + 1}`] = palettes[index] primaryColorObj[`primary-${index + 1}`] = palettes[index];
} }
const modifyVars = getThemeVariables({ dark }) const modifyVars = getThemeVariables({ dark });
return { return {
...modifyVars, ...modifyVars,
// Used for global import to avoid the need to import each style file separately // Used for global import to avoid the need to import each style file separately
@ -32,6 +32,6 @@ export function generateModifyVars(dark = false) {
'font-size-base': '14px', // Main font size 'font-size-base': '14px', // Main font size
'border-radius-base': '2px', // Component/float fillet 'border-radius-base': '2px', // Component/float fillet
'link-color': primary, // Link color 'link-color': primary, // Link color
'app-content-background': '#fafafa' // Link color 'app-content-background': '#fafafa', // Link color
} };
} }

View File

@ -1,20 +1,20 @@
import path from 'path' import path from 'path';
import fs from 'fs-extra' import fs from 'fs-extra';
import inquirer from 'inquirer' import inquirer from 'inquirer';
import colors from 'picocolors' import colors from 'picocolors';
import pkg from '../../../package.json' import pkg from '../../../package.json';
async function generateIcon() { async function generateIcon() {
const dir = path.resolve(process.cwd(), 'node_modules/@iconify/json') const dir = path.resolve(process.cwd(), 'node_modules/@iconify/json');
const raw = await fs.readJSON(path.join(dir, 'collections.json')) const raw = await fs.readJSON(path.join(dir, 'collections.json'));
const collections = Object.entries(raw).map(([id, v]) => ({ const collections = Object.entries(raw).map(([id, v]) => ({
...(v as any), ...(v as any),
id id,
})) }));
const choices = collections.map((item) => ({ key: item.id, value: item.id, name: item.name })) const choices = collections.map((item) => ({ key: item.id, value: item.id, name: item.name }));
inquirer inquirer
.prompt([ .prompt([
@ -23,46 +23,46 @@ async function generateIcon() {
name: 'useType', name: 'useType',
choices: [ choices: [
{ key: 'local', value: 'local', name: 'Local' }, { key: 'local', value: 'local', name: 'Local' },
{ key: 'onLine', value: 'onLine', name: 'OnLine' } { key: 'onLine', value: 'onLine', name: 'OnLine' },
], ],
message: 'How to use icons?' message: 'How to use icons?',
}, },
{ {
type: 'list', type: 'list',
name: 'iconSet', name: 'iconSet',
choices: choices, choices: choices,
message: 'Select the icon set that needs to be generated?' message: 'Select the icon set that needs to be generated?',
}, },
{ {
type: 'input', type: 'input',
name: 'output', name: 'output',
message: 'Select the icon set that needs to be generated?', message: 'Select the icon set that needs to be generated?',
default: 'src/components/Icon/data' default: 'src/components/Icon/data',
} },
]) ])
.then(async (answers) => { .then(async (answers) => {
const { iconSet, output, useType } = answers const { iconSet, output, useType } = answers;
const outputDir = path.resolve(process.cwd(), output) const outputDir = path.resolve(process.cwd(), output);
await fs.ensureDir(outputDir) await fs.ensureDir(outputDir);
const genCollections = collections.filter((item) => [iconSet].includes(item.id)) const genCollections = collections.filter((item) => [iconSet].includes(item.id));
const prefixSet: string[] = [] const prefixSet: string[] = [];
for (const info of genCollections) { for (const info of genCollections) {
const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`)) const data = await fs.readJSON(path.join(dir, 'json', `${info.id}.json`));
if (data) { if (data) {
const { prefix } = data const { prefix } = data;
const isLocal = useType === 'local' const isLocal = useType === 'local';
const icons = Object.keys(data.icons).map((item) => `${isLocal ? prefix + ':' : ''}${item}`) const icons = Object.keys(data.icons).map((item) => `${isLocal ? prefix + ':' : ''}${item}`);
await fs.writeFileSync( await fs.writeFileSync(
path.join(output, `icons.data.ts`), path.join(output, `icons.data.ts`),
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}` `export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
) );
prefixSet.push(prefix) prefixSet.push(prefix);
} }
} }
await fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite')) await fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`) console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`);
}) });
} }
generateIcon() generateIcon();

View File

@ -3,5 +3,5 @@
* @param env * @param env
*/ */
export const getConfigFileName = (env: Record<string, any>) => { export const getConfigFileName = (env: Record<string, any>) => {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '') return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '');
} };

View File

@ -1,47 +1,47 @@
/** /**
* Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging * Generate additional configuration files when used for packaging. The file can be configured with some global variables, so that it can be changed directly externally without repackaging
*/ */
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant' import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra' import fs, { writeFileSync } from 'fs-extra';
import colors from 'picocolors' import colors from 'picocolors';
import { getEnvConfig, getRootPath } from '../utils' import { getEnvConfig, getRootPath } from '../utils';
import { getConfigFileName } from '../getConfigFileName' import { getConfigFileName } from '../getConfigFileName';
import pkg from '../../package.json' import pkg from '../../package.json';
interface CreateConfigParams { interface CreateConfigParams {
configName: string configName: string;
config: any config: any;
configFileName?: string configFileName?: string;
} }
function createConfig(params: CreateConfigParams) { function createConfig(params: CreateConfigParams) {
const { configName, config, configFileName } = params const { configName, config, configFileName } = params;
try { try {
const windowConf = `window.${configName}` const windowConf = `window.${configName}`;
// Ensure that the variable will not be modified // Ensure that the variable will not be modified
let configStr = `${windowConf}=${JSON.stringify(config)};` let configStr = `${windowConf}=${JSON.stringify(config)};`;
configStr += ` configStr += `
Object.freeze(${windowConf}); Object.freeze(${windowConf});
Object.defineProperty(window, "${configName}", { Object.defineProperty(window, "${configName}", {
configurable: false, configurable: false,
writable: false, writable: false,
}); });
`.replace(/\s/g, '') `.replace(/\s/g, '');
fs.mkdirp(getRootPath(OUTPUT_DIR)) fs.mkdirp(getRootPath(OUTPUT_DIR));
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr) writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`) console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n') console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
} catch (error) { } catch (error) {
console.log(colors.red('configuration file configuration file failed to package:\n' + error)) console.log(colors.red('configuration file configuration file failed to package:\n' + error));
} }
} }
export function runBuildConfig() { export function runBuildConfig() {
const config = getEnvConfig() const config = getEnvConfig();
const configFileName = getConfigFileName(config) const configFileName = getConfigFileName(config);
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME }) createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME });
} }

View File

@ -1,23 +1,23 @@
// #!/usr/bin/env node // #!/usr/bin/env node
import { runBuildConfig } from './buildConf' import { runBuildConfig } from './buildConf';
import colors from 'picocolors' import colors from 'picocolors';
import pkg from '../../package.json' import pkg from '../../package.json';
export const runBuild = async () => { export const runBuild = async () => {
try { try {
const argvList = process.argv.splice(2) const argvList = process.argv.splice(2);
// Generate configuration file // Generate configuration file
if (!argvList.includes('disabled-config')) { if (!argvList.includes('disabled-config')) {
runBuildConfig() runBuildConfig();
} }
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!') console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - build successfully!');
} catch (error) { } catch (error) {
console.log(colors.red('vite build error:\n' + error)) console.log(colors.red('vite build error:\n' + error));
process.exit(1) process.exit(1);
} }
} };
runBuild() runBuild();

View File

@ -1,62 +1,62 @@
import fs from 'fs' import fs from 'fs';
import path from 'path' import path from 'path';
import dotenv from 'dotenv' import dotenv from 'dotenv';
export function isDevFn(mode: string): boolean { export function isDevFn(mode: string): boolean {
return mode === 'development' return mode === 'development';
} }
export function isProdFn(mode: string): boolean { export function isProdFn(mode: string): boolean {
return mode === 'production' return mode === 'production';
} }
/** /**
* Whether to generate package preview * Whether to generate package preview
*/ */
export function isReportMode(): boolean { export function isReportMode(): boolean {
return process.env.REPORT === 'true' return process.env.REPORT === 'true';
} }
// Read all environment variable configuration files to process.env // Read all environment variable configuration files to process.env
export function wrapperEnv(envConf: Recordable): ViteEnv { export function wrapperEnv(envConf: Recordable): ViteEnv {
const ret: any = {} const ret: any = {};
for (const envName of Object.keys(envConf)) { for (const envName of Object.keys(envConf)) {
let realName = envConf[envName].replace(/\\n/g, '\n') let realName = envConf[envName].replace(/\\n/g, '\n');
realName = realName === 'true' ? true : realName === 'false' ? false : realName realName = realName === 'true' ? true : realName === 'false' ? false : realName;
if (envName === 'VITE_PORT') { if (envName === 'VITE_PORT') {
realName = Number(realName) realName = Number(realName);
} }
if (envName === 'VITE_PROXY' && realName) { if (envName === 'VITE_PROXY' && realName) {
try { try {
realName = JSON.parse(realName.replace(/'/g, '"')) realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) { } catch (error) {
realName = '' realName = '';
} }
} }
ret[envName] = realName ret[envName] = realName;
// if (typeof realName === 'string') { // if (typeof realName === 'string') {
// process.env[envName] = realName; // process.env[envName] = realName;
// } else if (typeof realName === 'object') { // } else if (typeof realName === 'object') {
// process.env[envName] = JSON.stringify(realName); // process.env[envName] = JSON.stringify(realName);
// } // }
} }
return ret return ret;
} }
/** /**
* *
*/ */
function getConfFiles() { function getConfFiles() {
const script = process.env.npm_lifecycle_script const script = process.env.npm_lifecycle_script;
const reg = new RegExp('--mode ([a-z_\\d]+)') const reg = new RegExp('--mode ([a-z_\\d]+)');
const result = reg.exec(script as string) as any const result = reg.exec(script as string) as any;
if (result) { if (result) {
const mode = result[1] as string const mode = result[1] as string;
return ['.env', `.env.${mode}`] return ['.env', `.env.${mode}`];
} }
return ['.env', '.env.production'] return ['.env', '.env.production'];
} }
/** /**
@ -65,22 +65,22 @@ function getConfFiles() {
* @param confFiles ext * @param confFiles ext
*/ */
export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) { export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
let envConfig = {} let envConfig = {};
confFiles.forEach((item) => { confFiles.forEach((item) => {
try { try {
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item))) const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)));
envConfig = { ...envConfig, ...env } envConfig = { ...envConfig, ...env };
} catch (e) { } catch (e) {
console.error(`Error in parsing ${item}`, e) console.error(`Error in parsing ${item}`, e);
} }
}) });
const reg = new RegExp(`^(${match})`) const reg = new RegExp(`^(${match})`);
Object.keys(envConfig).forEach((key) => { Object.keys(envConfig).forEach((key) => {
if (!reg.test(key)) { if (!reg.test(key)) {
Reflect.deleteProperty(envConfig, key) Reflect.deleteProperty(envConfig, key);
} }
}) });
return envConfig return envConfig;
} }
/** /**
@ -88,5 +88,5 @@ export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
* @param dir file path * @param dir file path
*/ */
export function getRootPath(...dir: string[]) { export function getRootPath(...dir: string[]) {
return path.resolve(process.cwd(), ...dir) return path.resolve(process.cwd(), ...dir);
} }

View File

@ -29,9 +29,9 @@ const include = [
'ant-design-vue/es/style', 'ant-design-vue/es/style',
'ant-design-vue/es/locale/zh_CN', 'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US', 'ant-design-vue/es/locale/en_US',
'vite-plugin-windicss' 'vite-plugin-windicss',
] ];
const exclude = ['@iconify/json'] const exclude = ['@iconify/json'];
export { include, exclude } export { include, exclude };

View File

@ -2,21 +2,21 @@
* Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated * Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated
* https://github.com/anncwb/vite-plugin-compression * https://github.com/anncwb/vite-plugin-compression
*/ */
import type { PluginOption } from 'vite' import type { PluginOption } from 'vite';
import compressPlugin from 'vite-plugin-compression' import compressPlugin from 'vite-plugin-compression';
export function configCompressPlugin(compress: 'gzip' | 'brotli' | 'none', deleteOriginFile = false): PluginOption | PluginOption[] { export function configCompressPlugin(compress: 'gzip' | 'brotli' | 'none', deleteOriginFile = false): PluginOption | PluginOption[] {
const compressList = compress.split(',') const compressList = compress.split(',');
const plugins: PluginOption[] = [] const plugins: PluginOption[] = [];
if (compressList.includes('gzip')) { if (compressList.includes('gzip')) {
plugins.push( plugins.push(
compressPlugin({ compressPlugin({
ext: '.gz', ext: '.gz',
deleteOriginFile deleteOriginFile,
}) }),
) );
} }
if (compressList.includes('brotli')) { if (compressList.includes('brotli')) {
@ -24,9 +24,9 @@ export function configCompressPlugin(compress: 'gzip' | 'brotli' | 'none', delet
compressPlugin({ compressPlugin({
ext: '.br', ext: '.br',
algorithm: 'brotliCompress', algorithm: 'brotliCompress',
deleteOriginFile deleteOriginFile,
}) }),
) );
} }
return plugins return plugins;
} }

View File

@ -2,26 +2,26 @@
* Plugin to minimize and use ejs template syntax in index.html. * Plugin to minimize and use ejs template syntax in index.html.
* https://github.com/xingyuv/vite-vue-plugin-html * https://github.com/xingyuv/vite-vue-plugin-html
*/ */
import type { PluginOption } from 'vite' import type { PluginOption } from 'vite';
import { createHtmlPlugin } from 'vite-vue-plugin-html' import { createHtmlPlugin } from 'vite-vue-plugin-html';
import pkg from '../../../package.json' import pkg from '../../../package.json';
import { GLOB_CONFIG_FILE_NAME } from '../../constant' import { GLOB_CONFIG_FILE_NAME } from '../../constant';
export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env const { VITE_GLOB_APP_TITLE, VITE_PUBLIC_PATH } = env;
const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/` const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/`;
const getAppConfigSrc = () => { const getAppConfigSrc = () => {
return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}` return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`;
} };
const htmlPlugin: PluginOption[] = createHtmlPlugin({ const htmlPlugin: PluginOption[] = createHtmlPlugin({
minify: isBuild, minify: isBuild,
inject: { inject: {
// Inject data into ejs template // Inject data into ejs template
data: { data: {
title: VITE_GLOB_APP_TITLE title: VITE_GLOB_APP_TITLE,
}, },
// Embed the generated app.config.js file // Embed the generated app.config.js file
tags: isBuild tags: isBuild
@ -29,12 +29,12 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
{ {
tag: 'script', tag: 'script',
attrs: { attrs: {
src: getAppConfigSrc() src: getAppConfigSrc(),
} },
} },
] ]
: [] : [],
} },
}) });
return htmlPlugin return htmlPlugin;
} }

View File

@ -1,21 +1,21 @@
import { PluginOption } from 'vite' import { PluginOption } from 'vite';
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx' import vueJsx from '@vitejs/plugin-vue-jsx';
import windiCSS from 'vite-plugin-windicss' import windiCSS from 'vite-plugin-windicss';
import progress from 'vite-plugin-progress' import progress from 'vite-plugin-progress';
import purgeIcons from 'vite-plugin-purge-icons' import purgeIcons from 'vite-plugin-purge-icons';
import VitePluginCertificate from 'vite-plugin-mkcert' import VitePluginCertificate from 'vite-plugin-mkcert';
import vueSetupExtend from 'unplugin-vue-setup-extend-plus/vite' import vueSetupExtend from 'unplugin-vue-setup-extend-plus/vite';
import { configPwaConfig } from './pwa' import { configPwaConfig } from './pwa';
import { configHtmlPlugin } from './html' import { configHtmlPlugin } from './html';
import { configCompressPlugin } from './compress' import { configCompressPlugin } from './compress';
import { configStyleImportPlugin } from './styleImport' import { configStyleImportPlugin } from './styleImport';
import { configVisualizerConfig } from './visualizer' import { configVisualizerConfig } from './visualizer';
import { configThemePlugin } from './theme' import { configThemePlugin } from './theme';
import { configSvgIconsPlugin } from './svgSprite' import { configSvgIconsPlugin } from './svgSprite';
export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv const { VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE } = viteEnv;
const vitePlugins: PluginOption[] = [ const vitePlugins: PluginOption[] = [
// have to // have to
@ -27,38 +27,38 @@ export async function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
// support name // support name
vueSetupExtend({}), vueSetupExtend({}),
VitePluginCertificate({ VitePluginCertificate({
source: 'coding' source: 'coding',
}) }),
] ];
// windiCSS // windiCSS
vitePlugins.push(windiCSS()) vitePlugins.push(windiCSS());
// vite-vue-plugin-html // vite-vue-plugin-html
vitePlugins.push(configHtmlPlugin(viteEnv, isBuild)) vitePlugins.push(configHtmlPlugin(viteEnv, isBuild));
// vite-plugin-svg-icons // vite-plugin-svg-icons
vitePlugins.push(configSvgIconsPlugin(isBuild)) vitePlugins.push(configSvgIconsPlugin(isBuild));
// vite-plugin-purge-icons // vite-plugin-purge-icons
vitePlugins.push(purgeIcons()) vitePlugins.push(purgeIcons());
// rollup-plugin-visualizer // rollup-plugin-visualizer
vitePlugins.push(configVisualizerConfig()) vitePlugins.push(configVisualizerConfig());
// vite-plugin-vben-theme // vite-plugin-vben-theme
vitePlugins.push(configThemePlugin(isBuild)) vitePlugins.push(configThemePlugin(isBuild));
// The following plugins only work in the production environment // The following plugins only work in the production environment
if (isBuild) { if (isBuild) {
// vite-plugin-style-import // vite-plugin-style-import
vitePlugins.push(configStyleImportPlugin(isBuild)) vitePlugins.push(configStyleImportPlugin(isBuild));
// rollup-plugin-gzip // rollup-plugin-gzip
vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE)) vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE));
// vite-plugin-pwa // vite-plugin-pwa
vitePlugins.push(configPwaConfig(viteEnv)) vitePlugins.push(configPwaConfig(viteEnv));
} }
return vitePlugins return vitePlugins;
} }

View File

@ -2,10 +2,10 @@
* Zero-config PWA for Vite * Zero-config PWA for Vite
* https://github.com/antfu/vite-plugin-pwa * https://github.com/antfu/vite-plugin-pwa
*/ */
import { VitePWA } from 'vite-plugin-pwa' import { VitePWA } from 'vite-plugin-pwa';
export function configPwaConfig(env: ViteEnv) { export function configPwaConfig(env: ViteEnv) {
const { VITE_USE_PWA, VITE_GLOB_APP_TITLE, VITE_GLOB_APP_SHORT_NAME } = env const { VITE_USE_PWA, VITE_GLOB_APP_TITLE, VITE_GLOB_APP_SHORT_NAME } = env;
if (VITE_USE_PWA) { if (VITE_USE_PWA) {
// vite-plugin-pwa // vite-plugin-pwa
@ -17,17 +17,17 @@ export function configPwaConfig(env: ViteEnv) {
{ {
src: './resource/img/pwa-192x192.png', src: './resource/img/pwa-192x192.png',
sizes: '192x192', sizes: '192x192',
type: 'image/png' type: 'image/png',
}, },
{ {
src: './resource/img/pwa-512x512.png', src: './resource/img/pwa-512x512.png',
sizes: '512x512', sizes: '512x512',
type: 'image/png' type: 'image/png',
} },
] ],
} },
}) });
return pwaPlugin return pwaPlugin;
} }
return [] return [];
} }

View File

@ -2,11 +2,11 @@
* Introduces component library styles on demand. * Introduces component library styles on demand.
* https://github.com/xingyuv/vite-plugin-style-import * https://github.com/xingyuv/vite-plugin-style-import
*/ */
import { createStyleImportPlugin } from 'vite-plugin-style-import' import { createStyleImportPlugin } from 'vite-plugin-style-import';
export function configStyleImportPlugin(_isBuild: boolean) { export function configStyleImportPlugin(_isBuild: boolean) {
if (!_isBuild) { if (!_isBuild) {
return [] return [];
} }
const styleImportPlugin = createStyleImportPlugin({ const styleImportPlugin = createStyleImportPlugin({
libs: [ libs: [
@ -44,8 +44,8 @@ export function configStyleImportPlugin(_isBuild: boolean) {
'skeleton-title', 'skeleton-title',
'skeleton-paragraph', 'skeleton-paragraph',
'skeleton-image', 'skeleton-image',
'skeleton-button' 'skeleton-button',
] ];
// 这里是需要额外引入样式的子组件列表 // 这里是需要额外引入样式的子组件列表
// 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失 // 单独引入子组件时需引入组件样式,否则会在打包后导致子组件样式丢失
const replaceList = { const replaceList = {
@ -66,17 +66,17 @@ export function configStyleImportPlugin(_isBuild: boolean) {
'layout-header': 'layout', 'layout-header': 'layout',
'month-picker': 'date-picker', 'month-picker': 'date-picker',
'range-picker': 'date-picker', 'range-picker': 'date-picker',
'image-preview-group': 'image' 'image-preview-group': 'image',
} };
return ignoreList.includes(name) return ignoreList.includes(name)
? '' ? ''
: replaceList.hasOwnProperty(name) : replaceList.hasOwnProperty(name)
? `ant-design-vue/es/${replaceList[name]}/style/index` ? `ant-design-vue/es/${replaceList[name]}/style/index`
: `ant-design-vue/es/${name}/style/index` : `ant-design-vue/es/${name}/style/index`;
} },
} },
] ],
}) });
return styleImportPlugin return styleImportPlugin;
} }

View File

@ -3,16 +3,16 @@
* https://github.com/anncwb/vite-plugin-svg-icons * https://github.com/anncwb/vite-plugin-svg-icons
*/ */
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
import path from 'path' import path from 'path';
import { PluginOption } from 'vite' import { PluginOption } from 'vite';
export function configSvgIconsPlugin(isBuild: boolean) { export function configSvgIconsPlugin(isBuild: boolean) {
const svgIconsPlugin = createSvgIconsPlugin({ const svgIconsPlugin = createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
svgoOptions: isBuild, svgoOptions: isBuild,
// default // default
symbolId: 'icon-[dir]-[name]' symbolId: 'icon-[dir]-[name]',
}) });
return svgIconsPlugin as PluginOption return svgIconsPlugin as PluginOption;
} }

View File

@ -2,48 +2,48 @@
* Vite plugin for website theme color switching * Vite plugin for website theme color switching
* https://github.com/xingyuv/vite-vue-plugin-theme * https://github.com/xingyuv/vite-vue-plugin-theme
*/ */
import type { PluginOption } from 'vite' import type { PluginOption } from 'vite';
import path from 'path' import path from 'path';
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme' import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme';
import { getThemeColors, generateColors } from '../../config/themeConfig' import { getThemeColors, generateColors } from '../../config/themeConfig';
import { generateModifyVars } from '../../generate/generateModifyVars' import { generateModifyVars } from '../../generate/generateModifyVars';
export function configThemePlugin(isBuild: boolean): PluginOption[] { export function configThemePlugin(isBuild: boolean): PluginOption[] {
const colors = generateColors({ const colors = generateColors({
mixDarken, mixDarken,
mixLighten, mixLighten,
tinycolor tinycolor,
}) });
const plugin = [ const plugin = [
viteThemePlugin({ viteThemePlugin({
resolveSelector: (s) => { resolveSelector: (s) => {
s = s.trim() s = s.trim();
switch (s) { switch (s) {
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon': case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
return '.ant-steps-item-icon > .ant-steps-icon' return '.ant-steps-item-icon > .ant-steps-icon';
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)': case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)':
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover': case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover':
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active': case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active':
return s return s;
case '.ant-steps-item-icon > .ant-steps-icon': case '.ant-steps-item-icon > .ant-steps-icon':
return s return s;
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)': case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
return s return s;
default: default:
if (s.indexOf('.ant-btn') >= -1) { if (s.indexOf('.ant-btn') >= -1) {
// 按钮被重新定制过需要过滤掉class防止覆盖 // 按钮被重新定制过需要过滤掉class防止覆盖
return s return s;
} }
} }
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}` return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`;
}, },
colorVariables: [...getThemeColors(), ...colors] colorVariables: [...getThemeColors(), ...colors],
}), }),
antdDarkThemePlugin({ antdDarkThemePlugin({
preloadFiles: [ preloadFiles: [
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'), path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.less'),
//path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'), //path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
path.resolve(process.cwd(), 'src/design/index.less') path.resolve(process.cwd(), 'src/design/index.less'),
], ],
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true), filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
// extractCss: false, // extractCss: false,
@ -74,10 +74,10 @@ export function configThemePlugin(isBuild: boolean): PluginOption[] {
'alert-warning-icon-color': '#d89614', 'alert-warning-icon-color': '#d89614',
'alert-error-border-color': '#58181c', 'alert-error-border-color': '#58181c',
'alert-error-bg-color': '#2a1215', 'alert-error-bg-color': '#2a1215',
'alert-error-icon-color': '#a61d24' 'alert-error-icon-color': '#a61d24',
} },
}) }),
] ];
return plugin as unknown as PluginOption[] return plugin as unknown as PluginOption[];
} }

View File

@ -1,9 +1,9 @@
/** /**
* Package file volume analysis * Package file volume analysis
*/ */
import visualizer from 'rollup-plugin-visualizer' import visualizer from 'rollup-plugin-visualizer';
import { isReportMode } from '../../utils' import { isReportMode } from '../../utils';
import { PluginOption } from 'vite' import { PluginOption } from 'vite';
export function configVisualizerConfig() { export function configVisualizerConfig() {
if (isReportMode()) { if (isReportMode()) {
@ -11,8 +11,8 @@ export function configVisualizerConfig() {
filename: './node_modules/.cache/visualizer/stats.html', filename: './node_modules/.cache/visualizer/stats.html',
open: true, open: true,
gzipSize: true, gzipSize: true,
brotliSize: true brotliSize: true,
}) as PluginOption }) as PluginOption;
} }
return [] return [];
} }

View File

@ -1,24 +1,24 @@
/** /**
* Used to parse the .env.development proxy configuration * Used to parse the .env.development proxy configuration
*/ */
import type { ProxyOptions } from 'vite' import type { ProxyOptions } from 'vite';
type ProxyItem = [string, string] type ProxyItem = [string, string];
type ProxyList = ProxyItem[] type ProxyList = ProxyItem[];
type ProxyTargetList = Record<string, ProxyOptions> type ProxyTargetList = Record<string, ProxyOptions>;
const httpsRE = /^https:\/\// const httpsRE = /^https:\/\//;
/** /**
* Generate proxy * Generate proxy
* @param list * @param list
*/ */
export function createProxy(list: ProxyList = []) { export function createProxy(list: ProxyList = []) {
const ret: ProxyTargetList = {} const ret: ProxyTargetList = {};
for (const [prefix, target] of list) { for (const [prefix, target] of list) {
const isHttps = httpsRE.test(target) const isHttps = httpsRE.test(target);
// https://github.com/http-party/node-http-proxy#options // https://github.com/http-party/node-http-proxy#options
ret[prefix] = { ret[prefix] = {
@ -27,8 +27,8 @@ export function createProxy(list: ProxyList = []) {
ws: true, ws: true,
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''), rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
// https is require secure=false // https is require secure=false
...(isHttps ? { secure: false } : {}) ...(isHttps ? { secure: false } : {}),
} };
} }
return ret return ret;
} }

View File

@ -1,91 +0,0 @@
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')
const scopes = fs
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name.replace(/s$/, ''))
// precomputed scope
const scopeComplete = execSync('git status --porcelain || true')
.toString()
.trim()
.split('\n')
.find((r) => ~r.indexOf('M src'))
?.replace(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '')
/** @type {import('cz-git').UserConfig} */
module.exports = {
ignores: [(commit) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release']
]
},
prompt: {
/** @use `yarn commit :f` */
alias: {
f: 'docs: fix typos',
r: 'docs: update README',
s: 'style: update code format',
b: 'build: bump dependencies',
c: 'chore: update config'
},
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
defaultScope: scopeComplete,
scopes: [...scopes, 'mock'],
allowEmptyIssuePrefixs: false,
allowCustomIssuePrefixs: false,
// English
typesAppend: [
{ value: 'wip', name: 'wip: work in process' },
{ value: 'workflow', name: 'workflow: workflow improvements' },
{ value: 'types', name: 'types: type definition file changes' }
],
// 中英文对照版
messages: {
type: '选择你要提交的类型 :',
scope: '选择一个提交范围 (可选):',
customScope: '请输入自定义的提交范围 :',
subject: '填写简短精炼的变更描述 :\n',
body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
footerPrefixsSelect: '选择关联issue前缀 (可选):',
customFooterPrefixs: '输入自定义issue前缀 :',
footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
confirmCommit: '是否提交或修改commit ?'
},
types: [
{ value: 'feat', name: 'feat: 新增功能' },
{ value: 'fix', name: 'fix: 修复缺陷' },
{ value: 'docs', name: 'docs: 文档变更' },
{ value: 'style', name: 'style: 代码格式' },
{ value: 'refactor', name: 'refactor: 代码重构' },
{ value: 'perf', name: 'perf: 性能优化' },
{ value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
{ value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
{ value: 'revert', name: 'revert: 回滚 commit' },
{ value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
{ value: 'wip', name: 'wip: 正在开发中' },
{ value: 'workflow', name: 'workflow: 工作流程改进' },
{ value: 'types', name: 'types: 类型定义文件修改' }
],
emptyScopesAlias: 'empty: 不填写',
customScopesAlias: 'custom: 自定义'
}
}

View File

@ -1,36 +1,74 @@
{ {
"name": "yudao-ui-admin-vben", "name": "yudao-ui-admin-vben",
"version": "1.7.2", "version": "1.7.2",
"homepage": "https://github.com/xingyuv",
"bugs": {
"url": "https://github.com/xingyuv/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xingyuv/vue-vben-admin.git"
},
"license": "MIT",
"author": { "author": {
"name": "xingyuv", "name": "xingyuv",
"email": "xingyu4j@vip.qq.com", "email": "xingyu4j@vip.qq.com",
"url": "https://github.com/xingyuv" "url": "https://github.com/xingyuv"
}, },
"scripts": { "scripts": {
"commit": "czg",
"bootstrap": "pnpm install", "bootstrap": "pnpm install",
"serve": "npm run dev",
"dev": "vite",
"front": "vite --mode front",
"build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts", "build": "cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=8192 vite build && esno ./build/script/postBuild.ts",
"build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode test && esno ./build/script/postBuild.ts",
"build:static": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode static && esno ./build/script/postBuild.ts",
"build:no-cache": "pnpm clean:cache && npm run build", "build:no-cache": "pnpm clean:cache && npm run build",
"report": "cross-env REPORT=true npm run build", "build:static": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode static && esno ./build/script/postBuild.ts",
"type:check": "vue-tsc --noEmit --skipLibCheck", "build:test": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode test && esno ./build/script/postBuild.ts",
"preview": "npm run build && vite preview",
"preview:dist": "vite preview",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"clean:lib": "rimraf node_modules", "clean:lib": "rimraf node_modules",
"commit": "czg",
"dev": "vite",
"front": "vite --mode front",
"gen:icon": "esno ./build/generate/icon/index.ts",
"lint:eslint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts,tsx}\" --fix", "lint:eslint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts,tsx}\" --fix",
"lint:prettier": "prettier --write \"src/**/*.{js,json,ts,tsx,css,less,scss,vue,html,md}\"",
"lint:style": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",
"lint:lint-staged": "lint-staged", "lint:lint-staged": "lint-staged",
"lint:prettier": "prettier --write .",
"lint:stylelint": "stylelint \"**/*.{vue,css,less,postcss,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"npm:check": "npx npm-check-updates", "npm:check": "npx npm-check-updates",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"prepare": "husky install", "prepare": "husky install",
"gen:icon": "esno ./build/generate/icon/index.ts" "preview": "npm run build && vite preview",
"preview:dist": "vite preview",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"report": "cross-env REPORT=true npm run build",
"serve": "npm run dev",
"type:check": "vue-tsc --noEmit --skipLibCheck"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"prettier --write"
],
"*.md": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}, },
"dependencies": { "dependencies": {
"@ant-design/colors": "^7.0.0", "@ant-design/colors": "^7.0.0",
@ -93,12 +131,19 @@
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.39.0", "eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",
"eslint-define-config": "^1.19.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsonc": "^2.7.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-regexp": "^1.14.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.11.0", "eslint-plugin-vue": "^9.11.0",
"esno": "^0.16.3", "esno": "^0.16.3",
"fs-extra": "^11.1.1", "fs-extra": "^11.1.1",
"husky": "^8.0.3", "husky": "^8.0.3",
"inquirer": "^9.2.0", "inquirer": "^9.2.0",
"jsonc-eslint-parser": "^2.2.0",
"less": "^4.1.3", "less": "^4.1.3",
"lint-staged": "^13.2.2", "lint-staged": "^13.2.2",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
@ -106,14 +151,17 @@
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-packagejson": "^2.4.3",
"rimraf": "^5.0.0", "rimraf": "^5.0.0",
"rollup": "^3.21.0", "rollup": "^3.21.0",
"rollup-plugin-visualizer": "^5.9.0", "rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^15.6.0", "stylelint": "^15.6.0",
"stylelint-config-recess-order": "^4.0.0",
"stylelint-config-recommended": "^12.0.0", "stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended-vue": "^1.4.0", "stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard": "^33.0.0", "stylelint-config-standard": "^33.0.0",
"stylelint-order": "^6.0.3", "stylelint-order": "^6.0.3",
"stylelint-prettier": "^3.0.0",
"terser": "^5.17.1", "terser": "^5.17.1",
"typescript": "^5.0.4", "typescript": "^5.0.4",
"unplugin-vue-setup-extend-plus": "^1.0.0", "unplugin-vue-setup-extend-plus": "^1.0.0",
@ -131,47 +179,9 @@
"vue-eslint-parser": "^9.1.1", "vue-eslint-parser": "^9.1.1",
"vue-tsc": "^1.6.0" "vue-tsc": "^1.6.0"
}, },
"repository": {
"type": "git",
"url": "git+https://github.com/xingyuv/vue-vben-admin.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/xingyuv/issues"
},
"homepage": "https://github.com/xingyuv",
"packageManager": "pnpm@8.1.0", "packageManager": "pnpm@8.1.0",
"engines": { "engines": {
"node": ">= 16.0.0", "node": ">= 16.0.0",
"pnpm": ">=8.1.0" "pnpm": ">=8.1.0"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [
"prettier --write--parser json"
],
"package.json": [
"prettier --write"
],
"*.vue": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,styl,html}": [
"stylelint --fix",
"prettier --write"
],
"*.md": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
plugins: { plugins: {
autoprefixer: {} autoprefixer: {},
} },
} };

View File

@ -1,37 +0,0 @@
module.exports = {
// 一行代码的最大字符数默认是80
printWidth: 140,
// tab宽度为2空格
tabWidth: 2,
// 使用tab缩进默认false
useTabs: false,
// 结尾是否添加分号, 默认true
semi: false,
// vue script和style标签中是否缩进,开启可能会破坏编辑器的代码折叠
vueIndentScriptAndStyle: false,
// 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号)
singleQuote: true,
// object对象中key值是否加引号 as-needed只有在需求要的情况下加引号consistent是有一个需要引号就统一加preserve是保留用户输入的引号
quoteProps: 'as-needed',
// object对象里面的key和value值和括号间的空格
bracketSpacing: true,
// 行尾逗号,默认none,可选 none|es5|all
// es5 包括es5中的数组、对象
// all 包括函数对象等所有可选
trailingComma: 'none',
// 在jsx文件中的引号需要单独设置 默认false
jsxSingleQuote: false,
// 箭头函数单个参数的情况是否省略括号默认always是总是带括号
// avoid 能省略括号的时候就省略 例如x => x
// always 总是有括号
arrowParens: 'always',
insertPragma: false,
requirePragma: false,
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
// endOfLine: "<lf|crlf|cr|auto>" 行尾换行符,默认是lf
endOfLine: 'auto',
// range是format执行的范围可以选执行一个文件的一部分默认的设置是整个文件
rangeStart: 0,
rangeEnd: Infinity
}

View File

@ -7,21 +7,22 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue' import 'dayjs/locale/zh-cn';
import { ConfigProvider } from 'ant-design-vue'
import { AppProvider } from '@/components/Application'
import { useTitle } from '@/hooks/web/useTitle'
import { useLocale } from '@/locales/useLocale'
import { useAppStore } from '@/store/modules/app'
import 'dayjs/locale/zh-cn' import { ConfigProvider } from 'ant-design-vue';
import { computed } from 'vue';
import { AppProvider } from '@/components/Application';
import { useTitle } from '@/hooks/web/useTitle';
import { useLocale } from '@/locales/useLocale';
import { useAppStore } from '@/store/modules/app';
// support Multi-language // support Multi-language
const { getAntdLocale } = useLocale() const { getAntdLocale } = useLocale();
const appStore = useAppStore() const appStore = useAppStore();
const componentSize = computed(() => appStore.getComponentSize) const componentSize = computed(() => appStore.getComponentSize);
// Listening to page changes and dynamically changing site titles // Listening to page changes and dynamically changing site titles
useTitle() useTitle();
</script> </script>

View File

@ -1,6 +1,7 @@
import { defHttp } from '@/utils/http/axios' import { getRefreshToken } from '@/utils/auth';
import { TentantNameVO } from './model/loginModel' import { defHttp } from '@/utils/http/axios';
import { getRefreshToken } from '@/utils/auth'
import { TentantNameVO } from './model/loginModel';
enum Api { enum Api {
Login = '/system/auth/login', Login = '/system/auth/login',
@ -10,40 +11,40 @@ enum Api {
GetUserInfo = '/system/auth/get-permission-info', GetUserInfo = '/system/auth/get-permission-info',
GetAsyncRoutes = '/system/auth/list-menus', GetAsyncRoutes = '/system/auth/list-menus',
GetCaptcha = '/system/captcha/get', GetCaptcha = '/system/captcha/get',
CheckCaptcha = '/system/captcha/check' CheckCaptcha = '/system/captcha/check',
} }
// 刷新访问令牌 // 刷新访问令牌
export function refreshToken() { export function refreshToken() {
return defHttp.post({ url: Api.RefreshToken + getRefreshToken() }) return defHttp.post({ url: Api.RefreshToken + getRefreshToken() });
} }
// 使用租户名,获得租户编号 // 使用租户名,获得租户编号
export function getTenantIdByName(name: string) { export function getTenantIdByName(name: string) {
return defHttp.get<TentantNameVO>({ url: Api.GetTenantIdByName + name }) return defHttp.get<TentantNameVO>({ url: Api.GetTenantIdByName + name });
} }
// 登出 // 登出
export function loginOut() { export function loginOut() {
return defHttp.delete({ url: Api.LoginOut }) return defHttp.delete({ url: Api.LoginOut });
} }
// 获取用户权限信息 // 获取用户权限信息
export function getUserInfo() { export function getUserInfo() {
return defHttp.get({ url: Api.GetUserInfo }) return defHttp.get({ url: Api.GetUserInfo });
} }
// 路由 // 路由
export function getAsyncRoutes() { export function getAsyncRoutes() {
return defHttp.get({ url: Api.GetAsyncRoutes }) return defHttp.get({ url: Api.GetAsyncRoutes });
} }
// 获取验证图片 以及token // 获取验证图片 以及token
export function getCaptcha(data) { export function getCaptcha(data) {
return defHttp.post({ url: Api.GetCaptcha, data }, { isReturnNativeResponse: true }) return defHttp.post({ url: Api.GetCaptcha, data }, { isReturnNativeResponse: true });
} }
// 滑动或者点选验证 // 滑动或者点选验证
export function checkCaptcha(data) { export function checkCaptcha(data) {
return defHttp.post({ url: Api.CheckCaptcha, data }, { isReturnNativeResponse: true }) return defHttp.post({ url: Api.CheckCaptcha, data }, { isReturnNativeResponse: true });
} }

View File

@ -1,8 +1,9 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
import { getMenuListResultModel } from './model/menuModel'
import { getMenuListResultModel } from './model/menuModel';
enum Api { enum Api {
GetMenuList = '/system/auth/list-menus' GetMenuList = '/system/auth/list-menus',
} }
/** /**
@ -10,5 +11,5 @@ enum Api {
*/ */
export function getMenuList() { export function getMenuList() {
return defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList }) return defHttp.get<getMenuListResultModel>({ url: Api.GetMenuList });
} }

View File

@ -1,9 +1,9 @@
export type UserLoginVO = { export interface UserLoginVO {
username: string username: string;
password: string password: string;
captchaVerification: string captchaVerification: string;
} }
export type TentantNameVO = { export interface TentantNameVO {
id: number id: number;
} }

View File

@ -1,16 +1,17 @@
import type { RouteMeta } from 'vue-router' import type { RouteMeta } from 'vue-router';
export interface RouteItem { export interface RouteItem {
path: string path: string;
component: any component: any;
meta: RouteMeta meta: RouteMeta;
name?: string name?: string;
alias?: string | string[] alias?: string | string[];
redirect?: string redirect?: string;
caseSensitive?: boolean caseSensitive?: boolean;
children?: RouteItem[] children?: RouteItem[];
} }
/** /**
* @description: Get menu return value * @description: Get menu return value
*/ */
export type getMenuListResultModel = RouteItem[] export type getMenuListResultModel = RouteItem[];

View File

@ -1,5 +1,5 @@
export interface UploadApiResult { export interface UploadApiResult {
message: string message: string;
code: number code: number;
url: string url: string;
} }

View File

@ -2,33 +2,33 @@
* @description: Login interface parameters * @description: Login interface parameters
*/ */
export interface LoginParams { export interface LoginParams {
username: string username: string;
password: string password: string;
captchaVerification: string captchaVerification: string;
} }
/** /**
* @description: Login interface return value * @description: Login interface return value
*/ */
export interface LoginResultModel { export interface LoginResultModel {
userId: string | number userId: string | number;
accessToken: string accessToken: string;
refreshToken: string refreshToken: string;
expiresTime: number expiresTime: number;
} }
/** /**
* @description: Get user information return value * @description: Get user information return value
*/ */
export interface GetUserInfoModel { export interface GetUserInfoModel {
roles: string[] roles: string[];
permissions: string[] permissions: string[];
// 用户id // 用户id
user: userModel user: userModel;
} }
export interface userModel { export interface userModel {
id: string | number id: string | number;
avatar: string avatar: string;
nickname: string nickname: string;
} }

View File

@ -1,54 +1,54 @@
import { ContentTypeEnum } from '@/enums/httpEnum' import { ContentTypeEnum } from '@/enums/httpEnum';
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ProfileDept { export interface ProfileDept {
id: number id: number;
name: string name: string;
} }
export interface ProfileRole { export interface ProfileRole {
id: number id: number;
name: string name: string;
} }
export interface ProfilePost { export interface ProfilePost {
id: number id: number;
name: string name: string;
} }
export interface SocialUser { export interface SocialUser {
id: number id: number;
type: number type: number;
openid: string openid: string;
token: string token: string;
rawTokenInfo: string rawTokenInfo: string;
nickname: string nickname: string;
avatar: string avatar: string;
rawUserInfo: string rawUserInfo: string;
code: string code: string;
state: string state: string;
} }
export interface ProfileVO { export interface ProfileVO {
id: number id: number;
username: string username: string;
nickname: string nickname: string;
dept: ProfileDept dept: ProfileDept;
roles: ProfileRole[] roles: ProfileRole[];
posts: ProfilePost[] posts: ProfilePost[];
socialUsers: SocialUser[] socialUsers: SocialUser[];
email: string email: string;
mobile: string mobile: string;
sex: number sex: number;
avatar: string avatar: string;
status: number status: number;
remark: string remark: string;
loginIp: string loginIp: string;
loginDate: Date loginDate: Date;
createTime: Date createTime: Date;
} }
export interface UserProfileUpdateReqVO { export interface UserProfileUpdateReqVO {
nickname: string nickname: string;
email: string email: string;
mobile: string mobile: string;
sex: number sex: number;
} }
enum Api { enum Api {
@ -57,21 +57,21 @@ enum Api {
uploadAvatarApi = '/system/user/profile/update-avatar', uploadAvatarApi = '/system/user/profile/update-avatar',
updateUserPwdApi = '/system/user/profile/update-password', updateUserPwdApi = '/system/user/profile/update-password',
socialBindApi = '/system/social-user/bind', socialBindApi = '/system/social-user/bind',
socialUnbindApi = '/system/social-user/unbind' socialUnbindApi = '/system/social-user/unbind',
} }
/** /**
* @description: getUserProfileApi * @description: getUserProfileApi
*/ */
export function getUserProfileApi() { export function getUserProfileApi() {
return defHttp.get({ url: Api.getUserProfileApi }) return defHttp.get({ url: Api.getUserProfileApi });
} }
/** /**
* @description: updateUserProfileApi * @description: updateUserProfileApi
*/ */
export function updateUserProfileApi(data: UserProfileUpdateReqVO) { export function updateUserProfileApi(data: UserProfileUpdateReqVO) {
return defHttp.put({ url: Api.putUserProfileApi, data }) return defHttp.put({ url: Api.putUserProfileApi, data });
} }
// 用户密码重置 // 用户密码重置
@ -79,10 +79,10 @@ export function updateUserPwdApi(oldPassword: string, newPassword: string) {
return defHttp.put({ return defHttp.put({
url: Api.updateUserPwdApi, url: Api.updateUserPwdApi,
data: { data: {
oldPassword: oldPassword, oldPassword,
newPassword: newPassword newPassword,
} },
}) });
} }
// 用户头像上传 // 用户头像上传
@ -91,11 +91,10 @@ export function uploadAvatarApi(data) {
url: Api.uploadAvatarApi, url: Api.uploadAvatarApi,
headers: { headers: {
'Content-type': ContentTypeEnum.FORM_DATA, 'Content-type': ContentTypeEnum.FORM_DATA,
// @ts-ignore ignoreCancelToken: true,
ignoreCancelToken: true
}, },
data data,
}) });
} }
// 社交绑定,使用 code 授权码 // 社交绑定,使用 code 授权码
@ -105,9 +104,9 @@ export function socialBind(type, code, state) {
data: { data: {
type, type,
code, code,
state state,
} },
}) });
} }
// 取消社交绑定 // 取消社交绑定
@ -116,14 +115,14 @@ export function socialUnbind(type, openid) {
url: Api.socialUnbindApi, url: Api.socialUnbindApi,
data: { data: {
type, type,
openid openid,
} },
}) });
} }
// 社交授权的跳转 // 社交授权的跳转
export function socialAuthRedirect(type, redirectUri) { export function socialAuthRedirect(type, redirectUri) {
return defHttp.get({ return defHttp.get({
url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri url: '/system/auth/social-auth-redirect?type=' + type + '&redirectUri=' + redirectUri,
}) });
} }

View File

@ -1,10 +1,12 @@
import { UploadApiResult } from './model/uploadModel' import { AxiosProgressEvent } from 'axios';
import { defHttp } from '@/utils/http/axios'
import { UploadFileParams } from '@/types/axios'
import { useGlobSetting } from '@/hooks/setting'
import { AxiosProgressEvent } from 'axios'
const { uploadUrl = '' } = useGlobSetting() import { useGlobSetting } from '@/hooks/setting';
import { defHttp } from '@/utils/http/axios';
import { UploadFileParams } from '#/axios';
import { UploadApiResult } from './model/uploadModel';
const { uploadUrl = '' } = useGlobSetting();
/** /**
* @description: Upload interface * @description: Upload interface
@ -13,8 +15,8 @@ export function uploadApi(params: UploadFileParams, onUploadProgress: (progressE
return defHttp.uploadFile<UploadApiResult>( return defHttp.uploadFile<UploadApiResult>(
{ {
url: uploadUrl, url: uploadUrl,
onUploadProgress onUploadProgress,
}, },
params params,
) );
} }

View File

@ -1,12 +1,12 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel' import { ErrorMessageMode } from '#/axios';
import { ErrorMessageMode } from '@/types/axios' import { GetUserInfoModel, LoginParams, LoginResultModel } from './model/userModel';
enum Api { enum Api {
Login = '/system/auth/login', Login = '/system/auth/login',
Logout = '/system/auth/logout', Logout = '/system/auth/logout',
GetUserInfo = '/system/auth/get-permission-info' GetUserInfo = '/system/auth/get-permission-info',
} }
/** /**
@ -16,21 +16,21 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
return defHttp.post<LoginResultModel>( return defHttp.post<LoginResultModel>(
{ {
url: Api.Login, url: Api.Login,
params params,
}, },
{ {
errorMessageMode: mode errorMessageMode: mode,
} },
) );
} }
/** /**
* @description: getUserInfo * @description: getUserInfo
*/ */
export function getUserInfo() { export function getUserInfo() {
return defHttp.get<GetUserInfoModel>({ url: Api.GetUserInfo }, { errorMessageMode: 'none' }) return defHttp.get<GetUserInfoModel>({ url: Api.GetUserInfo }, { errorMessageMode: 'none' });
} }
export function doLogout() { export function doLogout() {
return defHttp.post({ url: Api.Logout }) return defHttp.post({ url: Api.Logout });
} }

View File

@ -1,13 +1,13 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export function getProcessDefinitionPage(params) { export function getProcessDefinitionPage(params) {
return defHttp.get({ url: '/bpm/process-definition/page', params }) return defHttp.get({ url: '/bpm/process-definition/page', params });
} }
export function getProcessDefinitionList(params) { export function getProcessDefinitionList(params) {
return defHttp.get({ url: '/bpm/process-definition/list', params }) return defHttp.get({ url: '/bpm/process-definition/list', params });
} }
export function getProcessDefinitionBpmnXML(id) { export function getProcessDefinitionBpmnXML(id) {
return defHttp.get({ url: '/bpm/process-definition/get-bpmn-xml?id=' + id }) return defHttp.get({ url: '/bpm/process-definition/get-bpmn-xml?id=' + id });
} }

View File

@ -1,41 +1,41 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type FormVO = { export interface FormVO {
id: number id: number;
name: string name: string;
conf: string conf: string;
fields: string[] fields: string[];
status: number status: number;
remark: string remark: string;
createTime: string createTime: string;
} }
// 创建工作流的表单定义 // 创建工作流的表单定义
export function createForm(data: FormVO) { export function createForm(data: FormVO) {
return defHttp.post({ url: '/bpm/form/create', data }) return defHttp.post({ url: '/bpm/form/create', data });
} }
// 更新工作流的表单定义 // 更新工作流的表单定义
export function updateForm(data: FormVO) { export function updateForm(data: FormVO) {
return defHttp.put({ url: '/bpm/form/update', data }) return defHttp.put({ url: '/bpm/form/update', data });
} }
// 删除工作流的表单定义 // 删除工作流的表单定义
export function deleteForm(id: number) { export function deleteForm(id: number) {
return defHttp.delete({ url: '/bpm/form/delete?id=' + id }) return defHttp.delete({ url: '/bpm/form/delete?id=' + id });
} }
// 获得工作流的表单定义 // 获得工作流的表单定义
export function getForm(id: number) { export function getForm(id: number) {
return defHttp.get({ url: '/bpm/form/get?id=' + id }) return defHttp.get({ url: '/bpm/form/get?id=' + id });
} }
// 获得工作流的表单定义分页 // 获得工作流的表单定义分页
export function getFormPage(params) { export function getFormPage(params) {
return defHttp.get({ url: '/bpm/form/page', params }) return defHttp.get({ url: '/bpm/form/page', params });
} }
// 获得动态表单的精简列表 // 获得动态表单的精简列表
export function getSimpleForms() { export function getSimpleForms() {
return defHttp.get({ url: '/bpm/form/list-all-simple' }) return defHttp.get({ url: '/bpm/form/list-all-simple' });
} }

View File

@ -1,27 +1,27 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type LeaveVO = { export interface LeaveVO {
id: number id: number;
result: number result: number;
type: number type: number;
reason: string reason: string;
processInstanceId: string processInstanceId: string;
startTime: string startTime: string;
endTime: string endTime: string;
createTime: string createTime: string;
} }
// 创建请假申请 // 创建请假申请
export function createLeave(data: LeaveVO) { export function createLeave(data: LeaveVO) {
return defHttp.post({ url: '/bpm/oa/leave/create', data }) return defHttp.post({ url: '/bpm/oa/leave/create', data });
} }
// 获得请假申请 // 获得请假申请
export function getLeave(id: number) { export function getLeave(id: number) {
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id }) return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id });
} }
// 获得请假申请分页 // 获得请假申请分页
export function getLeavePage(params) { export function getLeavePage(params) {
return defHttp.get({ url: '/bpm/oa/leave/page', params }) return defHttp.get({ url: '/bpm/oa/leave/page', params });
} }

View File

@ -1,58 +1,58 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type ProcessDefinitionVO = { export interface ProcessDefinitionVO {
id: string id: string;
version: number version: number;
deploymentTIme: string deploymentTIme: string;
suspensionState: number suspensionState: number;
} }
export type ModelVO = { export interface ModelVO {
id: number id: number;
formName: string formName: string;
key: string key: string;
name: string name: string;
description: string description: string;
category: string category: string;
formType: number formType: number;
formId: number formId: number;
formCustomCreatePath: string formCustomCreatePath: string;
formCustomViewPath: string formCustomViewPath: string;
processDefinition: ProcessDefinitionVO processDefinition: ProcessDefinitionVO;
status: number status: number;
remark: string remark: string;
createTime: string createTime: string;
} }
export function getModelPage(params) { export function getModelPage(params) {
return defHttp.get({ url: '/bpm/model/page', params }) return defHttp.get({ url: '/bpm/model/page', params });
} }
export function getModel(id: number) { export function getModel(id: number) {
return defHttp.get({ url: '/bpm/model/get?id=' + id }) return defHttp.get({ url: '/bpm/model/get?id=' + id });
} }
export function updateModel(data: ModelVO) { export function updateModel(data: ModelVO) {
return defHttp.put({ url: '/bpm/model/update', data }) return defHttp.put({ url: '/bpm/model/update', data });
} }
// 任务状态修改 // 任务状态修改
export function updateModelState(id: number, state: number) { export function updateModelState(id: number, state: number) {
const data = { const data = {
id: id, id,
state: state state,
} };
return defHttp.put({ url: '/bpm/model/update-state', data }) return defHttp.put({ url: '/bpm/model/update-state', data });
} }
export function createModel(data: ModelVO) { export function createModel(data: ModelVO) {
return defHttp.post({ url: '/bpm/model/create', data }) return defHttp.post({ url: '/bpm/model/create', data });
} }
export function deleteModel(id: number) { export function deleteModel(id: number) {
return defHttp.delete({ url: '/bpm/model/delete?id=' + id }) return defHttp.delete({ url: '/bpm/model/delete?id=' + id });
} }
export function deployModel(id: number) { export function deployModel(id: number) {
return defHttp.post({ url: '/bpm/model/deploy?id=' + id }) return defHttp.post({ url: '/bpm/model/deploy?id=' + id });
} }

View File

@ -1,40 +1,40 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type task = { export interface task {
id: string id: string;
name: string name: string;
} }
export type ProcessInstanceVO = { export interface ProcessInstanceVO {
id: number id: number;
name: string name: string;
processDefinitionId: string processDefinitionId: string;
category: string category: string;
result: number result: number;
tasks: task[] tasks: task[];
fields: string[] fields: string[];
status: number status: number;
remark: string remark: string;
businessKey: string businessKey: string;
createTime: string createTime: string;
endTime: string endTime: string;
} }
export function getMyProcessInstancePage(params) { export function getMyProcessInstancePage(params) {
return defHttp.get({ url: '/bpm/process-instance/my-page', params }) return defHttp.get({ url: '/bpm/process-instance/my-page', params });
} }
export function createProcessInstance(data: ProcessInstanceVO) { export function createProcessInstance(data: ProcessInstanceVO) {
return defHttp.post({ url: '/bpm/process-instance/create', data }) return defHttp.post({ url: '/bpm/process-instance/create', data });
} }
export function cancelProcessInstance(id: number, reason: string) { export function cancelProcessInstance(id: number, reason: string) {
const data = { const data = {
id: id, id,
reason: reason reason,
} };
return defHttp.delete({ url: '/bpm/process-instance/cancel', data }) return defHttp.delete({ url: '/bpm/process-instance/cancel', data });
} }
export function getProcessInstance(id: number) { export function getProcessInstance(id: number) {
return defHttp.get({ url: '/bpm/process-instance/get?id=' + id }) return defHttp.get({ url: '/bpm/process-instance/get?id=' + id });
} }

View File

@ -1,34 +1,34 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export function getTodoTaskPage(params) { export function getTodoTaskPage(params) {
return defHttp.get({ url: '/bpm/task/todo-page', params }) return defHttp.get({ url: '/bpm/task/todo-page', params });
} }
export function getDoneTaskPage(params) { export function getDoneTaskPage(params) {
return defHttp.get({ url: '/bpm/task/done-page', params }) return defHttp.get({ url: '/bpm/task/done-page', params });
} }
export function completeTask(data) { export function completeTask(data) {
return defHttp.put({ url: '/bpm/task/complete', data }) return defHttp.put({ url: '/bpm/task/complete', data });
} }
export function approveTask(data) { export function approveTask(data) {
return defHttp.put({ url: '/bpm/task/approve', data }) return defHttp.put({ url: '/bpm/task/approve', data });
} }
export function rejectTask(data) { export function rejectTask(data) {
return defHttp.put({ url: '/bpm/task/reject', data }) return defHttp.put({ url: '/bpm/task/reject', data });
} }
export function backTask(data) { export function backTask(data) {
return defHttp.put({ url: '/bpm/task/back', data }) return defHttp.put({ url: '/bpm/task/back', data });
} }
export function updateTaskAssignee(data) { export function updateTaskAssignee(data) {
return defHttp.put({ url: '/bpm/task/update-assignee', data }) return defHttp.put({ url: '/bpm/task/update-assignee', data });
} }
export function getTaskListByProcessInstanceId(processInstanceId) { export function getTaskListByProcessInstanceId(processInstanceId) {
return defHttp.get({ return defHttp.get({
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId,
}) });
} }

View File

@ -1,39 +1,39 @@
export type FormVO = { export interface FormVO {
id: number id: number;
name: string name: string;
conf: string conf: string;
fields: string[] fields: string[];
status: number status: number;
remark: string remark: string;
createTime: string createTime: string;
} }
export type TaskProcessVO = { export interface TaskProcessVO {
id: string id: string;
name: string name: string;
startUserId: number startUserId: number;
startUserNickname: string startUserNickname: string;
processDefinitionId: string processDefinitionId: string;
} }
export type TaskTodoVO = { export interface TaskTodoVO {
id: string id: string;
name: string name: string;
claimTime: string claimTime: string;
createTime: string createTime: string;
suspensionState: number suspensionState: number;
processInstance: TaskProcessVO processInstance: TaskProcessVO;
} }
export type TaskDoneVO = { export interface TaskDoneVO {
id: string id: string;
name: string name: string;
claimTime: string claimTime: string;
createTime: string createTime: string;
endTime: string endTime: string;
durationInMillis: number durationInMillis: number;
suspensionState: number suspensionState: number;
result: number result: number;
reason: string reason: string;
processInstance: TaskProcessVO processInstance: TaskProcessVO;
} }

View File

@ -1,23 +1,23 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type TaskAssignVO = { export interface TaskAssignVO {
id: number id: number;
modelId: string modelId: string;
processDefinitionId: string processDefinitionId: string;
taskDefinitionKey: string taskDefinitionKey: string;
taskDefinitionName: string taskDefinitionName: string;
options: string[] options: string[];
type: number type: number;
} }
export function getTaskAssignRuleList(params) { export function getTaskAssignRuleList(params) {
return defHttp.get({ url: '/bpm/task-assign-rule/list', params }) return defHttp.get({ url: '/bpm/task-assign-rule/list', params });
} }
export function createTaskAssignRule(data: TaskAssignVO) { export function createTaskAssignRule(data: TaskAssignVO) {
return defHttp.post({ url: '/bpm/task-assign-rule/create', data }) return defHttp.post({ url: '/bpm/task-assign-rule/create', data });
} }
export function updateTaskAssignRule(data: TaskAssignVO) { export function updateTaskAssignRule(data: TaskAssignVO) {
return defHttp.put({ url: '/bpm/task-assign-rule/update', data }) return defHttp.put({ url: '/bpm/task-assign-rule/update', data });
} }

View File

@ -1,41 +1,41 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export type UserGroupVO = { export interface UserGroupVO {
id: number id: number;
name: string name: string;
description: string description: string;
memberUserIds: number[] memberUserIds: number[];
status: number status: number;
remark: string remark: string;
createTime: string createTime: string;
} }
// 创建用户组 // 创建用户组
export function createUserGroup(data: UserGroupVO) { export function createUserGroup(data: UserGroupVO) {
return defHttp.post({ url: '/bpm/user-group/create', data }) return defHttp.post({ url: '/bpm/user-group/create', data });
} }
// 更新用户组 // 更新用户组
export function updateUserGroup(data: UserGroupVO) { export function updateUserGroup(data: UserGroupVO) {
return defHttp.put({ url: '/bpm/user-group/update', data }) return defHttp.put({ url: '/bpm/user-group/update', data });
} }
// 删除用户组 // 删除用户组
export function deleteUserGroup(id: number) { export function deleteUserGroup(id: number) {
return defHttp.delete({ url: '/bpm/user-group/delete?id=' + id }) return defHttp.delete({ url: '/bpm/user-group/delete?id=' + id });
} }
// 获得用户组 // 获得用户组
export function getUserGroup(id: number) { export function getUserGroup(id: number) {
return defHttp.get({ url: '/bpm/user-group/get?id=' + id }) return defHttp.get({ url: '/bpm/user-group/get?id=' + id });
} }
// 获得用户组分页 // 获得用户组分页
export function getUserGroupPage(params) { export function getUserGroupPage(params) {
return defHttp.get({ url: '/bpm/user-group/page', params }) return defHttp.get({ url: '/bpm/user-group/page', params });
} }
// 获取用户组精简信息列表 // 获取用户组精简信息列表
export function listSimpleUserGroups() { export function listSimpleUserGroups() {
return defHttp.get({ url: '/bpm/user-group/list-all-simple' }) return defHttp.get({ url: '/bpm/user-group/list-all-simple' });
} }

View File

@ -1,50 +1,50 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ApiAccessLogVO { export interface ApiAccessLogVO {
id: number id: number;
traceId: string traceId: string;
userId: number userId: number;
userType: number userType: number;
applicationName: string applicationName: string;
requestMethod: string requestMethod: string;
requestParams: string requestParams: string;
requestUrl: string requestUrl: string;
userIp: string userIp: string;
userAgent: string userAgent: string;
beginTime: Date beginTime: Date;
endTIme: Date endTIme: Date;
duration: number duration: number;
resultCode: number resultCode: number;
resultMsg: string resultMsg: string;
createTime: Date createTime: Date;
} }
export interface ApiAccessLogPageReqVO extends PageParam { export interface ApiAccessLogPageReqVO extends PageParam {
userId?: number userId?: number;
userType?: number userType?: number;
applicationName?: string applicationName?: string;
requestUrl?: string requestUrl?: string;
beginTime?: Date[] beginTime?: Date[];
duration?: number duration?: number;
resultCode?: number resultCode?: number;
} }
export interface ApiAccessLogExportReqVO { export interface ApiAccessLogExportReqVO {
userId?: number userId?: number;
userType?: number userType?: number;
applicationName?: string applicationName?: string;
requestUrl?: string requestUrl?: string;
beginTime?: Date[] beginTime?: Date[];
duration?: number duration?: number;
resultCode?: number resultCode?: number;
} }
// 查询列表API 访问日志 // 查询列表API 访问日志
export function getApiAccessLogPage(params: ApiAccessLogPageReqVO) { export function getApiAccessLogPage(params: ApiAccessLogPageReqVO) {
return defHttp.get({ url: '/infra/api-access-log/page', params }) return defHttp.get({ url: '/infra/api-access-log/page', params });
} }
// 导出API 访问日志 // 导出API 访问日志
export function exportApiAccessLog(params: ApiAccessLogExportReqVO) { export function exportApiAccessLog(params: ApiAccessLogExportReqVO) {
return defHttp.download({ url: '/infra/api-access-log/export-excel', params }, '访问日志.xls') return defHttp.download({ url: '/infra/api-access-log/export-excel', params }, '访问日志.xls');
} }

View File

@ -1,60 +1,60 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ApiErrorLogVO { export interface ApiErrorLogVO {
id: number id: number;
traceId: string traceId: string;
userId: number userId: number;
userType: number userType: number;
applicationName: string applicationName: string;
requestMethod: string requestMethod: string;
requestParams: string requestParams: string;
requestUrl: string requestUrl: string;
userIp: string userIp: string;
userAgent: string userAgent: string;
exceptionTime: Date exceptionTime: Date;
exceptionName: string exceptionName: string;
exceptionMessage: string exceptionMessage: string;
exceptionRootCauseMessage: string exceptionRootCauseMessage: string;
exceptionStackTrace: string exceptionStackTrace: string;
exceptionClassName: string exceptionClassName: string;
exceptionFileName: string exceptionFileName: string;
exceptionMethodName: string exceptionMethodName: string;
exceptionLineNumber: number exceptionLineNumber: number;
processUserId: number processUserId: number;
processStatus: number processStatus: number;
processTime: Date processTime: Date;
resultCode: number resultCode: number;
createTime: Date createTime: Date;
} }
export interface ApiErrorLogPageReqVO extends PageParam { export interface ApiErrorLogPageReqVO extends PageParam {
userId?: number userId?: number;
userType?: number userType?: number;
applicationName?: string applicationName?: string;
requestUrl?: string requestUrl?: string;
exceptionTime?: Date[] exceptionTime?: Date[];
processStatus: number processStatus: number;
} }
export interface ApiErrorLogExportReqVO { export interface ApiErrorLogExportReqVO {
userId?: number userId?: number;
userType?: number userType?: number;
applicationName?: string applicationName?: string;
requestUrl?: string requestUrl?: string;
exceptionTime?: Date[] exceptionTime?: Date[];
processStatus: number processStatus: number;
} }
// 查询列表API 访问日志 // 查询列表API 访问日志
export function getApiErrorLogPage(params: ApiErrorLogPageReqVO) { export function getApiErrorLogPage(params: ApiErrorLogPageReqVO) {
return defHttp.get({ url: '/infra/api-error-log/page', params }) return defHttp.get({ url: '/infra/api-error-log/page', params });
} }
// 更新 API 错误日志的处理状态 // 更新 API 错误日志的处理状态
export function updateApiErrorLogProcess(id: number, processStatus: number) { export function updateApiErrorLogProcess(id: number, processStatus: number) {
return defHttp.put({ return defHttp.put({
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus,
}) });
} }
// 导出API 错误日志 // 导出API 错误日志
@ -62,8 +62,8 @@ export function exportApiErrorLog(params: ApiErrorLogExportReqVO) {
return defHttp.download( return defHttp.download(
{ {
url: '/infra/api-error-log/export-excel', url: '/infra/api-error-log/export-excel',
params params,
}, },
'错误日志.xls' '错误日志.xls',
) );
} }

View File

@ -1,57 +1,58 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
import type { CodegenCreateListReqVO, CodegenUpdateReqVO } from './types';
// 查询列表代码生成表定义 // 查询列表代码生成表定义
export function getCodegenTablePage(params) { export function getCodegenTablePage(params) {
return defHttp.get({ url: '/infra/codegen/table/page', params }) return defHttp.get({ url: '/infra/codegen/table/page', params });
} }
// 查询详情代码生成表定义 // 查询详情代码生成表定义
export function getCodegenTable(id: number) { export function getCodegenTable(id: number) {
return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id }) return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id });
} }
// 新增代码生成表定义 // 新增代码生成表定义
export function createCodegenTable(data: CodegenCreateListReqVO) { export function createCodegenTable(data: CodegenCreateListReqVO) {
return defHttp.post({ url: '/infra/codegen/create', data }) return defHttp.post({ url: '/infra/codegen/create', data });
} }
// 修改代码生成表定义 // 修改代码生成表定义
export function updateCodegenTable(data: CodegenUpdateReqVO) { export function updateCodegenTable(data: CodegenUpdateReqVO) {
return defHttp.put({ url: '/infra/codegen/update', data }) return defHttp.put({ url: '/infra/codegen/update', data });
} }
// 基于数据库的表结构,同步数据库的表和字段定义 // 基于数据库的表结构,同步数据库的表和字段定义
export function syncCodegenFromDB(id: number) { export function syncCodegenFromDB(id: number) {
return defHttp.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) return defHttp.put({ url: '/infra/codegen/sync-from-db?tableId=' + id });
} }
// 基于 SQL 建表语句,同步数据库的表和字段定义 // 基于 SQL 建表语句,同步数据库的表和字段定义
export function syncCodegenFromSQL(id: number, sql: string) { export function syncCodegenFromSQL(id: number, sql: string) {
return defHttp.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql }) return defHttp.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql });
} }
// 预览生成代码 // 预览生成代码
export function previewCodegen(id: number) { export function previewCodegen(id: number) {
return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id }) return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id });
} }
// 下载生成代码 // 下载生成代码
export function downloadCodegen(data) { export function downloadCodegen(data) {
return defHttp.download({ url: '/infra/codegen/download?tableId=' + data.id }, data.tableName + '.zip') return defHttp.download({ url: '/infra/codegen/download?tableId=' + data.id }, data.tableName + '.zip');
} }
// 获得表定义 // 获得表定义
export function getSchemaTableList(params) { export function getSchemaTableList(params) {
return defHttp.get({ url: '/infra/codegen/db/table/list', params }) return defHttp.get({ url: '/infra/codegen/db/table/list', params });
} }
// 基于数据库的表结构,创建代码生成器的表定义 // 基于数据库的表结构,创建代码生成器的表定义
export function createCodegenList(data) { export function createCodegenList(data) {
return defHttp.post({ url: '/infra/codegen/create-list', data }) return defHttp.post({ url: '/infra/codegen/create-list', data });
} }
// 删除代码生成表定义 // 删除代码生成表定义
export function deleteCodegenTable(id: number) { export function deleteCodegenTable(id: number) {
return defHttp.delete({ url: '/infra/codegen/delete?tableId=' + id }) return defHttp.delete({ url: '/infra/codegen/delete?tableId=' + id });
} }

View File

@ -1,61 +1,61 @@
export type CodegenTableVO = { export interface CodegenTableVO {
id: number id: number;
tableId: number tableId: number;
isParentMenuIdValid: boolean isParentMenuIdValid: boolean;
dataSourceConfigId: number dataSourceConfigId: number;
scene: number scene: number;
tableName: string tableName: string;
tableComment: string tableComment: string;
remark: string remark: string;
moduleName: string moduleName: string;
businessName: string businessName: string;
className: string className: string;
classComment: string classComment: string;
author: string author: string;
createTime: Date createTime: Date;
updateTime: Date updateTime: Date;
templateType: number templateType: number;
parentMenuId: number parentMenuId: number;
} }
export type CodegenColumnVO = { export interface CodegenColumnVO {
id: number id: number;
tableId: number tableId: number;
columnName: string columnName: string;
dataType: string dataType: string;
columnComment: string columnComment: string;
nullable: number nullable: number;
primaryKey: number primaryKey: number;
autoIncrement: string autoIncrement: string;
ordinalPosition: number ordinalPosition: number;
javaType: string javaType: string;
javaField: string javaField: string;
dictType: string dictType: string;
example: string example: string;
createOperation: number createOperation: number;
updateOperation: number updateOperation: number;
listOperation: number listOperation: number;
listOperationCondition: string listOperationCondition: string;
listOperationResult: number listOperationResult: number;
htmlType: string htmlType: string;
} }
export type DatabaseTableVO = { export interface DatabaseTableVO {
name: string name: string;
comment: string comment: string;
} }
export type CodegenDetailVO = { export interface CodegenDetailVO {
table: CodegenTableVO table: CodegenTableVO;
columns: CodegenColumnVO[] columns: CodegenColumnVO[];
} }
export type CodegenPreviewVO = { export interface CodegenPreviewVO {
filePath: string filePath: string;
code: string code: string;
} }
export type CodegenUpdateReqVO = { export interface CodegenUpdateReqVO {
table: CodegenTableVO table: CodegenTableVO;
columns: CodegenColumnVO[] columns: CodegenColumnVO[];
} }
export type CodegenCreateListReqVO = { export interface CodegenCreateListReqVO {
dataSourceConfigId: number dataSourceConfigId: number;
tableNames: string[] tableNames: string[];
} }

View File

@ -1,62 +1,62 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ConfigVO { export interface ConfigVO {
id: number id: number;
category: string category: string;
name: string name: string;
key: string key: string;
value: string value: string;
type: number type: number;
visible: boolean visible: boolean;
remark: string remark: string;
createTime: Date createTime: Date;
} }
export interface ConfigPageReqVO extends PageParam { export interface ConfigPageReqVO extends PageParam {
name?: string name?: string;
key?: string key?: string;
type?: number type?: number;
createTime?: Date[] createTime?: Date[];
} }
export interface ConfigExportReqVO { export interface ConfigExportReqVO {
name?: string name?: string;
key?: string key?: string;
type?: number type?: number;
createTime?: Date[] createTime?: Date[];
} }
// 查询参数列表 // 查询参数列表
export function getConfigPage(params: ConfigPageReqVO) { export function getConfigPage(params: ConfigPageReqVO) {
return defHttp.get({ url: '/infra/config/page', params }) return defHttp.get({ url: '/infra/config/page', params });
} }
// 查询参数详情 // 查询参数详情
export function getConfig(id: number) { export function getConfig(id: number) {
return defHttp.get({ url: '/infra/config/get?id=' + id }) return defHttp.get({ url: '/infra/config/get?id=' + id });
} }
// 根据参数键名查询参数值 // 根据参数键名查询参数值
export function getConfigKey(configKey: string) { export function getConfigKey(configKey: string) {
return defHttp.get({ url: '/infra/config/get-value-by-key?key=' + configKey }) return defHttp.get({ url: '/infra/config/get-value-by-key?key=' + configKey });
} }
// 新增参数 // 新增参数
export function createConfig(data: ConfigVO) { export function createConfig(data: ConfigVO) {
return defHttp.post({ url: '/infra/config/create', data }) return defHttp.post({ url: '/infra/config/create', data });
} }
// 修改参数 // 修改参数
export function updateConfig(data: ConfigVO) { export function updateConfig(data: ConfigVO) {
return defHttp.put({ url: '/infra/config/update', data }) return defHttp.put({ url: '/infra/config/update', data });
} }
// 删除参数 // 删除参数
export function deleteConfig(id: number) { export function deleteConfig(id: number) {
return defHttp.delete({ url: '/infra/config/delete?id=' + id }) return defHttp.delete({ url: '/infra/config/delete?id=' + id });
} }
// 导出参数 // 导出参数
export function exportConfig(params: ConfigExportReqVO) { export function exportConfig(params: ConfigExportReqVO) {
return defHttp.download({ url: '/infra/config/export', params }, '参数.xls') return defHttp.download({ url: '/infra/config/export', params }, '参数.xls');
} }

View File

@ -1,35 +1,35 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface DataSourceConfigVO { export interface DataSourceConfigVO {
id: number id: number;
name: string name: string;
url: string url: string;
username: string username: string;
password: string password: string;
createTime: Date createTime: Date;
} }
// 查询数据源配置列表 // 查询数据源配置列表
export function getDataSourceConfigList() { export function getDataSourceConfigList() {
return defHttp.get({ url: '/infra/data-source-config/list' }) return defHttp.get({ url: '/infra/data-source-config/list' });
} }
// 查询数据源配置详情 // 查询数据源配置详情
export function getDataSourceConfig(id: number) { export function getDataSourceConfig(id: number) {
return defHttp.get({ url: '/infra/data-source-config/get?id=' + id }) return defHttp.get({ url: '/infra/data-source-config/get?id=' + id });
} }
// 新增数据源配置 // 新增数据源配置
export function createDataSourceConfig(data: DataSourceConfigVO) { export function createDataSourceConfig(data: DataSourceConfigVO) {
return defHttp.post({ url: '/infra/data-source-config/create', data }) return defHttp.post({ url: '/infra/data-source-config/create', data });
} }
// 修改数据源配置 // 修改数据源配置
export function updateDataSourceConfig(data: DataSourceConfigVO) { export function updateDataSourceConfig(data: DataSourceConfigVO) {
return defHttp.put({ url: '/infra/data-source-config/update', data }) return defHttp.put({ url: '/infra/data-source-config/update', data });
} }
// 删除数据源配置 // 删除数据源配置
export function deleteDataSourceConfig(id: number) { export function deleteDataSourceConfig(id: number) {
return defHttp.delete({ url: '/infra/data-source-config/delete?id=' + id }) return defHttp.delete({ url: '/infra/data-source-config/delete?id=' + id });
} }

View File

@ -1,16 +1,16 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 导出Html // 导出Html
export function exportHtml() { export function exportHtml() {
return defHttp.get({ url: '/infra/db-doc/export-html', responseType: 'blob' }) return defHttp.get({ url: '/infra/db-doc/export-html', responseType: 'blob' });
} }
// 导出Word // 导出Word
export function exportWord() { export function exportWord() {
return defHttp.get({ url: '/infra/db-doc/export-word', responseType: 'blob' }) return defHttp.get({ url: '/infra/db-doc/export-word', responseType: 'blob' });
} }
// 导出Markdown // 导出Markdown
export function exportMarkdown() { export function exportMarkdown() {
return defHttp.get({ url: '/infra/db-doc/export-markdown', responseType: 'blob' }) return defHttp.get({ url: '/infra/db-doc/export-markdown', responseType: 'blob' });
} }

View File

@ -1,28 +1,28 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface FileVO { export interface FileVO {
id: number id: number;
configId: number configId: number;
path: string path: string;
name: string name: string;
url: string url: string;
size: string size: string;
type: string type: string;
createTime: Date createTime: Date;
} }
export interface FilePageReqVO extends PageParam { export interface FilePageReqVO extends PageParam {
path?: string path?: string;
type?: string type?: string;
createTime?: Date[] createTime?: Date[];
} }
// 查询文件列表 // 查询文件列表
export function getFilePage(params: FilePageReqVO) { export function getFilePage(params: FilePageReqVO) {
return defHttp.get({ url: '/infra/file/page', params }) return defHttp.get({ url: '/infra/file/page', params });
} }
// 删除文件 // 删除文件
export function deleteFile(id: number) { export function deleteFile(id: number) {
return defHttp.delete({ url: '/infra/file/delete?id=' + id }) return defHttp.delete({ url: '/infra/file/delete?id=' + id });
} }

View File

@ -1,66 +1,66 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface FileClientConfig { export interface FileClientConfig {
basePath: string basePath: string;
host?: string host?: string;
port?: number port?: number;
username?: string username?: string;
password?: string password?: string;
mode?: string mode?: string;
endpoint?: string endpoint?: string;
bucket?: string bucket?: string;
accessKey?: string accessKey?: string;
accessSecret?: string accessSecret?: string;
domain: string domain: string;
} }
export interface FileConfigVO { export interface FileConfigVO {
id: number id: number;
name: string name: string;
storage: number storage: number;
master: boolean master: boolean;
visible: boolean visible: boolean;
config: FileClientConfig config: FileClientConfig;
remark: string remark: string;
createTime: Date createTime: Date;
} }
export interface FileConfigPageReqVO extends PageParam { export interface FileConfigPageReqVO extends PageParam {
name?: string name?: string;
storage?: number storage?: number;
createTime?: Date[] createTime?: Date[];
} }
// 查询文件配置列表 // 查询文件配置列表
export function getFileConfigPage(params: FileConfigPageReqVO) { export function getFileConfigPage(params: FileConfigPageReqVO) {
return defHttp.get({ url: '/infra/file-config/page', params }) return defHttp.get({ url: '/infra/file-config/page', params });
} }
// 查询文件配置详情 // 查询文件配置详情
export function getFileConfig(id: number) { export function getFileConfig(id: number) {
return defHttp.get({ url: '/infra/file-config/get?id=' + id }) return defHttp.get({ url: '/infra/file-config/get?id=' + id });
} }
// 更新文件配置为主配置 // 更新文件配置为主配置
export function updateFileConfigMaster(id: number) { export function updateFileConfigMaster(id: number) {
return defHttp.put({ url: '/infra/file-config/update-master?id=' + id }) return defHttp.put({ url: '/infra/file-config/update-master?id=' + id });
} }
// 新增文件配置 // 新增文件配置
export function createFileConfig(data: FileConfigVO) { export function createFileConfig(data: FileConfigVO) {
return defHttp.post({ url: '/infra/file-config/create', data }) return defHttp.post({ url: '/infra/file-config/create', data });
} }
// 修改文件配置 // 修改文件配置
export function updateFileConfig(data: FileConfigVO) { export function updateFileConfig(data: FileConfigVO) {
return defHttp.put({ url: '/infra/file-config/update', data }) return defHttp.put({ url: '/infra/file-config/update', data });
} }
// 删除文件配置 // 删除文件配置
export function deleteFileConfig(id: number) { export function deleteFileConfig(id: number) {
return defHttp.delete({ url: '/infra/file-config/delete?id=' + id }) return defHttp.delete({ url: '/infra/file-config/delete?id=' + id });
} }
// 测试文件配置 // 测试文件配置
export function testFileConfig(id: number) { export function testFileConfig(id: number) {
return defHttp.get({ url: '/infra/file-config/test?id=' + id }) return defHttp.get({ url: '/infra/file-config/test?id=' + id });
} }

View File

@ -1,75 +1,75 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface JobVO { export interface JobVO {
id: number id: number;
name: string name: string;
status: number status: number;
handlerName: string handlerName: string;
handlerParam: string handlerParam: string;
cronExpression: string cronExpression: string;
retryCount: number retryCount: number;
retryInterval: number retryInterval: number;
monitorTimeout: number monitorTimeout: number;
createTime: Date createTime: Date;
} }
export interface JobPageReqVO extends PageParam { export interface JobPageReqVO extends PageParam {
name?: string name?: string;
status?: number status?: number;
handlerName?: string handlerName?: string;
} }
export interface JobExportReqVO { export interface JobExportReqVO {
name?: string name?: string;
status?: number status?: number;
handlerName?: string handlerName?: string;
} }
// 任务列表 // 任务列表
export function getJobPage(params: JobPageReqVO) { export function getJobPage(params: JobPageReqVO) {
return defHttp.get({ url: '/infra/job/page', params }) return defHttp.get({ url: '/infra/job/page', params });
} }
// 任务详情 // 任务详情
export function getJob(id: number) { export function getJob(id: number) {
return defHttp.get({ url: '/infra/job/get?id=' + id }) return defHttp.get({ url: '/infra/job/get?id=' + id });
} }
// 新增任务 // 新增任务
export function createJob(data: JobVO) { export function createJob(data: JobVO) {
return defHttp.post({ url: '/infra/job/create', data }) return defHttp.post({ url: '/infra/job/create', data });
} }
// 修改定时任务调度 // 修改定时任务调度
export function updateJob(data: JobVO) { export function updateJob(data: JobVO) {
return defHttp.put({ url: '/infra/job/update', data }) return defHttp.put({ url: '/infra/job/update', data });
} }
// 删除定时任务调度 // 删除定时任务调度
export function deleteJob(id: number) { export function deleteJob(id: number) {
return defHttp.delete({ url: '/infra/job/delete?id=' + id }) return defHttp.delete({ url: '/infra/job/delete?id=' + id });
} }
// 导出定时任务调度 // 导出定时任务调度
export function exportJob(params: JobExportReqVO) { export function exportJob(params: JobExportReqVO) {
return defHttp.download({ url: '/infra/job/export-excel', params }, '定时任务.xls') return defHttp.download({ url: '/infra/job/export-excel', params }, '定时任务.xls');
} }
// 任务状态修改 // 任务状态修改
export function updateJobStatus(id: number, status: number) { export function updateJobStatus(id: number, status: number) {
const params = { const params = {
id, id,
status status,
} };
return defHttp.put({ url: '/infra/job/update-status', params }) return defHttp.put({ url: '/infra/job/update-status', params });
} }
// 定时任务立即执行一次 // 定时任务立即执行一次
export function runJob(id: number) { export function runJob(id: number) {
return defHttp.put({ url: '/infra/job/trigger?id=' + id }) return defHttp.put({ url: '/infra/job/trigger?id=' + id });
} }
// 获得定时任务的下 n 次执行时间 // 获得定时任务的下 n 次执行时间
export function getJobNextTimes(id: number) { export function getJobNextTimes(id: number) {
return defHttp.get({ url: '/infra/job/get_next_times?id=' + id }) return defHttp.get({ url: '/infra/job/get_next_times?id=' + id });
} }

View File

@ -1,46 +1,46 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface JobLogVO { export interface JobLogVO {
id: number id: number;
jobId: number jobId: number;
handlerName: string handlerName: string;
handlerParam: string handlerParam: string;
cronExpression: string cronExpression: string;
executeIndex: string executeIndex: string;
beginTime: string beginTime: string;
endTime: string endTime: string;
duration: string duration: string;
status: number status: number;
createTime: string createTime: string;
} }
export interface JobLogPageReqVO extends PageParam { export interface JobLogPageReqVO extends PageParam {
jobId?: number jobId?: number;
handlerName?: string handlerName?: string;
beginTime?: string beginTime?: string;
endTime?: string endTime?: string;
status?: number status?: number;
} }
export interface JobLogExportReqVO { export interface JobLogExportReqVO {
jobId?: number jobId?: number;
handlerName?: string handlerName?: string;
beginTime?: string beginTime?: string;
endTime?: string endTime?: string;
status?: number status?: number;
} }
// 任务日志列表 // 任务日志列表
export function getJobLogPage(params: JobLogPageReqVO) { export function getJobLogPage(params: JobLogPageReqVO) {
return defHttp.get({ url: '/infra/job-log/page', params }) return defHttp.get({ url: '/infra/job-log/page', params });
} }
// 任务日志详情 // 任务日志详情
export function getJobLog(id: number) { export function getJobLog(id: number) {
return defHttp.get({ url: '/infra/job-log/get?id=' + id }) return defHttp.get({ url: '/infra/job-log/get?id=' + id });
} }
// 导出定时任务日志 // 导出定时任务日志
export function exportJobLog(params: JobLogExportReqVO) { export function exportJobLog(params: JobLogExportReqVO) {
return defHttp.download({ url: '/infra/job-log/export-excel', params }, '定时任务日志.xls') return defHttp.download({ url: '/infra/job-log/export-excel', params }, '定时任务日志.xls');
} }

View File

@ -1,14 +1,14 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
/** /**
* redis * redis
*/ */
export function getCache() { export function getCache() {
return defHttp.get({ url: '/infra/redis/get-monitor-info' }) return defHttp.get({ url: '/infra/redis/get-monitor-info' });
} }
// 获取模块 // 获取模块
export function getKeyDefineList() { export function getKeyDefineList() {
return defHttp.get({ url: '/infra/redis/get-key-define-list' }) return defHttp.get({ url: '/infra/redis/get-key-define-list' });
} }
/** /**
* redis key * redis key
@ -17,25 +17,25 @@ export function getKeyList(keyTemplate: string) {
return defHttp.get({ return defHttp.get({
url: '/infra/redis/get-key-list', url: '/infra/redis/get-key-list',
params: { params: {
keyTemplate keyTemplate,
} },
}) });
} }
// 获取缓存内容 // 获取缓存内容
export function getKeyValue(key: string) { export function getKeyValue(key: string) {
return defHttp.get({ url: '/infra/redis/get-key-value?key=' + key }) return defHttp.get({ url: '/infra/redis/get-key-value?key=' + key });
} }
// 根据键名删除缓存 // 根据键名删除缓存
export function deleteKey(key: string) { export function deleteKey(key: string) {
return defHttp.delete({ url: '/infra/redis/delete-key?key=' + key }) return defHttp.delete({ url: '/infra/redis/delete-key?key=' + key });
} }
export function deleteKeys(keyTemplate: string) { export function deleteKeys(keyTemplate: string) {
return defHttp.delete({ return defHttp.delete({
url: '/infra/redis/delete-keys?', url: '/infra/redis/delete-keys?',
params: { params: {
keyTemplate keyTemplate,
} },
}) });
} }

View File

@ -1,185 +1,185 @@
export interface RedisMonitorInfoVO { export interface RedisMonitorInfoVO {
info: RedisInfoVO info: RedisInfoVO;
dbSize: number dbSize: number;
commandStats: RedisCommandStatsVO[] commandStats: RedisCommandStatsVO[];
} }
export interface RedisInfoVO { export interface RedisInfoVO {
io_threaded_reads_processed: string io_threaded_reads_processed: string;
tracking_clients: string tracking_clients: string;
uptime_in_seconds: string uptime_in_seconds: string;
cluster_connections: string cluster_connections: string;
current_cow_size: string current_cow_size: string;
maxmemory_human: string maxmemory_human: string;
aof_last_cow_size: string aof_last_cow_size: string;
master_replid2: string master_replid2: string;
mem_replication_backlog: string mem_replication_backlog: string;
aof_rewrite_scheduled: string aof_rewrite_scheduled: string;
total_net_input_bytes: string total_net_input_bytes: string;
rss_overhead_ratio: string rss_overhead_ratio: string;
hz: string hz: string;
current_cow_size_age: string current_cow_size_age: string;
redis_build_id: string redis_build_id: string;
errorstat_BUSYGROUP: string errorstat_BUSYGROUP: string;
aof_last_bgrewrite_status: string aof_last_bgrewrite_status: string;
multiplexing_api: string multiplexing_api: string;
client_recent_max_output_buffer: string client_recent_max_output_buffer: string;
allocator_resident: string allocator_resident: string;
mem_fragmentation_bytes: string mem_fragmentation_bytes: string;
aof_current_size: string aof_current_size: string;
repl_backlog_first_byte_offset: string repl_backlog_first_byte_offset: string;
tracking_total_prefixes: string tracking_total_prefixes: string;
redis_mode: string redis_mode: string;
redis_git_dirty: string redis_git_dirty: string;
aof_delayed_fsync: string aof_delayed_fsync: string;
allocator_rss_bytes: string allocator_rss_bytes: string;
repl_backlog_histlen: string repl_backlog_histlen: string;
io_threads_active: string io_threads_active: string;
rss_overhead_bytes: string rss_overhead_bytes: string;
total_system_memory: string total_system_memory: string;
loading: string loading: string;
evicted_keys: string evicted_keys: string;
maxclients: string maxclients: string;
cluster_enabled: string cluster_enabled: string;
redis_version: string redis_version: string;
repl_backlog_active: string repl_backlog_active: string;
mem_aof_buffer: string mem_aof_buffer: string;
allocator_frag_bytes: string allocator_frag_bytes: string;
io_threaded_writes_processed: string io_threaded_writes_processed: string;
instantaneous_ops_per_sec: string instantaneous_ops_per_sec: string;
used_memory_human: string used_memory_human: string;
total_error_replies: string total_error_replies: string;
role: string role: string;
maxmemory: string maxmemory: string;
used_memory_lua: string used_memory_lua: string;
rdb_current_bgsave_time_sec: string rdb_current_bgsave_time_sec: string;
used_memory_startup: string used_memory_startup: string;
used_cpu_sys_main_thread: string used_cpu_sys_main_thread: string;
lazyfree_pending_objects: string lazyfree_pending_objects: string;
aof_pending_bio_fsync: string aof_pending_bio_fsync: string;
used_memory_dataset_perc: string used_memory_dataset_perc: string;
allocator_frag_ratio: string allocator_frag_ratio: string;
arch_bits: string arch_bits: string;
used_cpu_user_main_thread: string used_cpu_user_main_thread: string;
mem_clients_normal: string mem_clients_normal: string;
expired_time_cap_reached_count: string expired_time_cap_reached_count: string;
unexpected_error_replies: string unexpected_error_replies: string;
mem_fragmentation_ratio: string mem_fragmentation_ratio: string;
aof_last_rewrite_time_sec: string aof_last_rewrite_time_sec: string;
master_replid: string master_replid: string;
aof_rewrite_in_progress: string aof_rewrite_in_progress: string;
lru_clock: string lru_clock: string;
maxmemory_policy: string maxmemory_policy: string;
run_id: string run_id: string;
latest_fork_usec: string latest_fork_usec: string;
tracking_total_items: string tracking_total_items: string;
total_commands_processed: string total_commands_processed: string;
expired_keys: string expired_keys: string;
errorstat_ERR: string errorstat_ERR: string;
used_memory: string used_memory: string;
module_fork_in_progress: string module_fork_in_progress: string;
errorstat_WRONGPASS: string errorstat_WRONGPASS: string;
aof_buffer_length: string aof_buffer_length: string;
dump_payload_sanitizations: string dump_payload_sanitizations: string;
mem_clients_slaves: string mem_clients_slaves: string;
keyspace_misses: string keyspace_misses: string;
server_time_usec: string server_time_usec: string;
executable: string executable: string;
lazyfreed_objects: string lazyfreed_objects: string;
db0: string db0: string;
used_memory_peak_human: string used_memory_peak_human: string;
keyspace_hits: string keyspace_hits: string;
rdb_last_cow_size: string rdb_last_cow_size: string;
aof_pending_rewrite: string aof_pending_rewrite: string;
used_memory_overhead: string used_memory_overhead: string;
active_defrag_hits: string active_defrag_hits: string;
tcp_port: string tcp_port: string;
uptime_in_days: string uptime_in_days: string;
used_memory_peak_perc: string used_memory_peak_perc: string;
current_save_keys_processed: string current_save_keys_processed: string;
blocked_clients: string blocked_clients: string;
total_reads_processed: string total_reads_processed: string;
expire_cycle_cpu_milliseconds: string expire_cycle_cpu_milliseconds: string;
sync_partial_err: string sync_partial_err: string;
used_memory_scripts_human: string used_memory_scripts_human: string;
aof_current_rewrite_time_sec: string aof_current_rewrite_time_sec: string;
aof_enabled: string aof_enabled: string;
process_supervised: string process_supervised: string;
master_repl_offset: string master_repl_offset: string;
used_memory_dataset: string used_memory_dataset: string;
used_cpu_user: string used_cpu_user: string;
rdb_last_bgsave_status: string rdb_last_bgsave_status: string;
tracking_total_keys: string tracking_total_keys: string;
atomicvar_api: string atomicvar_api: string;
allocator_rss_ratio: string allocator_rss_ratio: string;
client_recent_max_input_buffer: string client_recent_max_input_buffer: string;
clients_in_timeout_table: string clients_in_timeout_table: string;
aof_last_write_status: string aof_last_write_status: string;
mem_allocator: string mem_allocator: string;
used_memory_scripts: string used_memory_scripts: string;
used_memory_peak: string used_memory_peak: string;
process_id: string process_id: string;
master_failover_state: string master_failover_state: string;
errorstat_NOAUTH: string errorstat_NOAUTH: string;
used_cpu_sys: string used_cpu_sys: string;
repl_backlog_size: string repl_backlog_size: string;
connected_slaves: string connected_slaves: string;
current_save_keys_total: string current_save_keys_total: string;
gcc_version: string gcc_version: string;
total_system_memory_human: string total_system_memory_human: string;
sync_full: string sync_full: string;
connected_clients: string connected_clients: string;
module_fork_last_cow_size: string module_fork_last_cow_size: string;
total_writes_processed: string total_writes_processed: string;
allocator_active: string allocator_active: string;
total_net_output_bytes: string total_net_output_bytes: string;
pubsub_channels: string pubsub_channels: string;
current_fork_perc: string current_fork_perc: string;
active_defrag_key_hits: string active_defrag_key_hits: string;
rdb_changes_since_last_save: string rdb_changes_since_last_save: string;
instantaneous_input_kbps: string instantaneous_input_kbps: string;
used_memory_rss_human: string used_memory_rss_human: string;
configured_hz: string configured_hz: string;
expired_stale_perc: string expired_stale_perc: string;
active_defrag_misses: string active_defrag_misses: string;
used_cpu_sys_children: string used_cpu_sys_children: string;
number_of_cached_scripts: string number_of_cached_scripts: string;
sync_partial_ok: string sync_partial_ok: string;
used_memory_lua_human: string used_memory_lua_human: string;
rdb_last_save_time: string rdb_last_save_time: string;
pubsub_patterns: string pubsub_patterns: string;
slave_expires_tracked_keys: string slave_expires_tracked_keys: string;
redis_git_sha1: string redis_git_sha1: string;
used_memory_rss: string used_memory_rss: string;
rdb_last_bgsave_time_sec: string rdb_last_bgsave_time_sec: string;
os: string os: string;
mem_not_counted_for_evict: string mem_not_counted_for_evict: string;
active_defrag_running: string active_defrag_running: string;
rejected_connections: string rejected_connections: string;
aof_rewrite_buffer_length: string aof_rewrite_buffer_length: string;
total_forks: string total_forks: string;
active_defrag_key_misses: string active_defrag_key_misses: string;
allocator_allocated: string allocator_allocated: string;
aof_base_size: string aof_base_size: string;
instantaneous_output_kbps: string instantaneous_output_kbps: string;
second_repl_offset: string second_repl_offset: string;
rdb_bgsave_in_progress: string rdb_bgsave_in_progress: string;
used_cpu_user_children: string used_cpu_user_children: string;
total_connections_received: string total_connections_received: string;
migrate_cached_sockets: string migrate_cached_sockets: string;
} }
export interface RedisCommandStatsVO { export interface RedisCommandStatsVO {
command: string command: string;
calls: number calls: number;
usec: number usec: number;
} }
export interface RedisKeyInfo { export interface RedisKeyInfo {
keyTemplate: string keyTemplate: string;
keyType: string keyType: string;
valueType: string valueType: string;
timeoutType: number timeoutType: number;
timeout: number timeout: number;
memo: string memo: string;
} }

View File

@ -1,46 +1,46 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface AccountVO { export interface AccountVO {
id?: number id?: number;
name: string name: string;
} }
// 创建公众号账号 // 创建公众号账号
export function createAccount(data) { export function createAccount(data) {
return defHttp.post({ url: '/mp/account/create', data }) return defHttp.post({ url: '/mp/account/create', data });
} }
// 更新公众号账号 // 更新公众号账号
export function updateAccount(data) { export function updateAccount(data) {
return defHttp.put({ url: '/mp/account/update', data }) return defHttp.put({ url: '/mp/account/update', data });
} }
// 删除公众号账号 // 删除公众号账号
export function deleteAccount(id) { export function deleteAccount(id) {
return defHttp.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' }) return defHttp.delete({ url: '/mp/account/delete?id=' + id, method: 'delete' });
} }
// 获得公众号账号 // 获得公众号账号
export function getAccount(id) { export function getAccount(id) {
return defHttp.get({ url: '/mp/account/get?id=' + id }) return defHttp.get({ url: '/mp/account/get?id=' + id });
} }
// 获得公众号账号分页 // 获得公众号账号分页
export function getAccountPage(params) { export function getAccountPage(params) {
return defHttp.get({ url: '/mp/account/page', params }) return defHttp.get({ url: '/mp/account/page', params });
} }
// 获取公众号账号精简信息列表 // 获取公众号账号精简信息列表
export function getSimpleAccounts() { export function getSimpleAccounts() {
return defHttp.get({ url: '/mp/account/list-all-simple' }) return defHttp.get({ url: '/mp/account/list-all-simple' });
} }
// 生成公众号二维码 // 生成公众号二维码
export function generateAccountQrCode(id) { export function generateAccountQrCode(id) {
return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id }) return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id });
} }
// 清空公众号 API 配额 // 清空公众号 API 配额
export function clearAccountQuota(id) { export function clearAccountQuota(id) {
return defHttp.put({ url: '/mp/account/clear-quota?id=' + id }) return defHttp.put({ url: '/mp/account/clear-quota?id=' + id });
} }

View File

@ -1,26 +1,26 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 创建公众号的自动回复 // 创建公众号的自动回复
export function createAutoReply(data) { export function createAutoReply(data) {
return defHttp.post({ url: '/mp/auto-reply/create', data }) return defHttp.post({ url: '/mp/auto-reply/create', data });
} }
// 更新公众号的自动回复 // 更新公众号的自动回复
export function updateAutoReply(data) { export function updateAutoReply(data) {
return defHttp.put({ url: '/mp/auto-reply/update', data }) return defHttp.put({ url: '/mp/auto-reply/update', data });
} }
// 删除公众号的自动回复 // 删除公众号的自动回复
export function deleteAutoReply(id) { export function deleteAutoReply(id) {
return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + id }) return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + id });
} }
// 获得公众号的自动回复 // 获得公众号的自动回复
export function getAutoReply(id) { export function getAutoReply(id) {
return defHttp.get({ url: '/mp/auto-reply/get?id=' + id }) return defHttp.get({ url: '/mp/auto-reply/get?id=' + id });
} }
// 获得公众号的自动回复分页 // 获得公众号的自动回复分页
export function getAutoReplyPage(params) { export function getAutoReplyPage(params) {
return defHttp.get({ url: '/mp/auto-reply/page', params }) return defHttp.get({ url: '/mp/auto-reply/page', params });
} }

View File

@ -1,8 +1,8 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得公众号草稿分页 // 获得公众号草稿分页
export function getDraftPage(params) { export function getDraftPage(params) {
return defHttp.get({ url: '/mp/draft/page', params }) return defHttp.get({ url: '/mp/draft/page', params });
} }
// 创建公众号草稿 // 创建公众号草稿
@ -10,17 +10,17 @@ export function createDraft(accountId, articles) {
return defHttp.post({ return defHttp.post({
url: '/mp/draft/create?accountId=' + accountId, url: '/mp/draft/create?accountId=' + accountId,
data: { data: {
articles articles,
} },
}) });
} }
// 更新公众号草稿 // 更新公众号草稿
export function updateDraft(accountId, mediaId, articles) { export function updateDraft(accountId, mediaId, articles) {
return defHttp.put({ url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId, data: articles }) return defHttp.put({ url: '/mp/draft/update?accountId=' + accountId + '&mediaId=' + mediaId, data: articles });
} }
// 删除公众号草稿 // 删除公众号草稿
export function deleteDraft(accountId, mediaId) { export function deleteDraft(accountId, mediaId) {
return defHttp.delete({ url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId }) return defHttp.delete({ url: '/mp/draft/delete?accountId=' + accountId + '&mediaId=' + mediaId });
} }

View File

@ -1,16 +1,16 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得公众号素材分页 // 获得公众号素材分页
export function getFreePublishPage(params) { export function getFreePublishPage(params) {
return defHttp.get({ url: '/mp/free-publish/page', params }) return defHttp.get({ url: '/mp/free-publish/page', params });
} }
// 删除公众号素材 // 删除公众号素材
export function deleteFreePublish(accountId, articleId) { export function deleteFreePublish(accountId, articleId) {
return defHttp.delete({ url: '/mp/free-publish/delete?accountId=' + accountId + '&&articleId=' + articleId }) return defHttp.delete({ url: '/mp/free-publish/delete?accountId=' + accountId + '&&articleId=' + articleId });
} }
// 发布公众号素材 // 发布公众号素材
export function submitFreePublish(accountId, mediaId) { export function submitFreePublish(accountId, mediaId) {
return defHttp.post({ url: '/mp/free-publish/submit?accountId=' + accountId + '&&mediaId=' + mediaId }) return defHttp.post({ url: '/mp/free-publish/submit?accountId=' + accountId + '&&mediaId=' + mediaId });
} }

View File

@ -1,11 +1,11 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得公众号素材分页 // 获得公众号素材分页
export function getMaterialPage(params) { export function getMaterialPage(params) {
return defHttp.get({ url: '/mp/material/page', params }) return defHttp.get({ url: '/mp/material/page', params });
} }
// 删除公众号永久素材 // 删除公众号永久素材
export function deletePermanentMaterial(id) { export function deletePermanentMaterial(id) {
return defHttp.delete({ url: '/mp/material/delete-permanent?id=' + id }) return defHttp.delete({ url: '/mp/material/delete-permanent?id=' + id });
} }

View File

@ -1,8 +1,8 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得公众号菜单列表 // 获得公众号菜单列表
export function getMenuList(accountId) { export function getMenuList(accountId) {
return defHttp.get({ url: '/mp/menu/list?accountId=' + accountId }) return defHttp.get({ url: '/mp/menu/list?accountId=' + accountId });
} }
// 保存公众号菜单 // 保存公众号菜单
@ -11,12 +11,12 @@ export function saveMenu(accountId, menus) {
url: '/mp/menu/save', url: '/mp/menu/save',
data: { data: {
accountId, accountId,
menus menus,
} },
}) });
} }
// 删除公众号菜单 // 删除公众号菜单
export function deleteMenu(accountId) { export function deleteMenu(accountId) {
return defHttp.delete({ url: '/mp/menu/delete?accountId=' + accountId }) return defHttp.delete({ url: '/mp/menu/delete?accountId=' + accountId });
} }

View File

@ -1,11 +1,11 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得公众号消息分页 // 获得公众号消息分页
export function getMessagePage(params) { export function getMessagePage(params) {
return defHttp.get({ url: '/mp/message/page', params }) return defHttp.get({ url: '/mp/message/page', params });
} }
// 给粉丝发送消息 // 给粉丝发送消息
export function sendMessage(data) { export function sendMessage(data) {
return defHttp.post({ url: '/mp/message/send', data }) return defHttp.post({ url: '/mp/message/send', data });
} }

View File

@ -1,21 +1,21 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 更新公众号粉丝 // 更新公众号粉丝
export function updateUser(data) { export function updateUser(data) {
return defHttp.put({ url: '/mp/user/update', data }) return defHttp.put({ url: '/mp/user/update', data });
} }
// 获得公众号粉丝 // 获得公众号粉丝
export function getUser(id) { export function getUser(id) {
return defHttp.get({ url: '/mp/user/get?id=' + id }) return defHttp.get({ url: '/mp/user/get?id=' + id });
} }
// 获得公众号粉丝分页 // 获得公众号粉丝分页
export function getUserPage(params) { export function getUserPage(params) {
return defHttp.get({ url: '/mp/user/page', params }) return defHttp.get({ url: '/mp/user/page', params });
} }
// 同步公众号粉丝 // 同步公众号粉丝
export function syncUser(accountId) { export function syncUser(accountId) {
return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId }) return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId });
} }

View File

@ -1,21 +1,21 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获取消息发送概况数据 // 获取消息发送概况数据
export function getUpstreamMessage(params) { export function getUpstreamMessage(params) {
return defHttp.get({ url: '/mp/statistics/upstream-message', params }) return defHttp.get({ url: '/mp/statistics/upstream-message', params });
} }
// 用户增减数据 // 用户增减数据
export function getUserSummary(params) { export function getUserSummary(params) {
return defHttp.get({ url: '/mp/statistics/user-summary', params }) return defHttp.get({ url: '/mp/statistics/user-summary', params });
} }
// 获得用户累计数据 // 获得用户累计数据
export function getUserCumulate(params) { export function getUserCumulate(params) {
return defHttp.get({ url: '/mp/statistics/user-cumulate', params }) return defHttp.get({ url: '/mp/statistics/user-cumulate', params });
} }
// 获得接口分析数据 // 获得接口分析数据
export function getInterfaceSummary(params) { export function getInterfaceSummary(params) {
return defHttp.get({ url: '/mp/statistics/interface-summary', params }) return defHttp.get({ url: '/mp/statistics/interface-summary', params });
} }

View File

@ -1,36 +1,36 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 创建公众号标签 // 创建公众号标签
export function createTag(data) { export function createTag(data) {
return defHttp.post({ url: '/mp/tag/create', data }) return defHttp.post({ url: '/mp/tag/create', data });
} }
// 更新公众号标签 // 更新公众号标签
export function updateTag(data) { export function updateTag(data) {
return defHttp.put({ url: '/mp/tag/update', data }) return defHttp.put({ url: '/mp/tag/update', data });
} }
// 删除公众号标签 // 删除公众号标签
export function deleteTag(id) { export function deleteTag(id) {
return defHttp.delete({ url: '/mp/tag/delete?id=' + id }) return defHttp.delete({ url: '/mp/tag/delete?id=' + id });
} }
// 获得公众号标签 // 获得公众号标签
export function getTag(id) { export function getTag(id) {
return defHttp.get({ url: '/mp/tag/get?id=' + id }) return defHttp.get({ url: '/mp/tag/get?id=' + id });
} }
// 获得公众号标签分页 // 获得公众号标签分页
export function getTagPage(params) { export function getTagPage(params) {
return defHttp.get({ url: '/mp/tag/page', params }) return defHttp.get({ url: '/mp/tag/page', params });
} }
// 获取公众号标签精简信息列表 // 获取公众号标签精简信息列表
export function getSimpleTags() { export function getSimpleTags() {
return defHttp.get({ url: '/mp/tag/list-all-simple' }) return defHttp.get({ url: '/mp/tag/list-all-simple' });
} }
// 同步公众号标签 // 同步公众号标签
export function syncTag(accountId) { export function syncTag(accountId) {
return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId }) return defHttp.post({ url: '/mp/tag/sync?accountId=' + accountId });
} }

View File

@ -1,78 +1,78 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface AppVO { export interface AppVO {
id: number id: number;
name: string name: string;
status: number status: number;
remark: string remark: string;
payNotifyUrl: string payNotifyUrl: string;
refundNotifyUrl: string refundNotifyUrl: string;
merchantId: number merchantId: number;
merchantName: string merchantName: string;
createTime: Date createTime: Date;
} }
export interface AppPageReqVO extends PageParam { export interface AppPageReqVO extends PageParam {
name?: string name?: string;
status?: number status?: number;
remark?: string remark?: string;
payNotifyUrl?: string payNotifyUrl?: string;
refundNotifyUrl?: string refundNotifyUrl?: string;
merchantName?: string merchantName?: string;
createTime?: Date[] createTime?: Date[];
} }
export interface AppExportReqVO { export interface AppExportReqVO {
name?: string name?: string;
status?: number status?: number;
remark?: string remark?: string;
payNotifyUrl?: string payNotifyUrl?: string;
refundNotifyUrl?: string refundNotifyUrl?: string;
merchantName?: string merchantName?: string;
createTime?: Date[] createTime?: Date[];
} }
export interface AppUpdateStatusReqVO { export interface AppUpdateStatusReqVO {
id: number id: number;
status: number status: number;
} }
// 查询列表支付应用 // 查询列表支付应用
export function getAppPage(params: AppPageReqVO) { export function getAppPage(params: AppPageReqVO) {
return defHttp.get({ url: '/pay/app/page', params }) return defHttp.get({ url: '/pay/app/page', params });
} }
// 查询详情支付应用 // 查询详情支付应用
export function getApp(id: number) { export function getApp(id: number) {
return defHttp.get({ url: '/pay/app/get?id=' + id }) return defHttp.get({ url: '/pay/app/get?id=' + id });
} }
// 新增支付应用 // 新增支付应用
export function createApp(data: AppVO) { export function createApp(data: AppVO) {
return defHttp.post({ url: '/pay/app/create', data }) return defHttp.post({ url: '/pay/app/create', data });
} }
// 修改支付应用 // 修改支付应用
export function updateApp(data: AppVO) { export function updateApp(data: AppVO) {
return defHttp.put({ url: '/pay/app/update', data }) return defHttp.put({ url: '/pay/app/update', data });
} }
// 支付应用信息状态修改 // 支付应用信息状态修改
export function changeAppStatus(data: AppUpdateStatusReqVO) { export function changeAppStatus(data: AppUpdateStatusReqVO) {
return defHttp.put({ url: '/pay/app/update-status', data }) return defHttp.put({ url: '/pay/app/update-status', data });
} }
// 删除支付应用 // 删除支付应用
export function deleteApp(id: number) { export function deleteApp(id: number) {
return defHttp.delete({ url: '/pay/app/delete?id=' + id }) return defHttp.delete({ url: '/pay/app/delete?id=' + id });
} }
// 导出支付应用 // 导出支付应用
export function exportApp(params: AppExportReqVO) { export function exportApp(params: AppExportReqVO) {
return defHttp.download({ url: '/pay/app/export-excel', params }, '支付应用.xls') return defHttp.download({ url: '/pay/app/export-excel', params }, '支付应用.xls');
} }
// 根据商ID称搜索应用列表 // 根据商ID称搜索应用列表
export function getAppListByMerchantId(merchantId: number) { export function getAppListByMerchantId(merchantId: number) {
return defHttp.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } }) return defHttp.get({ url: '/pay/app/list-merchant-id', params: { merchantId } });
} }

View File

@ -1,70 +1,70 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ChannelVO { export interface ChannelVO {
id: number id: number;
code: string code: string;
config: string config: string;
status: number status: number;
remark: string remark: string;
feeRate: number feeRate: number;
merchantId: number merchantId: number;
appId: number appId: number;
createTime: Date createTime: Date;
} }
export interface ChannelPageReqVO extends PageParam { export interface ChannelPageReqVO extends PageParam {
code?: string code?: string;
status?: number status?: number;
remark?: string remark?: string;
feeRate?: number feeRate?: number;
merchantId?: number merchantId?: number;
appId?: number appId?: number;
config?: string config?: string;
createTime?: Date[] createTime?: Date[];
} }
export interface ChannelExportReqVO { export interface ChannelExportReqVO {
code?: string code?: string;
status?: number status?: number;
remark?: string remark?: string;
feeRate?: number feeRate?: number;
merchantId?: number merchantId?: number;
appId?: number appId?: number;
config?: string config?: string;
createTime?: Date[] createTime?: Date[];
} }
// 查询列表支付渠道 // 查询列表支付渠道
export function getChannelPage(params: ChannelPageReqVO) { export function getChannelPage(params: ChannelPageReqVO) {
return defHttp.get({ url: '/pay/channel/page', params }) return defHttp.get({ url: '/pay/channel/page', params });
} }
// 查询详情支付渠道 // 查询详情支付渠道
export function getChannel(merchantId: number, appId: string, code: string) { export function getChannel(merchantId: number, appId: string, code: string) {
const params = { const params = {
merchantId: merchantId, merchantId,
appId: appId, appId,
code: code code,
} };
return defHttp.get({ url: '/pay/channel/get-channel', params: params }) return defHttp.get({ url: '/pay/channel/get-channel', params });
} }
// 新增支付渠道 // 新增支付渠道
export function createChannel(data: ChannelVO) { export function createChannel(data: ChannelVO) {
return defHttp.post({ url: '/pay/channel/create', data }) return defHttp.post({ url: '/pay/channel/create', data });
} }
// 修改支付渠道 // 修改支付渠道
export function updateChannel(data: ChannelVO) { export function updateChannel(data: ChannelVO) {
return defHttp.put({ url: '/pay/channel/update', data }) return defHttp.put({ url: '/pay/channel/update', data });
} }
// 删除支付渠道 // 删除支付渠道
export function deleteChannel(id: number) { export function deleteChannel(id: number) {
return defHttp.delete({ url: '/pay/channel/delete?id=' + id }) return defHttp.delete({ url: '/pay/channel/delete?id=' + id });
} }
// 导出支付渠道 // 导出支付渠道
export function exportChannel(params: ChannelExportReqVO) { export function exportChannel(params: ChannelExportReqVO) {
return defHttp.download({ url: '/pay/channel/export-excel', params }, '支付渠道.xls') return defHttp.download({ url: '/pay/channel/export-excel', params }, '支付渠道.xls');
} }

View File

@ -1,21 +1,21 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得示例订单分页 // 获得示例订单分页
export function getDemoOrderPage(params) { export function getDemoOrderPage(params) {
return defHttp.get({ url: '/pay/demo-order/page', params }) return defHttp.get({ url: '/pay/demo-order/page', params });
} }
// 获得示例订单 // 获得示例订单
export function getDemoOrder(id: number) { export function getDemoOrder(id: number) {
return defHttp.get({ url: '/pay/demo-order/get?id=' + id }) return defHttp.get({ url: '/pay/demo-order/get?id=' + id });
} }
// 创建示例订单 // 创建示例订单
export function createDemoOrder(data) { export function createDemoOrder(data) {
return defHttp.post({ url: '/pay/demo-order/create', data }) return defHttp.post({ url: '/pay/demo-order/create', data });
} }
// 退款示例订单 // 退款示例订单
export function updateApp(id: number) { export function updateApp(id: number) {
return defHttp.put({ url: '/pay/demo-order/refund?id=' + id }) return defHttp.put({ url: '/pay/demo-order/refund?id=' + id });
} }

View File

@ -1,41 +1,41 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface MerchantVO { export interface MerchantVO {
id: number id: number;
no: string no: string;
name: string name: string;
shortName: string shortName: string;
status: number status: number;
remark: string remark: string;
createTime: Date createTime: Date;
} }
export interface MerchantPageReqVO extends PageParam { export interface MerchantPageReqVO extends PageParam {
no?: string no?: string;
name?: string name?: string;
shortName?: string shortName?: string;
status?: number status?: number;
remark?: string remark?: string;
createTime?: Date[] createTime?: Date[];
} }
export interface MerchantExportReqVO { export interface MerchantExportReqVO {
no?: string no?: string;
name?: string name?: string;
shortName?: string shortName?: string;
status?: number status?: number;
remark?: string remark?: string;
createTime?: Date[] createTime?: Date[];
} }
// 查询列表支付商户 // 查询列表支付商户
export function getMerchantPage(params: MerchantPageReqVO) { export function getMerchantPage(params: MerchantPageReqVO) {
return defHttp.get({ url: '/pay/merchant/page', params }) return defHttp.get({ url: '/pay/merchant/page', params });
} }
// 查询详情支付商户 // 查询详情支付商户
export function getMerchant(id: number) { export function getMerchant(id: number) {
return defHttp.get({ url: '/pay/merchant/get?id=' + id }) return defHttp.get({ url: '/pay/merchant/get?id=' + id });
} }
// 根据商户名称搜索商户列表 // 根据商户名称搜索商户列表
@ -43,35 +43,35 @@ export function getMerchantListByName(name: string) {
return defHttp.get({ return defHttp.get({
url: '/pay/merchant/list-by-name?id=', url: '/pay/merchant/list-by-name?id=',
params: { params: {
name: name name,
} },
}) });
} }
// 新增支付商户 // 新增支付商户
export function createMerchant(data: MerchantVO) { export function createMerchant(data: MerchantVO) {
return defHttp.post({ url: '/pay/merchant/create', data }) return defHttp.post({ url: '/pay/merchant/create', data });
} }
// 修改支付商户 // 修改支付商户
export function updateMerchant(data: MerchantVO) { export function updateMerchant(data: MerchantVO) {
return defHttp.put({ url: '/pay/merchant/update', data }) return defHttp.put({ url: '/pay/merchant/update', data });
} }
// 删除支付商户 // 删除支付商户
export function deleteMerchant(id: number) { export function deleteMerchant(id: number) {
return defHttp.delete({ url: '/pay/merchant/delete?id=' + id }) return defHttp.delete({ url: '/pay/merchant/delete?id=' + id });
} }
// 导出支付商户 // 导出支付商户
export function exportMerchant(params: MerchantExportReqVO) { export function exportMerchant(params: MerchantExportReqVO) {
return defHttp.download({ url: '/pay/merchant/export-excel', params }, '支付商户.xls') return defHttp.download({ url: '/pay/merchant/export-excel', params }, '支付商户.xls');
} }
// 支付商户状态修改 // 支付商户状态修改
export function changeMerchantStatus(id: number, status: number) { export function changeMerchantStatus(id: number, status: number) {
const data = { const data = {
id, id,
status status,
} };
return defHttp.put({ url: '/pay/merchant/update-status', data }) return defHttp.put({ url: '/pay/merchant/update-status', data });
} }

View File

@ -1,114 +1,114 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface OrderVO { export interface OrderVO {
id: number id: number;
merchantId: number merchantId: number;
appId: number appId: number;
channelId: number channelId: number;
channelCode: string channelCode: string;
merchantOrderId: string merchantOrderId: string;
subject: string subject: string;
body: string body: string;
notifyUrl: string notifyUrl: string;
notifyStatus: number notifyStatus: number;
amount: number amount: number;
channelFeeRate: number channelFeeRate: number;
channelFeeAmount: number channelFeeAmount: number;
status: number status: number;
userIp: string userIp: string;
expireTime: Date expireTime: Date;
successTime: Date successTime: Date;
notifyTime: Date notifyTime: Date;
successExtensionId: number successExtensionId: number;
refundStatus: number refundStatus: number;
refundTimes: number refundTimes: number;
refundAmount: number refundAmount: number;
channelUserId: string channelUserId: string;
channelOrderNo: string channelOrderNo: string;
createTime: Date createTime: Date;
} }
export interface OrderPageReqVO extends PageParam { export interface OrderPageReqVO extends PageParam {
merchantId?: number merchantId?: number;
appId?: number appId?: number;
channelId?: number channelId?: number;
channelCode?: string channelCode?: string;
merchantOrderId?: string merchantOrderId?: string;
subject?: string subject?: string;
body?: string body?: string;
notifyUrl?: string notifyUrl?: string;
notifyStatus?: number notifyStatus?: number;
amount?: number amount?: number;
channelFeeRate?: number channelFeeRate?: number;
channelFeeAmount?: number channelFeeAmount?: number;
status?: number status?: number;
expireTime?: Date[] expireTime?: Date[];
successTime?: Date[] successTime?: Date[];
notifyTime?: Date[] notifyTime?: Date[];
successExtensionId?: number successExtensionId?: number;
refundStatus?: number refundStatus?: number;
refundTimes?: number refundTimes?: number;
channelUserId?: string channelUserId?: string;
channelOrderNo?: string channelOrderNo?: string;
createTime?: Date[] createTime?: Date[];
} }
export interface OrderExportReqVO { export interface OrderExportReqVO {
merchantId?: number merchantId?: number;
appId?: number appId?: number;
channelId?: number channelId?: number;
channelCode?: string channelCode?: string;
merchantOrderId?: string merchantOrderId?: string;
subject?: string subject?: string;
body?: string body?: string;
notifyUrl?: string notifyUrl?: string;
notifyStatus?: number notifyStatus?: number;
amount?: number amount?: number;
channelFeeRate?: number channelFeeRate?: number;
channelFeeAmount?: number channelFeeAmount?: number;
status?: number status?: number;
expireTime?: Date[] expireTime?: Date[];
successTime?: Date[] successTime?: Date[];
notifyTime?: Date[] notifyTime?: Date[];
successExtensionId?: number successExtensionId?: number;
refundStatus?: number refundStatus?: number;
refundTimes?: number refundTimes?: number;
channelUserId?: string channelUserId?: string;
channelOrderNo?: string channelOrderNo?: string;
createTime?: Date[] createTime?: Date[];
} }
// 查询列表支付订单 // 查询列表支付订单
export function getOrderPage(params: OrderPageReqVO) { export function getOrderPage(params: OrderPageReqVO) {
return defHttp.get({ url: '/pay/order/page', params }) return defHttp.get({ url: '/pay/order/page', params });
} }
// 查询详情支付订单 // 查询详情支付订单
export function getOrder(id: number) { export function getOrder(id: number) {
return defHttp.get({ url: '/pay/order/get?id=' + id }) return defHttp.get({ url: '/pay/order/get?id=' + id });
} }
// 查询详情支付订单 // 查询详情支付订单
export function getOrderDetail(id: number) { export function getOrderDetail(id: number) {
return defHttp.get({ url: '/pay/order/get-detail?id=' + id }) return defHttp.get({ url: '/pay/order/get-detail?id=' + id });
} }
// 新增支付订单 // 新增支付订单
export function createOrder(data: OrderVO) { export function createOrder(data: OrderVO) {
return defHttp.post({ url: '/pay/order/create', data }) return defHttp.post({ url: '/pay/order/create', data });
} }
// 修改支付订单 // 修改支付订单
export function updateOrder(data: OrderVO) { export function updateOrder(data: OrderVO) {
return defHttp.put({ url: '/pay/order/update', data }) return defHttp.put({ url: '/pay/order/update', data });
} }
// 删除支付订单 // 删除支付订单
export function deleteOrder(id: number) { export function deleteOrder(id: number) {
return defHttp.delete({ url: '/pay/order/delete?id=' + id }) return defHttp.delete({ url: '/pay/order/delete?id=' + id });
} }
// 导出支付订单 // 导出支付订单
export function exportOrder(params: OrderExportReqVO) { export function exportOrder(params: OrderExportReqVO) {
return defHttp.download({ url: '/pay/order/export-excel', params }, '支付订单.xls') return defHttp.download({ url: '/pay/order/export-excel', params }, '支付订单.xls');
} }

View File

@ -1,116 +1,116 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface RefundVO { export interface RefundVO {
id: number id: number;
merchantId: number merchantId: number;
appId: number appId: number;
channelId: number channelId: number;
channelCode: string channelCode: string;
orderId: string orderId: string;
tradeNo: string tradeNo: string;
merchantOrderId: string merchantOrderId: string;
merchantRefundNo: string merchantRefundNo: string;
notifyUrl: string notifyUrl: string;
notifyStatus: number notifyStatus: number;
status: number status: number;
type: number type: number;
payAmount: number payAmount: number;
refundAmount: number refundAmount: number;
reason: string reason: string;
userIp: string userIp: string;
channelOrderNo: string channelOrderNo: string;
channelRefundNo: string channelRefundNo: string;
channelErrorCode: string channelErrorCode: string;
channelErrorMsg: string channelErrorMsg: string;
channelExtras: string channelExtras: string;
expireTime: Date expireTime: Date;
successTime: Date successTime: Date;
notifyTime: Date notifyTime: Date;
createTime: Date createTime: Date;
} }
export interface RefundPageReqVO extends PageParam { export interface RefundPageReqVO extends PageParam {
merchantId?: number merchantId?: number;
appId?: number appId?: number;
channelId?: number channelId?: number;
channelCode?: string channelCode?: string;
orderId?: string orderId?: string;
tradeNo?: string tradeNo?: string;
merchantOrderId?: string merchantOrderId?: string;
merchantRefundNo?: string merchantRefundNo?: string;
notifyUrl?: string notifyUrl?: string;
notifyStatus?: number notifyStatus?: number;
status?: number status?: number;
type?: number type?: number;
payAmount?: number payAmount?: number;
refundAmount?: number refundAmount?: number;
reason?: string reason?: string;
userIp?: string userIp?: string;
channelOrderNo?: string channelOrderNo?: string;
channelRefundNo?: string channelRefundNo?: string;
channelErrorCode?: string channelErrorCode?: string;
channelErrorMsg?: string channelErrorMsg?: string;
channelExtras?: string channelExtras?: string;
expireTime?: Date[] expireTime?: Date[];
successTime?: Date[] successTime?: Date[];
notifyTime?: Date[] notifyTime?: Date[];
createTime?: Date[] createTime?: Date[];
} }
export interface PayRefundExportReqVO { export interface PayRefundExportReqVO {
merchantId?: number merchantId?: number;
appId?: number appId?: number;
channelId?: number channelId?: number;
channelCode?: string channelCode?: string;
orderId?: string orderId?: string;
tradeNo?: string tradeNo?: string;
merchantOrderId?: string merchantOrderId?: string;
merchantRefundNo?: string merchantRefundNo?: string;
notifyUrl?: string notifyUrl?: string;
notifyStatus?: number notifyStatus?: number;
status?: number status?: number;
type?: number type?: number;
payAmount?: number payAmount?: number;
refundAmount?: number refundAmount?: number;
reason?: string reason?: string;
userIp?: string userIp?: string;
channelOrderNo?: string channelOrderNo?: string;
channelRefundNo?: string channelRefundNo?: string;
channelErrorCode?: string channelErrorCode?: string;
channelErrorMsg?: string channelErrorMsg?: string;
channelExtras?: string channelExtras?: string;
expireTime?: Date[] expireTime?: Date[];
successTime?: Date[] successTime?: Date[];
notifyTime?: Date[] notifyTime?: Date[];
createTime?: Date[] createTime?: Date[];
} }
// 查询列表退款订单 // 查询列表退款订单
export function getRefundPage(params: RefundPageReqVO) { export function getRefundPage(params: RefundPageReqVO) {
return defHttp.get({ url: '/pay/refund/page', params }) return defHttp.get({ url: '/pay/refund/page', params });
} }
// 查询详情退款订单 // 查询详情退款订单
export function getRefund(id: number) { export function getRefund(id: number) {
return defHttp.get({ url: '/pay/refund/get?id=' + id }) return defHttp.get({ url: '/pay/refund/get?id=' + id });
} }
// 新增退款订单 // 新增退款订单
export function createRefund(data: RefundVO) { export function createRefund(data: RefundVO) {
return defHttp.post({ url: '/pay/refund/create', data }) return defHttp.post({ url: '/pay/refund/create', data });
} }
// 修改退款订单 // 修改退款订单
export function updateRefund(data: RefundVO) { export function updateRefund(data: RefundVO) {
return defHttp.put({ url: '/pay/refund/update', data }) return defHttp.put({ url: '/pay/refund/update', data });
} }
// 删除退款订单 // 删除退款订单
export function deleteRefund(id: number) { export function deleteRefund(id: number) {
return defHttp.delete({ url: '/pay/refund/delete?id=' + id }) return defHttp.delete({ url: '/pay/refund/delete?id=' + id });
} }
// 导出退款订单 // 导出退款订单
export function exportRefund(params: PayRefundExportReqVO) { export function exportRefund(params: PayRefundExportReqVO) {
return defHttp.download({ url: '/pay/refund/export-excel', params }, '退款订单.xls') return defHttp.download({ url: '/pay/refund/export-excel', params }, '退款订单.xls');
} }

View File

@ -1,11 +1,11 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得地区树 // 获得地区树
export function getAreaTree() { export function getAreaTree() {
return defHttp.get({ url: '/system/area/tree' }) return defHttp.get({ url: '/system/area/tree' });
} }
// 获得 IP 对应的地区名 // 获得 IP 对应的地区名
export function getAreaByIp(ip: string) { export function getAreaByIp(ip: string) {
return defHttp.get({ url: '/system/area/get-by-ip?ip=' + ip }) return defHttp.get({ url: '/system/area/get-by-ip?ip=' + ip });
} }

View File

@ -1,48 +1,48 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface DeptVO { export interface DeptVO {
id?: number id?: number;
name: string name: string;
parentId: number parentId: number;
status: number status: number;
sort: number sort: number;
leaderUserId: number leaderUserId: number;
phone: string phone: string;
email: string email: string;
createTime: Date createTime: Date;
} }
export interface DeptPageReqVO { export interface DeptPageReqVO {
name?: string name?: string;
status?: number status?: number;
} }
// 查询部门(精简)列表 // 查询部门(精简)列表
export function listSimpleDept() { export function listSimpleDept() {
return defHttp.get({ url: '/system/dept/list-all-simple' }) return defHttp.get({ url: '/system/dept/list-all-simple' });
} }
// 查询部门列表 // 查询部门列表
export function getDeptPage(params: DeptPageReqVO) { export function getDeptPage(params: DeptPageReqVO) {
return defHttp.get({ url: '/system/dept/list', params }) return defHttp.get({ url: '/system/dept/list', params });
} }
// 查询部门详情 // 查询部门详情
export function getDept(id: number) { export function getDept(id: number) {
return defHttp.get({ url: '/system/dept/get?id=' + id }) return defHttp.get({ url: '/system/dept/get?id=' + id });
} }
// 新增部门 // 新增部门
export function createDept(data: DeptVO) { export function createDept(data: DeptVO) {
return defHttp.post({ url: '/system/dept/create', data }) return defHttp.post({ url: '/system/dept/create', data });
} }
// 修改部门 // 修改部门
export function updateDept(params: DeptVO) { export function updateDept(params: DeptVO) {
return defHttp.put({ url: '/system/dept/update', data: params }) return defHttp.put({ url: '/system/dept/update', data: params });
} }
// 删除部门 // 删除部门
export function deleteDept(id: number) { export function deleteDept(id: number) {
return defHttp.delete({ url: '/system/dept/delete?id=' + id }) return defHttp.delete({ url: '/system/dept/delete?id=' + id });
} }

View File

@ -1,36 +1,37 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
import type { DictDataVO, DictDataPageReqVO, DictDataExportReqVO } from './types'
import type { DictDataExportReqVO, DictDataPageReqVO, DictDataVO } from './types';
// 查询字典数据(精简)列表 // 查询字典数据(精简)列表
export function listSimpleDictData() { export function listSimpleDictData() {
return defHttp.get({ url: '/system/dict-data/list-all-simple' }) return defHttp.get({ url: '/system/dict-data/list-all-simple' });
} }
// 查询字典数据列表 // 查询字典数据列表
export function getDictDataPage(params: DictDataPageReqVO) { export function getDictDataPage(params: DictDataPageReqVO) {
return defHttp.get({ url: '/system/dict-data/page', params }) return defHttp.get({ url: '/system/dict-data/page', params });
} }
// 查询字典数据详情 // 查询字典数据详情
export function getDictData(id: number) { export function getDictData(id: number) {
return defHttp.get({ url: '/system/dict-data/get?id=' + id }) return defHttp.get({ url: '/system/dict-data/get?id=' + id });
} }
// 新增字典数据 // 新增字典数据
export function createDictData(data: DictDataVO) { export function createDictData(data: DictDataVO) {
return defHttp.post({ url: '/system/dict-data/create', data }) return defHttp.post({ url: '/system/dict-data/create', data });
} }
// 修改字典数据 // 修改字典数据
export function updateDictData(data: DictDataVO) { export function updateDictData(data: DictDataVO) {
return defHttp.put({ url: '/system/dict-data/update', data }) return defHttp.put({ url: '/system/dict-data/update', data });
} }
// 删除字典数据 // 删除字典数据
export function deleteDictData(id: number) { export function deleteDictData(id: number) {
return defHttp.delete({ url: '/system/dict-data/delete?id=' + id }) return defHttp.delete({ url: '/system/dict-data/delete?id=' + id });
} }
// 导出字典类型数据 // 导出字典类型数据
export function exportDictData(params: DictDataExportReqVO) { export function exportDictData(params: DictDataExportReqVO) {
return defHttp.get({ url: '/system/dict-data/export', params }) return defHttp.get({ url: '/system/dict-data/export', params });
} }

View File

@ -1,36 +1,37 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
import type { DictTypeVO, DictTypePageReqVO, DictTypeExportReqVO } from './types'
import type { DictTypeExportReqVO, DictTypePageReqVO, DictTypeVO } from './types';
// 查询字典(精简)列表 // 查询字典(精简)列表
export function listSimpleDictType() { export function listSimpleDictType() {
return defHttp.get({ url: '/system/dict-type/list-all-simple' }) return defHttp.get({ url: '/system/dict-type/list-all-simple' });
} }
// 查询字典列表 // 查询字典列表
export function getDictTypePage(params: DictTypePageReqVO) { export function getDictTypePage(params: DictTypePageReqVO) {
return defHttp.get({ url: '/system/dict-type/page', params }) return defHttp.get({ url: '/system/dict-type/page', params });
} }
// 查询字典详情 // 查询字典详情
export function getDictType(id: number) { export function getDictType(id: number) {
return defHttp.get({ url: '/system/dict-type/get?id=' + id }) return defHttp.get({ url: '/system/dict-type/get?id=' + id });
} }
// 新增字典 // 新增字典
export function createDictType(data: DictTypeVO) { export function createDictType(data: DictTypeVO) {
return defHttp.post({ url: '/system/dict-type/create', data }) return defHttp.post({ url: '/system/dict-type/create', data });
} }
// 修改字典 // 修改字典
export function updateDictType(data: DictTypeVO) { export function updateDictType(data: DictTypeVO) {
return defHttp.put({ url: '/system/dict-type/update', data }) return defHttp.put({ url: '/system/dict-type/update', data });
} }
// 删除字典 // 删除字典
export function deleteDictType(id: number) { export function deleteDictType(id: number) {
return defHttp.delete({ url: '/system/dict-type/delete?id=' + id }) return defHttp.delete({ url: '/system/dict-type/delete?id=' + id });
} }
// 导出字典类型 // 导出字典类型
export function exportDictType(params: DictTypeExportReqVO) { export function exportDictType(params: DictTypeExportReqVO) {
return defHttp.get({ url: '/system/dict-type/export', params }) return defHttp.get({ url: '/system/dict-type/export', params });
} }

View File

@ -1,46 +1,46 @@
export type DictTypeVO = { export interface DictTypeVO {
id: number id: number;
name: string name: string;
type: string type: string;
status: number status: number;
remark: string remark: string;
createTime: Date createTime: Date;
} }
export type DictTypePageReqVO = { export interface DictTypePageReqVO {
name: string name: string;
type: string type: string;
status: number status: number;
createTime: Date[] createTime: Date[];
} }
export type DictTypeExportReqVO = { export interface DictTypeExportReqVO {
name: string name: string;
type: string type: string;
status: number status: number;
createTime: Date[] createTime: Date[];
} }
export type DictDataVO = { export interface DictDataVO {
id: number id: number;
sort: number sort: number;
label: string label: string;
value: string value: string;
dictType: string dictType: string;
status: number status: number;
colorType: string colorType: string;
cssClass: string cssClass: string;
remark: string remark: string;
createTime: Date createTime: Date;
} }
export type DictDataPageReqVO = { export interface DictDataPageReqVO {
label: string label: string;
dictType: string dictType: string;
status: number status: number;
} }
export type DictDataExportReqVO = { export interface DictDataExportReqVO {
label: string label: string;
dictType: string dictType: string;
status: number status: number;
} }

View File

@ -1,49 +1,49 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface ErrorCodeVO { export interface ErrorCodeVO {
id: number id: number;
type: number type: number;
applicationName: string applicationName: string;
code: number code: number;
message: string message: string;
memo: string memo: string;
createTime: Date createTime: Date;
} }
export interface ErrorCodePageReqVO extends PageParam { export interface ErrorCodePageReqVO extends PageParam {
type?: number type?: number;
applicationName?: string applicationName?: string;
code?: number code?: number;
message?: string message?: string;
createTime?: Date[] createTime?: Date[];
} }
// 查询错误码列表 // 查询错误码列表
export function getErrorCodePage(params: ErrorCodePageReqVO) { export function getErrorCodePage(params: ErrorCodePageReqVO) {
return defHttp.get({ url: '/system/error-code/page', params }) return defHttp.get({ url: '/system/error-code/page', params });
} }
// 查询错误码详情 // 查询错误码详情
export function getErrorCode(id: number) { export function getErrorCode(id: number) {
return defHttp.get({ url: '/system/error-code/get?id=' + id }) return defHttp.get({ url: '/system/error-code/get?id=' + id });
} }
// 新增错误码 // 新增错误码
export function createErrorCode(data: ErrorCodeVO) { export function createErrorCode(data: ErrorCodeVO) {
return defHttp.post({ url: '/system/error-code/create', data }) return defHttp.post({ url: '/system/error-code/create', data });
} }
// 修改错误码 // 修改错误码
export function updateErrorCode(data: ErrorCodeVO) { export function updateErrorCode(data: ErrorCodeVO) {
return defHttp.put({ url: '/system/error-code/update', data }) return defHttp.put({ url: '/system/error-code/update', data });
} }
// 删除错误码 // 删除错误码
export function deleteErrorCode(id: number) { export function deleteErrorCode(id: number) {
return defHttp.delete({ url: '/system/error-code/delete?id=' + id }) return defHttp.delete({ url: '/system/error-code/delete?id=' + id });
} }
// 导出错误码 // 导出错误码
export function excelErrorCode(params: ErrorCodePageReqVO) { export function excelErrorCode(params: ErrorCodePageReqVO) {
return defHttp.download({ url: '/system/error-code/export-excel', params }, '错误码.xls') return defHttp.download({ url: '/system/error-code/export-excel', params }, '错误码.xls');
} }

View File

@ -1,30 +1,30 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface LoginLogVO { export interface LoginLogVO {
id: number id: number;
logType: number logType: number;
traceId: number traceId: number;
userId: number userId: number;
userType: number userType: number;
username: string username: string;
status: number status: number;
userIp: string userIp: string;
userAgent: string userAgent: string;
createTime: Date createTime: Date;
} }
export interface LoginLogReqVO extends PageParam { export interface LoginLogReqVO extends PageParam {
userIp?: string userIp?: string;
username?: string username?: string;
status?: boolean status?: boolean;
createTime?: Date[] createTime?: Date[];
} }
// 查询登录日志列表 // 查询登录日志列表
export function getLoginLogPage(params: LoginLogReqVO) { export function getLoginLogPage(params: LoginLogReqVO) {
return defHttp.get({ url: '/system/login-log/page', params }) return defHttp.get({ url: '/system/login-log/page', params });
} }
// 导出登录日志 // 导出登录日志
export function exportLoginLog(params: LoginLogReqVO) { export function exportLoginLog(params: LoginLogReqVO) {
return defHttp.download({ url: '/system/login-log/export', params }, '登录日志.xls') return defHttp.download({ url: '/system/login-log/export', params }, '登录日志.xls');
} }

View File

@ -1,31 +1,31 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 创建邮箱账号 // 创建邮箱账号
export function createMailAccount(data) { export function createMailAccount(data) {
return defHttp.post({ url: '/system/mail-account/create', data }) return defHttp.post({ url: '/system/mail-account/create', data });
} }
// 更新邮箱账号 // 更新邮箱账号
export function updateMailAccount(data) { export function updateMailAccount(data) {
return defHttp.put({ url: '/system/mail-account/update', data }) return defHttp.put({ url: '/system/mail-account/update', data });
} }
// 删除邮箱账号 // 删除邮箱账号
export function deleteMailAccount(id: number) { export function deleteMailAccount(id: number) {
return defHttp.delete({ url: '/system/mail-account/delete?id=' + id }) return defHttp.delete({ url: '/system/mail-account/delete?id=' + id });
} }
// 获得邮箱账号 // 获得邮箱账号
export function getMailAccount(id: number) { export function getMailAccount(id: number) {
return defHttp.get({ url: '/system/mail-account/get?id=' + id }) return defHttp.get({ url: '/system/mail-account/get?id=' + id });
} }
// 获得邮箱账号分页 // 获得邮箱账号分页
export function getMailAccountPage(params) { export function getMailAccountPage(params) {
return defHttp.get({ url: '/system/mail-account/page', params }) return defHttp.get({ url: '/system/mail-account/page', params });
} }
// 获取邮箱账号的精简信息列表 // 获取邮箱账号的精简信息列表
export function getSimpleMailAccountList() { export function getSimpleMailAccountList() {
return defHttp.get({ url: '/system/mail-account/list-all-simple' }) return defHttp.get({ url: '/system/mail-account/list-all-simple' });
} }

View File

@ -1,11 +1,11 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 获得邮件日志 // 获得邮件日志
export function getMailLog(id: number) { export function getMailLog(id: number) {
return defHttp.get({ url: '/system/mail-log/get?id=' + id }) return defHttp.get({ url: '/system/mail-log/get?id=' + id });
} }
// 获得邮件日志分页 // 获得邮件日志分页
export function getMailAccountPage(params) { export function getMailAccountPage(params) {
return defHttp.get({ url: '/system/mail-log/page', params }) return defHttp.get({ url: '/system/mail-log/page', params });
} }

View File

@ -1,31 +1,31 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 创建邮件模版 // 创建邮件模版
export function createMailTemplate(data) { export function createMailTemplate(data) {
return defHttp.post({ url: '/system/mail-template/create', data }) return defHttp.post({ url: '/system/mail-template/create', data });
} }
// 更新邮件模版 // 更新邮件模版
export function updateMailTemplate(data) { export function updateMailTemplate(data) {
return defHttp.put({ url: '/system/mail-template/update', data }) return defHttp.put({ url: '/system/mail-template/update', data });
} }
// 删除邮件模版 // 删除邮件模版
export function deleteMailTemplate(id: number) { export function deleteMailTemplate(id: number) {
return defHttp.delete({ url: '/system/mail-template/delete?id=' + id }) return defHttp.delete({ url: '/system/mail-template/delete?id=' + id });
} }
// 获得邮件模版 // 获得邮件模版
export function getMailTemplate(id: number) { export function getMailTemplate(id: number) {
return defHttp.get({ url: '/system/mail-template/get?id=' + id }) return defHttp.get({ url: '/system/mail-template/get?id=' + id });
} }
// 获得邮件模版分页 // 获得邮件模版分页
export function getMailTemplatePage(params) { export function getMailTemplatePage(params) {
return defHttp.get({ url: '/system/mail-template/page', params }) return defHttp.get({ url: '/system/mail-template/page', params });
} }
// 发送测试邮件 // 发送测试邮件
export function sendMail(data) { export function sendMail(data) {
return defHttp.post({ url: '/system/mail-template/send-mail', data }) return defHttp.post({ url: '/system/mail-template/send-mail', data });
} }

View File

@ -1,52 +1,52 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface MenuVO { export interface MenuVO {
id: number id: number;
name: string name: string;
permission: string permission: string;
type: number type: number;
sort: number sort: number;
parentId: number parentId: number;
path: string path: string;
icon: string icon: string;
component: string component: string;
status: number status: number;
visible: boolean visible: boolean;
keepAlive: boolean keepAlive: boolean;
createTime: Date createTime: Date;
} }
export interface MenuPageReqVO { export interface MenuPageReqVO {
name?: string name?: string;
status?: number status?: number;
} }
// 查询菜单(精简)列表 // 查询菜单(精简)列表
export function listSimpleMenus() { export function listSimpleMenus() {
return defHttp.get({ url: '/system/menu/list-all-simple' }) return defHttp.get({ url: '/system/menu/list-all-simple' });
} }
// 查询菜单列表 // 查询菜单列表
export function getMenuList(params: MenuPageReqVO) { export function getMenuList(params: MenuPageReqVO) {
return defHttp.get({ url: '/system/menu/list', params }) return defHttp.get({ url: '/system/menu/list', params });
} }
// 获取菜单详情 // 获取菜单详情
export function getMenu(id: number) { export function getMenu(id: number) {
return defHttp.get({ url: '/system/menu/get?id=' + id }) return defHttp.get({ url: '/system/menu/get?id=' + id });
} }
// 新增菜单 // 新增菜单
export function createMenu(data: MenuVO) { export function createMenu(data: MenuVO) {
return defHttp.post({ url: '/system/menu/create', data }) return defHttp.post({ url: '/system/menu/create', data });
} }
// 修改菜单 // 修改菜单
export function updateMenu(data: MenuVO) { export function updateMenu(data: MenuVO) {
return defHttp.put({ url: '/system/menu/update', data }) return defHttp.put({ url: '/system/menu/update', data });
} }
// 删除菜单 // 删除菜单
export function deleteMenu(id: number) { export function deleteMenu(id: number) {
return defHttp.delete({ url: '/system/menu/delete?id=' + id }) return defHttp.delete({ url: '/system/menu/delete?id=' + id });
} }

View File

@ -1,42 +1,42 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface NoticeVO { export interface NoticeVO {
id: number id: number;
title: string title: string;
type: number type: number;
content: string content: string;
status: number status: number;
remark: string remark: string;
creator: string creator: string;
createTime: Date createTime: Date;
} }
export interface NoticePageReqVO extends PageParam { export interface NoticePageReqVO extends PageParam {
title?: string title?: string;
status?: number status?: number;
} }
// 查询公告列表 // 查询公告列表
export function getNoticePage(params: NoticePageReqVO) { export function getNoticePage(params: NoticePageReqVO) {
return defHttp.get({ url: '/system/notice/page', params }) return defHttp.get({ url: '/system/notice/page', params });
} }
// 查询公告详情 // 查询公告详情
export function getNotice(id: number) { export function getNotice(id: number) {
return defHttp.get({ url: '/system/notice/get?id=' + id }) return defHttp.get({ url: '/system/notice/get?id=' + id });
} }
// 新增公告 // 新增公告
export function createNotice(data: NoticeVO) { export function createNotice(data: NoticeVO) {
return defHttp.post({ url: '/system/notice/create', data }) return defHttp.post({ url: '/system/notice/create', data });
} }
// 修改公告 // 修改公告
export function updateNotice(data: NoticeVO) { export function updateNotice(data: NoticeVO) {
return defHttp.put({ url: '/system/notice/update', data }) return defHttp.put({ url: '/system/notice/update', data });
} }
// 删除公告 // 删除公告
export function deleteNotice(id: number) { export function deleteNotice(id: number) {
return defHttp.delete({ url: '/system/notice/delete?id=' + id }) return defHttp.delete({ url: '/system/notice/delete?id=' + id });
} }

View File

@ -1,32 +1,33 @@
import { defHttp } from '@/utils/http/axios' import qs from 'qs';
import qs from 'qs'
import { defHttp } from '@/utils/http/axios';
// 获得站内信分页 // 获得站内信分页
export function getNotifyMessagePage(params) { export function getNotifyMessagePage(params) {
return defHttp.get({ url: '/system/notify-message/page', params }) return defHttp.get({ url: '/system/notify-message/page', params });
} }
// 获得我的站内信分页 // 获得我的站内信分页
export function getMyNotifyMessagePage(params) { export function getMyNotifyMessagePage(params) {
return defHttp.get({ url: '/system/notify-message/my-page', params }) return defHttp.get({ url: '/system/notify-message/my-page', params });
} }
// 批量标记已读 // 批量标记已读
export function updateNotifyMessageRead(ids: number[]) { export function updateNotifyMessageRead(ids: number[]) {
return defHttp.put({ url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) }) return defHttp.put({ url: '/system/notify-message/update-read?' + qs.stringify({ ids }, { indices: false }) });
} }
// 标记所有站内信为已读 // 标记所有站内信为已读
export function updateAllNotifyMessageRead() { export function updateAllNotifyMessageRead() {
return defHttp.put({ url: '/system/notify-message/update-all-read' }) return defHttp.put({ url: '/system/notify-message/update-all-read' });
} }
// 获取当前用户的最新站内信列表 // 获取当前用户的最新站内信列表
export function getUnreadNotifyMessageList() { export function getUnreadNotifyMessageList() {
return defHttp.get({ url: '/system/notify-message/get-unread-list' }) return defHttp.get({ url: '/system/notify-message/get-unread-list' });
} }
// 获得当前用户的未读站内信数量 // 获得当前用户的未读站内信数量
export function getUnreadNotifyMessageCount() { export function getUnreadNotifyMessageCount() {
return defHttp.get({ url: '/system/notify-message/get-unread-count' }) return defHttp.get({ url: '/system/notify-message/get-unread-count' });
} }

View File

@ -1,36 +1,36 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
// 创建站内信模板 // 创建站内信模板
export function createNotifyTemplate(data) { export function createNotifyTemplate(data) {
return defHttp.post({ url: '/system/notify-template/create', data }) return defHttp.post({ url: '/system/notify-template/create', data });
} }
// 更新站内信模板 // 更新站内信模板
export function updateNotifyTemplate(data) { export function updateNotifyTemplate(data) {
return defHttp.put({ url: '/system/notify-template/update', data }) return defHttp.put({ url: '/system/notify-template/update', data });
} }
// 删除站内信模板 // 删除站内信模板
export function deleteNotifyTemplate(id: number) { export function deleteNotifyTemplate(id: number) {
return defHttp.delete({ url: '/system/notify-template/delete?id=' + id }) return defHttp.delete({ url: '/system/notify-template/delete?id=' + id });
} }
// 获得站内信模板 // 获得站内信模板
export function getNotifyTemplate(id: number) { export function getNotifyTemplate(id: number) {
return defHttp.get({ url: '/system/notify-template/get?id=' + id }) return defHttp.get({ url: '/system/notify-template/get?id=' + id });
} }
// 获得站内信模板分页 // 获得站内信模板分页
export function getNotifyTemplatePage(params) { export function getNotifyTemplatePage(params) {
return defHttp.get({ url: '/system/notify-template/page', params }) return defHttp.get({ url: '/system/notify-template/page', params });
} }
// 获取岗位精简信息列表 // 获取岗位精简信息列表
export function listSimplePosts() { export function listSimplePosts() {
return defHttp.get({ url: '/system/post/list-all-simple' }) return defHttp.get({ url: '/system/post/list-all-simple' });
} }
// 导出站内信模板 Excel // 导出站内信模板 Excel
export function exportNotifyTemplateExcel(params) { export function exportNotifyTemplateExcel(params) {
return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls') return defHttp.download({ url: '/system/notify-template/export-excel', params }, '导出站内信模板.xls');
} }

View File

@ -1,51 +1,51 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface OAuth2ClientVO { export interface OAuth2ClientVO {
id: number id: number;
clientId: string clientId: string;
secret: string secret: string;
name: string name: string;
logo: string logo: string;
description: string description: string;
status: number status: number;
accessTokenValiditySeconds: number accessTokenValiditySeconds: number;
refreshTokenValiditySeconds: number refreshTokenValiditySeconds: number;
redirectUris: string[] redirectUris: string[];
autoApprove: boolean autoApprove: boolean;
authorizedGrantTypes: string[] authorizedGrantTypes: string[];
scopes: string[] scopes: string[];
authorities: string[] authorities: string[];
resourceIds: string[] resourceIds: string[];
additionalInformation: string additionalInformation: string;
isAdditionalInformationJson: boolean isAdditionalInformationJson: boolean;
createTime: Date createTime: Date;
} }
export interface OAuth2ClientPageReqVO extends PageParam { export interface OAuth2ClientPageReqVO extends PageParam {
name?: string name?: string;
status?: number status?: number;
} }
// 查询 OAuth2列表 // 查询 OAuth2列表
export function getOAuth2ClientPage(params: OAuth2ClientPageReqVO) { export function getOAuth2ClientPage(params: OAuth2ClientPageReqVO) {
return defHttp.get({ url: '/system/oauth2-client/page', params }) return defHttp.get({ url: '/system/oauth2-client/page', params });
} }
// 查询 OAuth2详情 // 查询 OAuth2详情
export function getOAuth2Client(id: number) { export function getOAuth2Client(id: number) {
return defHttp.get({ url: '/system/oauth2-client/get?id=' + id }) return defHttp.get({ url: '/system/oauth2-client/get?id=' + id });
} }
// 新增 OAuth2 // 新增 OAuth2
export function createOAuth2Client(data: OAuth2ClientVO) { export function createOAuth2Client(data: OAuth2ClientVO) {
return defHttp.post({ url: '/system/oauth2-client/create', data }) return defHttp.post({ url: '/system/oauth2-client/create', data });
} }
// 修改 OAuth2 // 修改 OAuth2
export function updateOAuth2Client(data: OAuth2ClientVO) { export function updateOAuth2Client(data: OAuth2ClientVO) {
return defHttp.put({ url: '/system/oauth2-client/update', data }) return defHttp.put({ url: '/system/oauth2-client/update', data });
} }
// 删除 OAuth2 // 删除 OAuth2
export function deleteOAuth2Client(id: number) { export function deleteOAuth2Client(id: number) {
return defHttp.delete({ url: '/system/oauth2-client/delete?id=' + id }) return defHttp.delete({ url: '/system/oauth2-client/delete?id=' + id });
} }

View File

@ -1,28 +1,28 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface OAuth2TokenVO { export interface OAuth2TokenVO {
id: number id: number;
accessToken: string accessToken: string;
refreshToken: string refreshToken: string;
userId: number userId: number;
userType: number userType: number;
clientId: string clientId: string;
createTime: Date createTime: Date;
expiresTime: Date expiresTime: Date;
} }
export interface OAuth2TokenPageReqVO extends PageParam { export interface OAuth2TokenPageReqVO extends PageParam {
userId?: number userId?: number;
userType?: number userType?: number;
clientId?: string clientId?: string;
} }
// 查询 token列表 // 查询 token列表
export function getAccessTokenPage(params: OAuth2TokenPageReqVO) { export function getAccessTokenPage(params: OAuth2TokenPageReqVO) {
return defHttp.get({ url: '/system/oauth2-token/page', params }) return defHttp.get({ url: '/system/oauth2-token/page', params });
} }
// 删除 token // 删除 token
export function deleteAccessToken(accessToken: number) { export function deleteAccessToken(accessToken: number) {
return defHttp.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken }) return defHttp.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken });
} }

View File

@ -1,41 +1,41 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface OperateLogVO { export interface OperateLogVO {
id: number id: number;
userNickname: string userNickname: string;
traceId: string traceId: string;
userId: number userId: number;
module: string module: string;
name: string name: string;
type: number type: number;
content: string content: string;
exts: Map<String, Object> exts: Map<string, Object>;
defHttpMethod: string defHttpMethod: string;
defHttpUrl: string defHttpUrl: string;
userIp: string userIp: string;
userAgent: string userAgent: string;
javaMethod: string javaMethod: string;
javaMethodArgs: string javaMethodArgs: string;
startTime: Date startTime: Date;
duration: number duration: number;
resultCode: number resultCode: number;
resultMsg: string resultMsg: string;
resultData: string resultData: string;
} }
export interface OperateLogPageReqVO extends PageParam { export interface OperateLogPageReqVO extends PageParam {
module?: string module?: string;
userNickname?: string userNickname?: string;
type?: number type?: number;
success?: boolean success?: boolean;
startTime?: Date[] startTime?: Date[];
} }
// 查询操作日志列表 // 查询操作日志列表
export function getOperateLogPage(params: OperateLogPageReqVO) { export function getOperateLogPage(params: OperateLogPageReqVO) {
return defHttp.get({ url: '/system/operate-log/page', params }) return defHttp.get({ url: '/system/operate-log/page', params });
} }
// 导出操作日志 // 导出操作日志
export function exportOperateLog(params: OperateLogPageReqVO) { export function exportOperateLog(params: OperateLogPageReqVO) {
return defHttp.download({ url: '/system/operate-log/export', params }, '操作日志.xls') return defHttp.download({ url: '/system/operate-log/export', params }, '操作日志.xls');
} }

View File

@ -1,42 +1,42 @@
import { defHttp } from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios';
export interface PermissionAssignUserRoleReqVO { export interface PermissionAssignUserRoleReqVO {
userId: number userId: number;
roleIds: number[] roleIds: number[];
} }
export interface PermissionAssignRoleMenuReqVO { export interface PermissionAssignRoleMenuReqVO {
roleId: number roleId: number;
menuIds: number[] menuIds: number[];
} }
export interface PermissionAssignRoleDataScopeReqVO { export interface PermissionAssignRoleDataScopeReqVO {
roleId: number roleId: number;
dataScope: number dataScope: number;
dataScopeDeptIds: number[] dataScopeDeptIds: number[];
} }
// 查询角色拥有的菜单权限 // 查询角色拥有的菜单权限
export function listRoleMenus(roleId: number) { export function listRoleMenus(roleId: number) {
return defHttp.get({ url: '/system/permission/list-role-resources?roleId=' + roleId }) return defHttp.get({ url: '/system/permission/list-role-resources?roleId=' + roleId });
} }
// 赋予角色菜单权限 // 赋予角色菜单权限
export function assignRoleMenu(data: PermissionAssignRoleMenuReqVO) { export function assignRoleMenu(data: PermissionAssignRoleMenuReqVO) {
return defHttp.post({ url: '/system/permission/assign-role-menu', data }) return defHttp.post({ url: '/system/permission/assign-role-menu', data });
} }
// 赋予角色数据权限 // 赋予角色数据权限
export function assignRoleDataScope(data: PermissionAssignRoleDataScopeReqVO) { export function assignRoleDataScope(data: PermissionAssignRoleDataScopeReqVO) {
return defHttp.post({ url: '/system/permission/assign-role-data-scope', data }) return defHttp.post({ url: '/system/permission/assign-role-data-scope', data });
} }
// 查询用户拥有的角色数组 // 查询用户拥有的角色数组
export function listUserRoles(userId: number) { export function listUserRoles(userId: number) {
return defHttp.get({ url: '/system/permission/list-user-roles?userId=' + userId }) return defHttp.get({ url: '/system/permission/list-user-roles?userId=' + userId });
} }
// 赋予用户角色 // 赋予用户角色
export function assignUserRole(data: PermissionAssignUserRoleReqVO) { export function assignUserRole(data: PermissionAssignUserRoleReqVO) {
return defHttp.post({ url: '/system/permission/assign-user-role', data }) return defHttp.post({ url: '/system/permission/assign-user-role', data });
} }

Some files were not shown because too many files have changed in this diff Show More