chore: eslint

pull/5/head
xingyu 2023-04-27 17:35:45 +08:00
parent a282f70aef
commit f11a881dda
809 changed files with 24625 additions and 24084 deletions

View File

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

View File

@ -1,53 +1,68 @@
module.exports = {
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: {
browser: true,
node: true,
es6: true
es6: true,
},
parser: 'vue-eslint-parser',
plugins: ['vue'],
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
jsxPragma: 'React',
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: {
'max-len': ['error', { code: 140, tabWidth: 2, ignoreComments: true }],
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': '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-console': 'warn',
'no-unused-vars': 'off',
'no-case-declarations': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'space-before-function-paren': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/no-unresolved': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
varsIgnorePattern: '^_',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'space-before-function-paren': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': '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/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
@ -57,18 +72,134 @@ module.exports = {
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/prefer-import-from-vue': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always'
component: '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'],
},
};

View File

@ -1,8 +1,9 @@
// .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'
}
'*.{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,9 +1,11 @@
/dist/*
dist
.local
.output.js
/node_modules/**
node_modules
.nvmrc
**/*.svg
**/*.sh
/public/*
public
.npmrc

View File

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

53
.vscode/settings.json vendored
View File

@ -1,12 +1,12 @@
{
"typescript.tsdk": "./node_modules/typescript/lib",
"volar.tsPlugin": true,
"volar.tsPluginStatus": false,
"npm.packageManager": "pnpm",
"editor.tabSize": 2,
"prettier.printWidth": 140, //
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.eol": "\n",
"npm.packageManager": "pnpm",
"eslint.packageManager": "pnpm",
"stylelint.packageManager": "pnpm",
"search.exclude": {
"**/node_modules": true,
"**/*.log": true,
@ -57,23 +57,20 @@
},
"stylelint.enable": true,
"stylelint.validate": ["css", "less", "postcss", "scss", "vue", "sass"],
"path-intellisense.mappings": {
"@/": "${workspaceRoot}/src"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
@ -85,7 +82,8 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"[vue]": {
"editor.codeActionsOnSave": {
@ -104,14 +102,10 @@
"i18n-ally.enabledFrameworks": ["vue", "react"],
"cSpell.words": [
"vben",
"windicss",
"tailwind",
"browserslist",
"tailwindcss",
"esnext",
"antv",
"tinymce",
"qrcode",
"sider",
"pinia",
"sider",
@ -121,10 +115,10 @@
"esno",
"vitejs",
"sortablejs",
"mockjs",
"codemirror",
"iconify",
"commitlint",
"vditor",
"echarts",
"cropperjs",
"logicflow",
@ -132,30 +126,11 @@
"zxcvbn",
"lintstagedrc",
"brotli",
"tailwindcss",
"sider",
"pnpm",
"antd"
],
"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
}
"antd",
"unref"
],
//
"explorer.fileNesting.enabled": true,
@ -164,7 +139,9 @@
"*.ts": "$(capture).test.ts, $(capture).test.tsx",
"*.tsx": "$(capture).test.ts, $(capture).test.tsx",
"*.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
}

View File

@ -9,7 +9,7 @@
如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。
## 原框架地址 各位大佬点个star
## 原框架地址 各位大佬点个 star
- [gitee](https://gitee.com/xingyuv/vue-vben-admin)
- [github](https://github.com/xingyuv/vue-vben-admin)
@ -29,24 +29,24 @@
- 系统管理 页面适配 99%
- 基础设施 页面适配 99%
- 支付管理 页面适配 99%
- 公众号 页面适配 40%
- 仿钉钉工作流 进行中40% 预计5月底
- 升级 antdv 4.0 预计5月底
- 公众号 页面适配 40%
- 仿钉钉工作流 进行中 40% 预计 5 月底
- 升级 antdv 4.0 预计 5 月底
## 框架
| 框架 | 说明 | 版本 |
| --- | --- | --- |
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.3 |
| [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.19 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 |
| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 |
| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 |
| 框架 | 说明 | 版本 |
| -------------------------------------------------------------------- | ------------------------- | ------ |
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.3 |
| [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.19 |
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 |
| [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 |
| [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.1.6 |
| [windicss](https://cn.windicss.org/) | 下一代工具优先的 CSS 框架 | 3.5.6 |
| [iconify](https://icon-sets.iconify.design/) | 在线图标库 | 3.1.0 |
<p align="center">
<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">
</p>
## 准备
- [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 {
mixLighten: Fn
mixDarken: Fn
tinycolor: any
color?: string
mixLighten: Fn;
mixDarken: Fn;
tinycolor: any;
color?: string;
}
export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
return generate(color, {
theme
})
theme,
});
}
export function getThemeColors(color?: string) {
const tc = color || primaryColor
const lightColors = generateAntColors(tc)
const primary = lightColors[5]
const modeColors = generateAntColors(primary, 'dark')
const tc = color || primaryColor;
const lightColors = generateAntColors(tc);
const primary = lightColors[5];
const modeColors = generateAntColors(primary, 'dark');
return [...lightColors, ...modeColors]
return [...lightColors, ...modeColors];
}
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) => {
return mixLighten(color, i / 5)
})
return mixLighten(color, i / 5);
});
const darkens = arr.map((_t, i) => {
return mixDarken(color, i / 5)
})
return mixDarken(color, i / 5);
});
const alphaColors = arr.map((_t, i) => {
return tinycolor(color)
.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
.map((_t, i) => {
return tinycolor(color)
.lighten(i * 5)
.toHexString()
.toHexString();
})
.filter((item) => item !== '#ffffff')
.filter((item) => item !== '#ffffff');
const tinycolorDarkens = arr
.map((_t, i) => {
return tinycolor(color)
.darken(i * 5)
.toHexString()
.toHexString();
})
.filter((item) => item !== '#000000')
.filter((item) => item !== '#000000');
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
*/
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 { getThemeVariables } from 'ant-design-vue/dist/theme'
import { resolve } from 'path'
import { generateAntColors, primaryColor } from '../config/themeConfig';
import { getThemeVariables } from 'ant-design-vue/dist/theme';
import { resolve } from 'path';
/**
* less global variable
*/
export function generateModifyVars(dark = false) {
const palettes = generateAntColors(primaryColor)
const primary = palettes[5]
const palettes = generateAntColors(primaryColor);
const primary = palettes[5];
const primaryColorObj: Record<string, string> = {}
const primaryColorObj: Record<string, string> = {};
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 {
...modifyVars,
// 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
'border-radius-base': '2px', // Component/float fillet
'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 fs from 'fs-extra'
import inquirer from 'inquirer'
import colors from 'picocolors'
import pkg from '../../../package.json'
import path from 'path';
import fs from 'fs-extra';
import inquirer from 'inquirer';
import colors from 'picocolors';
import pkg from '../../../package.json';
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]) => ({
...(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
.prompt([
@ -23,46 +23,46 @@ async function generateIcon() {
name: 'useType',
choices: [
{ 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',
name: 'iconSet',
choices: choices,
message: 'Select the icon set that needs to be generated?'
message: 'Select the icon set that needs to be generated?',
},
{
type: 'input',
name: 'output',
message: 'Select the icon set that needs to be generated?',
default: 'src/components/Icon/data'
}
default: 'src/components/Icon/data',
},
])
.then(async (answers) => {
const { iconSet, output, useType } = answers
const outputDir = path.resolve(process.cwd(), output)
await fs.ensureDir(outputDir)
const genCollections = collections.filter((item) => [iconSet].includes(item.id))
const prefixSet: string[] = []
const { iconSet, output, useType } = answers;
const outputDir = path.resolve(process.cwd(), output);
await fs.ensureDir(outputDir);
const genCollections = collections.filter((item) => [iconSet].includes(item.id));
const prefixSet: string[] = [];
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) {
const { prefix } = data
const isLocal = useType === 'local'
const icons = Object.keys(data.icons).map((item) => `${isLocal ? prefix + ':' : ''}${item}`)
const { prefix } = data;
const isLocal = useType === 'local';
const icons = Object.keys(data.icons).map((item) => `${isLocal ? prefix + ':' : ''}${item}`);
await fs.writeFileSync(
path.join(output, `icons.data.ts`),
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`
)
prefixSet.push(prefix)
`export default ${isLocal ? JSON.stringify(icons) : JSON.stringify({ prefix, icons })}`,
);
prefixSet.push(prefix);
}
}
await fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'))
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`)
})
await fs.emptyDir(path.join(process.cwd(), 'node_modules/.vite'));
console.log(`${colors.cyan(`[${pkg.name}]`)}` + ' - Icon generated successfully:' + `[${prefixSet}]`);
});
}
generateIcon()
generateIcon();

View File

@ -3,5 +3,5 @@
* @param env
*/
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
*/
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant'
import fs, { writeFileSync } from 'fs-extra'
import colors from 'picocolors'
import { GLOB_CONFIG_FILE_NAME, OUTPUT_DIR } from '../constant';
import fs, { writeFileSync } from 'fs-extra';
import colors from 'picocolors';
import { getEnvConfig, getRootPath } from '../utils'
import { getConfigFileName } from '../getConfigFileName'
import { getEnvConfig, getRootPath } from '../utils';
import { getConfigFileName } from '../getConfigFileName';
import pkg from '../../package.json'
import pkg from '../../package.json';
interface CreateConfigParams {
configName: string
config: any
configFileName?: string
configName: string;
config: any;
configFileName?: string;
}
function createConfig(params: CreateConfigParams) {
const { configName, config, configFileName } = params
const { configName, config, configFileName } = params;
try {
const windowConf = `window.${configName}`
const windowConf = `window.${configName}`;
// Ensure that the variable will not be modified
let configStr = `${windowConf}=${JSON.stringify(config)};`
let configStr = `${windowConf}=${JSON.stringify(config)};`;
configStr += `
Object.freeze(${windowConf});
Object.defineProperty(window, "${configName}", {
configurable: false,
writable: false,
});
`.replace(/\s/g, '')
`.replace(/\s/g, '');
fs.mkdirp(getRootPath(OUTPUT_DIR))
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr)
fs.mkdirp(getRootPath(OUTPUT_DIR));
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`)
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n')
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
} 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() {
const config = getEnvConfig()
const configFileName = getConfigFileName(config)
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME })
const config = getEnvConfig();
const configFileName = getConfigFileName(config);
createConfig({ config, configName: configFileName, configFileName: GLOB_CONFIG_FILE_NAME });
}

View File

@ -1,23 +1,23 @@
// #!/usr/bin/env node
import { runBuildConfig } from './buildConf'
import colors from 'picocolors'
import { runBuildConfig } from './buildConf';
import colors from 'picocolors';
import pkg from '../../package.json'
import pkg from '../../package.json';
export const runBuild = async () => {
try {
const argvList = process.argv.splice(2)
const argvList = process.argv.splice(2);
// Generate configuration file
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) {
console.log(colors.red('vite build error:\n' + error))
process.exit(1)
console.log(colors.red('vite build error:\n' + error));
process.exit(1);
}
}
runBuild()
};
runBuild();

View File

@ -1,62 +1,62 @@
import fs from 'fs'
import path from 'path'
import dotenv from 'dotenv'
import fs from 'fs';
import path from 'path';
import dotenv from 'dotenv';
export function isDevFn(mode: string): boolean {
return mode === 'development'
return mode === 'development';
}
export function isProdFn(mode: string): boolean {
return mode === 'production'
return mode === 'production';
}
/**
* Whether to generate package preview
*/
export function isReportMode(): boolean {
return process.env.REPORT === 'true'
return process.env.REPORT === 'true';
}
// Read all environment variable configuration files to process.env
export function wrapperEnv(envConf: Recordable): ViteEnv {
const ret: any = {}
const ret: any = {};
for (const envName of Object.keys(envConf)) {
let realName = envConf[envName].replace(/\\n/g, '\n')
realName = realName === 'true' ? true : realName === 'false' ? false : realName
let realName = envConf[envName].replace(/\\n/g, '\n');
realName = realName === 'true' ? true : realName === 'false' ? false : realName;
if (envName === 'VITE_PORT') {
realName = Number(realName)
realName = Number(realName);
}
if (envName === 'VITE_PROXY' && realName) {
try {
realName = JSON.parse(realName.replace(/'/g, '"'))
realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) {
realName = ''
realName = '';
}
}
ret[envName] = realName
ret[envName] = realName;
// if (typeof realName === 'string') {
// process.env[envName] = realName;
// } else if (typeof realName === 'object') {
// process.env[envName] = JSON.stringify(realName);
// }
}
return ret
return ret;
}
/**
*
*/
function getConfFiles() {
const script = process.env.npm_lifecycle_script
const reg = new RegExp('--mode ([a-z_\\d]+)')
const result = reg.exec(script as string) as any
const script = process.env.npm_lifecycle_script;
const reg = new RegExp('--mode ([a-z_\\d]+)');
const result = reg.exec(script as string) as any;
if (result) {
const mode = result[1] as string
return ['.env', `.env.${mode}`]
const mode = result[1] as string;
return ['.env', `.env.${mode}`];
}
return ['.env', '.env.production']
return ['.env', '.env.production'];
}
/**
@ -65,22 +65,22 @@ function getConfFiles() {
* @param confFiles ext
*/
export function getEnvConfig(match = 'VITE_GLOB_', confFiles = getConfFiles()) {
let envConfig = {}
let envConfig = {};
confFiles.forEach((item) => {
try {
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)))
envConfig = { ...envConfig, ...env }
const env = dotenv.parse(fs.readFileSync(path.resolve(process.cwd(), item)));
envConfig = { ...envConfig, ...env };
} 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) => {
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
*/
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/locale/zh_CN',
'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
* https://github.com/anncwb/vite-plugin-compression
*/
import type { PluginOption } from 'vite'
import compressPlugin from 'vite-plugin-compression'
import type { PluginOption } from 'vite';
import compressPlugin from 'vite-plugin-compression';
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')) {
plugins.push(
compressPlugin({
ext: '.gz',
deleteOriginFile
})
)
deleteOriginFile,
}),
);
}
if (compressList.includes('brotli')) {
@ -24,9 +24,9 @@ export function configCompressPlugin(compress: 'gzip' | 'brotli' | 'none', delet
compressPlugin({
ext: '.br',
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.
* https://github.com/xingyuv/vite-vue-plugin-html
*/
import type { PluginOption } from 'vite'
import { createHtmlPlugin } from 'vite-vue-plugin-html'
import pkg from '../../../package.json'
import { GLOB_CONFIG_FILE_NAME } from '../../constant'
import type { PluginOption } from 'vite';
import { createHtmlPlugin } from 'vite-vue-plugin-html';
import pkg from '../../../package.json';
import { GLOB_CONFIG_FILE_NAME } from '../../constant';
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 = () => {
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({
minify: isBuild,
inject: {
// Inject data into ejs template
data: {
title: VITE_GLOB_APP_TITLE
title: VITE_GLOB_APP_TITLE,
},
// Embed the generated app.config.js file
tags: isBuild
@ -29,12 +29,12 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) {
{
tag: 'script',
attrs: {
src: getAppConfigSrc()
}
}
src: getAppConfigSrc(),
},
},
]
: []
}
})
return htmlPlugin
: [],
},
});
return htmlPlugin;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -2,48 +2,48 @@
* Vite plugin for website theme color switching
* https://github.com/xingyuv/vite-vue-plugin-theme
*/
import type { PluginOption } from 'vite'
import path from 'path'
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme'
import { getThemeColors, generateColors } from '../../config/themeConfig'
import { generateModifyVars } from '../../generate/generateModifyVars'
import type { PluginOption } from 'vite';
import path from 'path';
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-vue-plugin-theme';
import { getThemeColors, generateColors } from '../../config/themeConfig';
import { generateModifyVars } from '../../generate/generateModifyVars';
export function configThemePlugin(isBuild: boolean): PluginOption[] {
const colors = generateColors({
mixDarken,
mixLighten,
tinycolor
})
tinycolor,
});
const plugin = [
viteThemePlugin({
resolveSelector: (s) => {
s = s.trim()
s = s.trim();
switch (s) {
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):hover':
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':
return s
return s;
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
return s
return s;
default:
if (s.indexOf('.ant-btn') >= -1) {
// 按钮被重新定制过需要过滤掉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({
preloadFiles: [
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(), 'src/design/index.less')
path.resolve(process.cwd(), 'src/design/index.less'),
],
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
// extractCss: false,
@ -74,10 +74,10 @@ export function configThemePlugin(isBuild: boolean): PluginOption[] {
'alert-warning-icon-color': '#d89614',
'alert-error-border-color': '#58181c',
'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
*/
import visualizer from 'rollup-plugin-visualizer'
import { isReportMode } from '../../utils'
import { PluginOption } from 'vite'
import visualizer from 'rollup-plugin-visualizer';
import { isReportMode } from '../../utils';
import { PluginOption } from 'vite';
export function configVisualizerConfig() {
if (isReportMode()) {
@ -11,8 +11,8 @@ export function configVisualizerConfig() {
filename: './node_modules/.cache/visualizer/stats.html',
open: true,
gzipSize: true,
brotliSize: true
}) as PluginOption
brotliSize: true,
}) as PluginOption;
}
return []
return [];
}

View File

@ -1,24 +1,24 @@
/**
* 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
* @param list
*/
export function createProxy(list: ProxyList = []) {
const ret: ProxyTargetList = {}
const ret: ProxyTargetList = {};
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
ret[prefix] = {
@ -27,8 +27,8 @@ export function createProxy(list: ProxyList = []) {
ws: true,
rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
// https is require secure=false
...(isHttps ? { secure: false } : {})
}
...(isHttps ? { secure: false } : {}),
};
}
return ret
return ret;
}

View File

@ -1,11 +1,11 @@
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')
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$/, ''))
.map((dirent) => dirent.name.replace(/s$/, ''));
// precomputed scope
const scopeComplete = execSync('git status --porcelain || true')
@ -15,7 +15,7 @@ const scopeComplete = execSync('git status --porcelain || true')
.find((r) => ~r.indexOf('M src'))
?.replace(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '')
?.replace(/s$/, '');
/** @type {import('cz-git').UserConfig} */
module.exports = {
@ -31,8 +31,8 @@ module.exports = {
'type-enum': [
2,
'always',
['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release']
]
['feat', 'fix', 'perf', 'style', 'docs', 'test', 'refactor', 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release'],
],
},
prompt: {
/** @use `yarn commit :f` */
@ -41,7 +41,7 @@ module.exports = {
r: 'docs: update README',
s: 'style: update code format',
b: 'build: bump dependencies',
c: 'chore: update config'
c: 'chore: update config',
},
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
defaultScope: scopeComplete,
@ -53,39 +53,39 @@ module.exports = {
typesAppend: [
{ value: 'wip', name: 'wip: work in process' },
{ value: 'workflow', name: 'workflow: workflow improvements' },
{ value: 'types', name: 'types: type definition file changes' }
{ 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: 自定义'
}
}
// 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",
"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": {
"name": "xingyuv",
"email": "xingyu4j@vip.qq.com",
"url": "https://github.com/xingyuv"
},
"scripts": {
"commit": "czg",
"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: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",
"report": "cross-env REPORT=true npm run build",
"type:check": "vue-tsc --noEmit --skipLibCheck",
"preview": "npm run build && vite preview",
"preview:dist": "vite preview",
"log": "conventional-changelog -p angular -i CHANGELOG.md -s",
"build:static": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode static && 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",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"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:prettier": "prettier --write \"src/**/*.{js,json,ts,tsx,css,less,scss,vue,html,md}\"",
"lint:stylelint": "stylelint \"**/*.{vue,css,less,postcss,scss}\" --fix --cache --cache-location node_modules/.cache/stylelint/",
"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",
"reinstall": "rimraf pnpm-lock.yaml && rimraf package.lock.json && rimraf node_modules && npm run bootstrap",
"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": {
"@ant-design/colors": "^7.0.0",
@ -93,12 +131,19 @@
"dotenv": "^16.0.3",
"eslint": "^8.39.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-regexp": "^1.14.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.11.0",
"esno": "^0.16.3",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"inquirer": "^9.2.0",
"jsonc-eslint-parser": "^2.2.0",
"less": "^4.1.3",
"lint-staged": "^13.2.2",
"picocolors": "^1.0.0",
@ -106,13 +151,14 @@
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"prettier": "^2.8.8",
"prettier-plugin-packagejson": "^2.4.3",
"rimraf": "^5.0.0",
"rollup": "^3.21.0",
"rollup-plugin-visualizer": "^5.9.0",
"stylelint": "^15.6.0",
"stylelint-config-recess-order": "^4.0.0",
"stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-recess-order": "^4.0.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-order": "^6.0.3",
"stylelint-prettier": "^3.0.0",
@ -133,47 +179,9 @@
"vue-eslint-parser": "^9.1.1",
"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",
"engines": {
"node": ">= 16.0.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 = {
plugins: {
autoprefixer: {}
}
}
autoprefixer: {},
},
};

View File

@ -1,37 +1,27 @@
module.exports = {
// 一行代码的最大字符数默认是80
printWidth: 140,
// tab宽度为2空格
tabWidth: 2,
// 使用tab缩进默认false
useTabs: false,
// 结尾是否添加分号, 默认true
semi: false,
// vue script和style标签中是否缩进,开启可能会破坏编辑器的代码折叠
semi: true,
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,
trailingComma: 'all',
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
// endOfLine: "<lf|crlf|cr|auto>" 行尾换行符,默认是lf
endOfLine: 'auto',
// range是format执行的范围可以选执行一个文件的一部分默认的设置是整个文件
rangeStart: 0,
rangeEnd: Infinity
}
plugins: ['prettier-plugin-packagejson'],
overrides: [
{
files: '.*rc',
options: {
parser: 'json',
},
},
{
files: '*.html',
options: {
parser: 'html',
},
},
],
};

View File

@ -7,21 +7,21 @@
</template>
<script lang="ts" setup>
import { computed } from 'vue'
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 { computed } from 'vue';
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 'dayjs/locale/zh-cn';
// 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
useTitle()
useTitle();
</script>

View File

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

View File

@ -1,8 +1,8 @@
import { defHttp } from '@/utils/http/axios'
import { getMenuListResultModel } from './model/menuModel'
import { defHttp } from '@/utils/http/axios';
import { getMenuListResultModel } from './model/menuModel';
enum Api {
GetMenuList = '/system/auth/list-menus'
GetMenuList = '/system/auth/list-menus',
}
/**
@ -10,5 +10,5 @@ enum Api {
*/
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 = {
username: string
password: string
captchaVerification: string
}
username: string;
password: string;
captchaVerification: string;
};
export type TentantNameVO = {
id: number
}
id: number;
};

View File

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

View File

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

View File

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

View File

@ -1,54 +1,54 @@
import { ContentTypeEnum } from '@/enums/httpEnum'
import { defHttp } from '@/utils/http/axios'
import { ContentTypeEnum } from '@/enums/httpEnum';
import { defHttp } from '@/utils/http/axios';
export interface ProfileDept {
id: number
name: string
id: number;
name: string;
}
export interface ProfileRole {
id: number
name: string
id: number;
name: string;
}
export interface ProfilePost {
id: number
name: string
id: number;
name: string;
}
export interface SocialUser {
id: number
type: number
openid: string
token: string
rawTokenInfo: string
nickname: string
avatar: string
rawUserInfo: string
code: string
state: string
id: number;
type: number;
openid: string;
token: string;
rawTokenInfo: string;
nickname: string;
avatar: string;
rawUserInfo: string;
code: string;
state: string;
}
export interface ProfileVO {
id: number
username: string
nickname: string
dept: ProfileDept
roles: ProfileRole[]
posts: ProfilePost[]
socialUsers: SocialUser[]
email: string
mobile: string
sex: number
avatar: string
status: number
remark: string
loginIp: string
loginDate: Date
createTime: Date
id: number;
username: string;
nickname: string;
dept: ProfileDept;
roles: ProfileRole[];
posts: ProfilePost[];
socialUsers: SocialUser[];
email: string;
mobile: string;
sex: number;
avatar: string;
status: number;
remark: string;
loginIp: string;
loginDate: Date;
createTime: Date;
}
export interface UserProfileUpdateReqVO {
nickname: string
email: string
mobile: string
sex: number
nickname: string;
email: string;
mobile: string;
sex: number;
}
enum Api {
@ -57,21 +57,21 @@ enum Api {
uploadAvatarApi = '/system/user/profile/update-avatar',
updateUserPwdApi = '/system/user/profile/update-password',
socialBindApi = '/system/social-user/bind',
socialUnbindApi = '/system/social-user/unbind'
socialUnbindApi = '/system/social-user/unbind',
}
/**
* @description: getUserProfileApi
*/
export function getUserProfileApi() {
return defHttp.get({ url: Api.getUserProfileApi })
return defHttp.get({ url: Api.getUserProfileApi });
}
/**
* @description: updateUserProfileApi
*/
export function updateUserProfileApi(data: UserProfileUpdateReqVO) {
return defHttp.put({ url: Api.putUserProfileApi, data })
return defHttp.put({ url: Api.putUserProfileApi, data });
}
// 用户密码重置
@ -80,9 +80,9 @@ export function updateUserPwdApi(oldPassword: string, newPassword: string) {
url: Api.updateUserPwdApi,
data: {
oldPassword: oldPassword,
newPassword: newPassword
}
})
newPassword: newPassword,
},
});
}
// 用户头像上传
@ -92,10 +92,10 @@ export function uploadAvatarApi(data) {
headers: {
'Content-type': ContentTypeEnum.FORM_DATA,
// @ts-ignore
ignoreCancelToken: true
ignoreCancelToken: true,
},
data
})
data,
});
}
// 社交绑定,使用 code 授权码
@ -105,9 +105,9 @@ export function socialBind(type, code, state) {
data: {
type,
code,
state
}
})
state,
},
});
}
// 取消社交绑定
@ -116,14 +116,14 @@ export function socialUnbind(type, openid) {
url: Api.socialUnbindApi,
data: {
type,
openid
}
})
openid,
},
});
}
// 社交授权的跳转
export function socialAuthRedirect(type, redirectUri) {
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,10 @@
import { UploadApiResult } from './model/uploadModel'
import { defHttp } from '@/utils/http/axios'
import { UploadFileParams } from '@/types/axios'
import { useGlobSetting } from '@/hooks/setting'
import { AxiosProgressEvent } from 'axios'
import { UploadApiResult } from './model/uploadModel';
import { defHttp } from '@/utils/http/axios';
import { UploadFileParams } from '@/types/axios';
import { useGlobSetting } from '@/hooks/setting';
import { AxiosProgressEvent } from 'axios';
const { uploadUrl = '' } = useGlobSetting()
const { uploadUrl = '' } = useGlobSetting();
/**
* @description: Upload interface
@ -13,8 +13,8 @@ export function uploadApi(params: UploadFileParams, onUploadProgress: (progressE
return defHttp.uploadFile<UploadApiResult>(
{
url: uploadUrl,
onUploadProgress
onUploadProgress,
},
params
)
params,
);
}

View File

@ -1,12 +1,12 @@
import { defHttp } from '@/utils/http/axios'
import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel'
import { defHttp } from '@/utils/http/axios';
import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel';
import { ErrorMessageMode } from '@/types/axios'
import { ErrorMessageMode } from '@/types/axios';
enum Api {
Login = '/system/auth/login',
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>(
{
url: Api.Login,
params
params,
},
{
errorMessageMode: mode
}
)
errorMessageMode: mode,
},
);
}
/**
* @description: 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() {
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) {
return defHttp.get({ url: '/bpm/process-definition/page', params })
return defHttp.get({ url: '/bpm/process-definition/page', 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) {
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 = {
id: number
name: string
conf: string
fields: string[]
status: number
remark: string
createTime: string
}
id: number;
name: string;
conf: string;
fields: string[];
status: number;
remark: string;
createTime: string;
};
// 创建工作流的表单定义
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) {
return defHttp.put({ url: '/bpm/form/update', data })
return defHttp.put({ url: '/bpm/form/update', data });
}
// 删除工作流的表单定义
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) {
return defHttp.get({ url: '/bpm/form/get?id=' + id })
return defHttp.get({ url: '/bpm/form/get?id=' + id });
}
// 获得工作流的表单定义分页
export function getFormPage(params) {
return defHttp.get({ url: '/bpm/form/page', params })
return defHttp.get({ url: '/bpm/form/page', params });
}
// 获得动态表单的精简列表
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 = {
id: number
result: number
type: number
reason: string
processInstanceId: string
startTime: string
endTime: string
createTime: string
}
id: number;
result: number;
type: number;
reason: string;
processInstanceId: string;
startTime: string;
endTime: string;
createTime: string;
};
// 创建请假申请
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) {
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id })
return defHttp.get({ url: '/bpm/oa/leave/get?id=' + id });
}
// 获得请假申请分页
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 = {
id: string
version: number
deploymentTIme: string
suspensionState: number
}
id: string;
version: number;
deploymentTIme: string;
suspensionState: number;
};
export type ModelVO = {
id: number
formName: string
key: string
name: string
description: string
category: string
formType: number
formId: number
formCustomCreatePath: string
formCustomViewPath: string
processDefinition: ProcessDefinitionVO
status: number
remark: string
createTime: string
}
id: number;
formName: string;
key: string;
name: string;
description: string;
category: string;
formType: number;
formId: number;
formCustomCreatePath: string;
formCustomViewPath: string;
processDefinition: ProcessDefinitionVO;
status: number;
remark: string;
createTime: string;
};
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) {
return defHttp.get({ url: '/bpm/model/get?id=' + id })
return defHttp.get({ url: '/bpm/model/get?id=' + id });
}
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) {
const data = {
id: id,
state: state
}
return defHttp.put({ url: '/bpm/model/update-state', data })
state: state,
};
return defHttp.put({ url: '/bpm/model/update-state', data });
}
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) {
return defHttp.delete({ url: '/bpm/model/delete?id=' + id })
return defHttp.delete({ url: '/bpm/model/delete?id=' + id });
}
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 = {
id: string
name: string
}
id: string;
name: string;
};
export type ProcessInstanceVO = {
id: number
name: string
processDefinitionId: string
category: string
result: number
tasks: task[]
fields: string[]
status: number
remark: string
businessKey: string
createTime: string
endTime: string
}
id: number;
name: string;
processDefinitionId: string;
category: string;
result: number;
tasks: task[];
fields: string[];
status: number;
remark: string;
businessKey: string;
createTime: string;
endTime: string;
};
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) {
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) {
const data = {
id: id,
reason: reason
}
return defHttp.delete({ url: '/bpm/process-instance/cancel', data })
reason: reason,
};
return defHttp.delete({ url: '/bpm/process-instance/cancel', data });
}
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) {
return defHttp.get({ url: '/bpm/task/todo-page', params })
return defHttp.get({ url: '/bpm/task/todo-page', 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) {
return defHttp.put({ url: '/bpm/task/complete', data })
return defHttp.put({ url: '/bpm/task/complete', 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) {
return defHttp.put({ url: '/bpm/task/reject', data })
return defHttp.put({ url: '/bpm/task/reject', 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) {
return defHttp.put({ url: '/bpm/task/update-assignee', data })
return defHttp.put({ url: '/bpm/task/update-assignee', data });
}
export function getTaskListByProcessInstanceId(processInstanceId) {
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 = {
id: number
name: string
conf: string
fields: string[]
status: number
remark: string
createTime: string
}
id: number;
name: string;
conf: string;
fields: string[];
status: number;
remark: string;
createTime: string;
};
export type TaskProcessVO = {
id: string
name: string
startUserId: number
startUserNickname: string
processDefinitionId: string
}
id: string;
name: string;
startUserId: number;
startUserNickname: string;
processDefinitionId: string;
};
export type TaskTodoVO = {
id: string
name: string
claimTime: string
createTime: string
suspensionState: number
processInstance: TaskProcessVO
}
id: string;
name: string;
claimTime: string;
createTime: string;
suspensionState: number;
processInstance: TaskProcessVO;
};
export type TaskDoneVO = {
id: string
name: string
claimTime: string
createTime: string
endTime: string
durationInMillis: number
suspensionState: number
result: number
reason: string
processInstance: TaskProcessVO
}
id: string;
name: string;
claimTime: string;
createTime: string;
endTime: string;
durationInMillis: number;
suspensionState: number;
result: number;
reason: string;
processInstance: TaskProcessVO;
};

View File

@ -1,23 +1,23 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export type TaskAssignVO = {
id: number
modelId: string
processDefinitionId: string
taskDefinitionKey: string
taskDefinitionName: string
options: string[]
type: number
}
id: number;
modelId: string;
processDefinitionId: string;
taskDefinitionKey: string;
taskDefinitionName: string;
options: string[];
type: number;
};
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) {
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) {
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 = {
id: number
name: string
description: string
memberUserIds: number[]
status: number
remark: string
createTime: string
}
id: number;
name: string;
description: string;
memberUserIds: number[];
status: number;
remark: string;
createTime: string;
};
// 创建用户组
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) {
return defHttp.put({ url: '/bpm/user-group/update', data })
return defHttp.put({ url: '/bpm/user-group/update', data });
}
// 删除用户组
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) {
return defHttp.get({ url: '/bpm/user-group/get?id=' + id })
return defHttp.get({ url: '/bpm/user-group/get?id=' + id });
}
// 获得用户组分页
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() {
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 {
id: number
traceId: string
userId: number
userType: number
applicationName: string
requestMethod: string
requestParams: string
requestUrl: string
userIp: string
userAgent: string
beginTime: Date
endTIme: Date
duration: number
resultCode: number
resultMsg: string
createTime: Date
id: number;
traceId: string;
userId: number;
userType: number;
applicationName: string;
requestMethod: string;
requestParams: string;
requestUrl: string;
userIp: string;
userAgent: string;
beginTime: Date;
endTIme: Date;
duration: number;
resultCode: number;
resultMsg: string;
createTime: Date;
}
export interface ApiAccessLogPageReqVO extends PageParam {
userId?: number
userType?: number
applicationName?: string
requestUrl?: string
beginTime?: Date[]
duration?: number
resultCode?: number
userId?: number;
userType?: number;
applicationName?: string;
requestUrl?: string;
beginTime?: Date[];
duration?: number;
resultCode?: number;
}
export interface ApiAccessLogExportReqVO {
userId?: number
userType?: number
applicationName?: string
requestUrl?: string
beginTime?: Date[]
duration?: number
resultCode?: number
userId?: number;
userType?: number;
applicationName?: string;
requestUrl?: string;
beginTime?: Date[];
duration?: number;
resultCode?: number;
}
// 查询列表API 访问日志
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 访问日志
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 {
id: number
traceId: string
userId: number
userType: number
applicationName: string
requestMethod: string
requestParams: string
requestUrl: string
userIp: string
userAgent: string
exceptionTime: Date
exceptionName: string
exceptionMessage: string
exceptionRootCauseMessage: string
exceptionStackTrace: string
exceptionClassName: string
exceptionFileName: string
exceptionMethodName: string
exceptionLineNumber: number
processUserId: number
processStatus: number
processTime: Date
resultCode: number
createTime: Date
id: number;
traceId: string;
userId: number;
userType: number;
applicationName: string;
requestMethod: string;
requestParams: string;
requestUrl: string;
userIp: string;
userAgent: string;
exceptionTime: Date;
exceptionName: string;
exceptionMessage: string;
exceptionRootCauseMessage: string;
exceptionStackTrace: string;
exceptionClassName: string;
exceptionFileName: string;
exceptionMethodName: string;
exceptionLineNumber: number;
processUserId: number;
processStatus: number;
processTime: Date;
resultCode: number;
createTime: Date;
}
export interface ApiErrorLogPageReqVO extends PageParam {
userId?: number
userType?: number
applicationName?: string
requestUrl?: string
exceptionTime?: Date[]
processStatus: number
userId?: number;
userType?: number;
applicationName?: string;
requestUrl?: string;
exceptionTime?: Date[];
processStatus: number;
}
export interface ApiErrorLogExportReqVO {
userId?: number
userType?: number
applicationName?: string
requestUrl?: string
exceptionTime?: Date[]
processStatus: number
userId?: number;
userType?: number;
applicationName?: string;
requestUrl?: string;
exceptionTime?: Date[];
processStatus: number;
}
// 查询列表API 访问日志
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 错误日志的处理状态
export function updateApiErrorLogProcess(id: number, processStatus: number) {
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 错误日志
@ -62,8 +62,8 @@ export function exportApiErrorLog(params: ApiErrorLogExportReqVO) {
return defHttp.download(
{
url: '/infra/api-error-log/export-excel',
params
params,
},
'错误日志.xls'
)
'错误日志.xls',
);
}

View File

@ -1,57 +1,57 @@
import { defHttp } from '@/utils/http/axios'
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types'
import { defHttp } from '@/utils/http/axios';
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types';
// 查询列表代码生成表定义
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) {
return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id })
return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id });
}
// 新增代码生成表定义
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) {
return defHttp.put({ url: '/infra/codegen/update', data })
return defHttp.put({ url: '/infra/codegen/update', data });
}
// 基于数据库的表结构,同步数据库的表和字段定义
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 建表语句,同步数据库的表和字段定义
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) {
return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id })
return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id });
}
// 下载生成代码
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) {
return defHttp.get({ url: '/infra/codegen/db/table/list', params })
return defHttp.get({ url: '/infra/codegen/db/table/list', params });
}
// 基于数据库的表结构,创建代码生成器的表定义
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) {
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 = {
id: number
tableId: number
isParentMenuIdValid: boolean
dataSourceConfigId: number
scene: number
tableName: string
tableComment: string
remark: string
moduleName: string
businessName: string
className: string
classComment: string
author: string
createTime: Date
updateTime: Date
templateType: number
parentMenuId: number
}
id: number;
tableId: number;
isParentMenuIdValid: boolean;
dataSourceConfigId: number;
scene: number;
tableName: string;
tableComment: string;
remark: string;
moduleName: string;
businessName: string;
className: string;
classComment: string;
author: string;
createTime: Date;
updateTime: Date;
templateType: number;
parentMenuId: number;
};
export type CodegenColumnVO = {
id: number
tableId: number
columnName: string
dataType: string
columnComment: string
nullable: number
primaryKey: number
autoIncrement: string
ordinalPosition: number
javaType: string
javaField: string
dictType: string
example: string
createOperation: number
updateOperation: number
listOperation: number
listOperationCondition: string
listOperationResult: number
htmlType: string
}
id: number;
tableId: number;
columnName: string;
dataType: string;
columnComment: string;
nullable: number;
primaryKey: number;
autoIncrement: string;
ordinalPosition: number;
javaType: string;
javaField: string;
dictType: string;
example: string;
createOperation: number;
updateOperation: number;
listOperation: number;
listOperationCondition: string;
listOperationResult: number;
htmlType: string;
};
export type DatabaseTableVO = {
name: string
comment: string
}
name: string;
comment: string;
};
export type CodegenDetailVO = {
table: CodegenTableVO
columns: CodegenColumnVO[]
}
table: CodegenTableVO;
columns: CodegenColumnVO[];
};
export type CodegenPreviewVO = {
filePath: string
code: string
}
filePath: string;
code: string;
};
export type CodegenUpdateReqVO = {
table: CodegenTableVO
columns: CodegenColumnVO[]
}
table: CodegenTableVO;
columns: CodegenColumnVO[];
};
export type CodegenCreateListReqVO = {
dataSourceConfigId: number
tableNames: string[]
}
dataSourceConfigId: number;
tableNames: string[];
};

View File

@ -1,62 +1,62 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface ConfigVO {
id: number
category: string
name: string
key: string
value: string
type: number
visible: boolean
remark: string
createTime: Date
id: number;
category: string;
name: string;
key: string;
value: string;
type: number;
visible: boolean;
remark: string;
createTime: Date;
}
export interface ConfigPageReqVO extends PageParam {
name?: string
key?: string
type?: number
createTime?: Date[]
name?: string;
key?: string;
type?: number;
createTime?: Date[];
}
export interface ConfigExportReqVO {
name?: string
key?: string
type?: number
createTime?: Date[]
name?: string;
key?: string;
type?: number;
createTime?: Date[];
}
// 查询参数列表
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) {
return defHttp.get({ url: '/infra/config/get?id=' + id })
return defHttp.get({ url: '/infra/config/get?id=' + id });
}
// 根据参数键名查询参数值
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) {
return defHttp.post({ url: '/infra/config/create', data })
return defHttp.post({ url: '/infra/config/create', data });
}
// 修改参数
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) {
return defHttp.delete({ url: '/infra/config/delete?id=' + id })
return defHttp.delete({ url: '/infra/config/delete?id=' + id });
}
// 导出参数
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 {
id: number
name: string
url: string
username: string
password: string
createTime: Date
id: number;
name: string;
url: string;
username: string;
password: string;
createTime: Date;
}
// 查询数据源配置列表
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) {
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) {
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) {
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) {
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
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
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
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 {
id: number
configId: number
path: string
name: string
url: string
size: string
type: string
createTime: Date
id: number;
configId: number;
path: string;
name: string;
url: string;
size: string;
type: string;
createTime: Date;
}
export interface FilePageReqVO extends PageParam {
path?: string
type?: string
createTime?: Date[]
path?: string;
type?: string;
createTime?: Date[];
}
// 查询文件列表
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) {
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 {
basePath: string
host?: string
port?: number
username?: string
password?: string
mode?: string
endpoint?: string
bucket?: string
accessKey?: string
accessSecret?: string
domain: string
basePath: string;
host?: string;
port?: number;
username?: string;
password?: string;
mode?: string;
endpoint?: string;
bucket?: string;
accessKey?: string;
accessSecret?: string;
domain: string;
}
export interface FileConfigVO {
id: number
name: string
storage: number
master: boolean
visible: boolean
config: FileClientConfig
remark: string
createTime: Date
id: number;
name: string;
storage: number;
master: boolean;
visible: boolean;
config: FileClientConfig;
remark: string;
createTime: Date;
}
export interface FileConfigPageReqVO extends PageParam {
name?: string
storage?: number
createTime?: Date[]
name?: string;
storage?: number;
createTime?: Date[];
}
// 查询文件配置列表
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) {
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) {
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) {
return defHttp.post({ url: '/infra/file-config/create', data })
return defHttp.post({ url: '/infra/file-config/create', data });
}
// 修改文件配置
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) {
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) {
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 {
id: number
name: string
status: number
handlerName: string
handlerParam: string
cronExpression: string
retryCount: number
retryInterval: number
monitorTimeout: number
createTime: Date
id: number;
name: string;
status: number;
handlerName: string;
handlerParam: string;
cronExpression: string;
retryCount: number;
retryInterval: number;
monitorTimeout: number;
createTime: Date;
}
export interface JobPageReqVO extends PageParam {
name?: string
status?: number
handlerName?: string
name?: string;
status?: number;
handlerName?: string;
}
export interface JobExportReqVO {
name?: string
status?: number
handlerName?: string
name?: string;
status?: number;
handlerName?: string;
}
// 任务列表
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) {
return defHttp.get({ url: '/infra/job/get?id=' + id })
return defHttp.get({ url: '/infra/job/get?id=' + id });
}
// 新增任务
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) {
return defHttp.put({ url: '/infra/job/update', data })
return defHttp.put({ url: '/infra/job/update', data });
}
// 删除定时任务调度
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) {
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) {
const params = {
id,
status
}
return defHttp.put({ url: '/infra/job/update-status', params })
status,
};
return defHttp.put({ url: '/infra/job/update-status', params });
}
// 定时任务立即执行一次
export function runJob(id: number) {
return defHttp.put({ url: '/infra/job/trigger?id=' + id })
return defHttp.put({ url: '/infra/job/trigger?id=' + id });
}
// 获得定时任务的下 n 次执行时间
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 {
id: number
jobId: number
handlerName: string
handlerParam: string
cronExpression: string
executeIndex: string
beginTime: string
endTime: string
duration: string
status: number
createTime: string
id: number;
jobId: number;
handlerName: string;
handlerParam: string;
cronExpression: string;
executeIndex: string;
beginTime: string;
endTime: string;
duration: string;
status: number;
createTime: string;
}
export interface JobLogPageReqVO extends PageParam {
jobId?: number
handlerName?: string
beginTime?: string
endTime?: string
status?: number
jobId?: number;
handlerName?: string;
beginTime?: string;
endTime?: string;
status?: number;
}
export interface JobLogExportReqVO {
jobId?: number
handlerName?: string
beginTime?: string
endTime?: string
status?: number
jobId?: number;
handlerName?: string;
beginTime?: string;
endTime?: string;
status?: number;
}
// 任务日志列表
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) {
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) {
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
*/
export function getCache() {
return defHttp.get({ url: '/infra/redis/get-monitor-info' })
return defHttp.get({ url: '/infra/redis/get-monitor-info' });
}
// 获取模块
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
@ -17,25 +17,25 @@ export function getKeyList(keyTemplate: string) {
return defHttp.get({
url: '/infra/redis/get-key-list',
params: {
keyTemplate
}
})
keyTemplate,
},
});
}
// 获取缓存内容
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) {
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) {
return defHttp.delete({
url: '/infra/redis/delete-keys?',
params: {
keyTemplate
}
})
keyTemplate,
},
});
}

View File

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

View File

@ -1,46 +1,46 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface AccountVO {
id?: number
name: string
id?: number;
name: string;
}
// 创建公众号账号
export function createAccount(data) {
return defHttp.post({ url: '/mp/account/create', data })
return defHttp.post({ url: '/mp/account/create', 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) {
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) {
return defHttp.get({ url: '/mp/account/get?id=' + id })
return defHttp.get({ url: '/mp/account/get?id=' + id });
}
// 获得公众号账号分页
export function getAccountPage(params) {
return defHttp.get({ url: '/mp/account/page', params })
return defHttp.get({ url: '/mp/account/page', params });
}
// 获取公众号账号精简信息列表
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) {
return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id })
return defHttp.put({ url: '/mp/account/generate-qr-code?id=' + id });
}
// 清空公众号 API 配额
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) {
return defHttp.post({ url: '/mp/auto-reply/create', data })
return defHttp.post({ url: '/mp/auto-reply/create', 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) {
return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + id })
return defHttp.delete({ url: '/mp/auto-reply/delete?id=' + 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) {
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) {
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({
url: '/mp/draft/create?accountId=' + accountId,
data: {
articles
}
})
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) {
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) {
return defHttp.get({ url: '/mp/free-publish/page', params })
return defHttp.get({ url: '/mp/free-publish/page', params });
}
// 删除公众号素材
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) {
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) {
return defHttp.get({ url: '/mp/material/page', params })
return defHttp.get({ url: '/mp/material/page', params });
}
// 删除公众号永久素材
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) {
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',
data: {
accountId,
menus
}
})
menus,
},
});
}
// 删除公众号菜单
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) {
return defHttp.get({ url: '/mp/message/page', params })
return defHttp.get({ url: '/mp/message/page', params });
}
// 给粉丝发送消息
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) {
return defHttp.put({ url: '/mp/user/update', data })
return defHttp.put({ url: '/mp/user/update', data });
}
// 获得公众号粉丝
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) {
return defHttp.get({ url: '/mp/user/page', params })
return defHttp.get({ url: '/mp/user/page', params });
}
// 同步公众号粉丝
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) {
return defHttp.get({ url: '/mp/statistics/upstream-message', params })
return defHttp.get({ url: '/mp/statistics/upstream-message', 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) {
return defHttp.get({ url: '/mp/statistics/user-cumulate', params })
return defHttp.get({ url: '/mp/statistics/user-cumulate', 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) {
return defHttp.post({ url: '/mp/tag/create', data })
return defHttp.post({ url: '/mp/tag/create', 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) {
return defHttp.delete({ url: '/mp/tag/delete?id=' + id })
return defHttp.delete({ url: '/mp/tag/delete?id=' + 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) {
return defHttp.get({ url: '/mp/tag/page', params })
return defHttp.get({ url: '/mp/tag/page', params });
}
// 获取公众号标签精简信息列表
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) {
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 {
id: number
name: string
status: number
remark: string
payNotifyUrl: string
refundNotifyUrl: string
merchantId: number
merchantName: string
createTime: Date
id: number;
name: string;
status: number;
remark: string;
payNotifyUrl: string;
refundNotifyUrl: string;
merchantId: number;
merchantName: string;
createTime: Date;
}
export interface AppPageReqVO extends PageParam {
name?: string
status?: number
remark?: string
payNotifyUrl?: string
refundNotifyUrl?: string
merchantName?: string
createTime?: Date[]
name?: string;
status?: number;
remark?: string;
payNotifyUrl?: string;
refundNotifyUrl?: string;
merchantName?: string;
createTime?: Date[];
}
export interface AppExportReqVO {
name?: string
status?: number
remark?: string
payNotifyUrl?: string
refundNotifyUrl?: string
merchantName?: string
createTime?: Date[]
name?: string;
status?: number;
remark?: string;
payNotifyUrl?: string;
refundNotifyUrl?: string;
merchantName?: string;
createTime?: Date[];
}
export interface AppUpdateStatusReqVO {
id: number
status: number
id: number;
status: number;
}
// 查询列表支付应用
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) {
return defHttp.get({ url: '/pay/app/get?id=' + id })
return defHttp.get({ url: '/pay/app/get?id=' + id });
}
// 新增支付应用
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) {
return defHttp.put({ url: '/pay/app/update', data })
return defHttp.put({ url: '/pay/app/update', data });
}
// 支付应用信息状态修改
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) {
return defHttp.delete({ url: '/pay/app/delete?id=' + id })
return defHttp.delete({ url: '/pay/app/delete?id=' + id });
}
// 导出支付应用
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称搜索应用列表
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 {
id: number
code: string
config: string
status: number
remark: string
feeRate: number
merchantId: number
appId: number
createTime: Date
id: number;
code: string;
config: string;
status: number;
remark: string;
feeRate: number;
merchantId: number;
appId: number;
createTime: Date;
}
export interface ChannelPageReqVO extends PageParam {
code?: string
status?: number
remark?: string
feeRate?: number
merchantId?: number
appId?: number
config?: string
createTime?: Date[]
code?: string;
status?: number;
remark?: string;
feeRate?: number;
merchantId?: number;
appId?: number;
config?: string;
createTime?: Date[];
}
export interface ChannelExportReqVO {
code?: string
status?: number
remark?: string
feeRate?: number
merchantId?: number
appId?: number
config?: string
createTime?: Date[]
code?: string;
status?: number;
remark?: string;
feeRate?: number;
merchantId?: number;
appId?: number;
config?: string;
createTime?: Date[];
}
// 查询列表支付渠道
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) {
const params = {
merchantId: merchantId,
appId: appId,
code: code
}
return defHttp.get({ url: '/pay/channel/get-channel', params: params })
merchantId,
appId,
code,
};
return defHttp.get({ url: '/pay/channel/get-channel', params });
}
// 新增支付渠道
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) {
return defHttp.put({ url: '/pay/channel/update', data })
return defHttp.put({ url: '/pay/channel/update', data });
}
// 删除支付渠道
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) {
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) {
return defHttp.get({ url: '/pay/demo-order/page', params })
return defHttp.get({ url: '/pay/demo-order/page', params });
}
// 获得示例订单
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) {
return defHttp.post({ url: '/pay/demo-order/create', data })
return defHttp.post({ url: '/pay/demo-order/create', data });
}
// 退款示例订单
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 {
id: number
no: string
name: string
shortName: string
status: number
remark: string
createTime: Date
id: number;
no: string;
name: string;
shortName: string;
status: number;
remark: string;
createTime: Date;
}
export interface MerchantPageReqVO extends PageParam {
no?: string
name?: string
shortName?: string
status?: number
remark?: string
createTime?: Date[]
no?: string;
name?: string;
shortName?: string;
status?: number;
remark?: string;
createTime?: Date[];
}
export interface MerchantExportReqVO {
no?: string
name?: string
shortName?: string
status?: number
remark?: string
createTime?: Date[]
no?: string;
name?: string;
shortName?: string;
status?: number;
remark?: string;
createTime?: Date[];
}
// 查询列表支付商户
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) {
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({
url: '/pay/merchant/list-by-name?id=',
params: {
name: name
}
})
name,
},
});
}
// 新增支付商户
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) {
return defHttp.put({ url: '/pay/merchant/update', data })
return defHttp.put({ url: '/pay/merchant/update', data });
}
// 删除支付商户
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) {
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) {
const data = {
id,
status
}
return defHttp.put({ url: '/pay/merchant/update-status', data })
status,
};
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 {
id: number
merchantId: number
appId: number
channelId: number
channelCode: string
merchantOrderId: string
subject: string
body: string
notifyUrl: string
notifyStatus: number
amount: number
channelFeeRate: number
channelFeeAmount: number
status: number
userIp: string
expireTime: Date
successTime: Date
notifyTime: Date
successExtensionId: number
refundStatus: number
refundTimes: number
refundAmount: number
channelUserId: string
channelOrderNo: string
createTime: Date
id: number;
merchantId: number;
appId: number;
channelId: number;
channelCode: string;
merchantOrderId: string;
subject: string;
body: string;
notifyUrl: string;
notifyStatus: number;
amount: number;
channelFeeRate: number;
channelFeeAmount: number;
status: number;
userIp: string;
expireTime: Date;
successTime: Date;
notifyTime: Date;
successExtensionId: number;
refundStatus: number;
refundTimes: number;
refundAmount: number;
channelUserId: string;
channelOrderNo: string;
createTime: Date;
}
export interface OrderPageReqVO extends PageParam {
merchantId?: number
appId?: number
channelId?: number
channelCode?: string
merchantOrderId?: string
subject?: string
body?: string
notifyUrl?: string
notifyStatus?: number
amount?: number
channelFeeRate?: number
channelFeeAmount?: number
status?: number
expireTime?: Date[]
successTime?: Date[]
notifyTime?: Date[]
successExtensionId?: number
refundStatus?: number
refundTimes?: number
channelUserId?: string
channelOrderNo?: string
createTime?: Date[]
merchantId?: number;
appId?: number;
channelId?: number;
channelCode?: string;
merchantOrderId?: string;
subject?: string;
body?: string;
notifyUrl?: string;
notifyStatus?: number;
amount?: number;
channelFeeRate?: number;
channelFeeAmount?: number;
status?: number;
expireTime?: Date[];
successTime?: Date[];
notifyTime?: Date[];
successExtensionId?: number;
refundStatus?: number;
refundTimes?: number;
channelUserId?: string;
channelOrderNo?: string;
createTime?: Date[];
}
export interface OrderExportReqVO {
merchantId?: number
appId?: number
channelId?: number
channelCode?: string
merchantOrderId?: string
subject?: string
body?: string
notifyUrl?: string
notifyStatus?: number
amount?: number
channelFeeRate?: number
channelFeeAmount?: number
status?: number
expireTime?: Date[]
successTime?: Date[]
notifyTime?: Date[]
successExtensionId?: number
refundStatus?: number
refundTimes?: number
channelUserId?: string
channelOrderNo?: string
createTime?: Date[]
merchantId?: number;
appId?: number;
channelId?: number;
channelCode?: string;
merchantOrderId?: string;
subject?: string;
body?: string;
notifyUrl?: string;
notifyStatus?: number;
amount?: number;
channelFeeRate?: number;
channelFeeAmount?: number;
status?: number;
expireTime?: Date[];
successTime?: Date[];
notifyTime?: Date[];
successExtensionId?: number;
refundStatus?: number;
refundTimes?: number;
channelUserId?: string;
channelOrderNo?: string;
createTime?: Date[];
}
// 查询列表支付订单
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) {
return defHttp.get({ url: '/pay/order/get?id=' + id })
return defHttp.get({ url: '/pay/order/get?id=' + id });
}
// 查询详情支付订单
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) {
return defHttp.post({ url: '/pay/order/create', data })
return defHttp.post({ url: '/pay/order/create', data });
}
// 修改支付订单
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) {
return defHttp.delete({ url: '/pay/order/delete?id=' + id })
return defHttp.delete({ url: '/pay/order/delete?id=' + id });
}
// 导出支付订单
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 {
id: number
merchantId: number
appId: number
channelId: number
channelCode: string
orderId: string
tradeNo: string
merchantOrderId: string
merchantRefundNo: string
notifyUrl: string
notifyStatus: number
status: number
type: number
payAmount: number
refundAmount: number
reason: string
userIp: string
channelOrderNo: string
channelRefundNo: string
channelErrorCode: string
channelErrorMsg: string
channelExtras: string
expireTime: Date
successTime: Date
notifyTime: Date
createTime: Date
id: number;
merchantId: number;
appId: number;
channelId: number;
channelCode: string;
orderId: string;
tradeNo: string;
merchantOrderId: string;
merchantRefundNo: string;
notifyUrl: string;
notifyStatus: number;
status: number;
type: number;
payAmount: number;
refundAmount: number;
reason: string;
userIp: string;
channelOrderNo: string;
channelRefundNo: string;
channelErrorCode: string;
channelErrorMsg: string;
channelExtras: string;
expireTime: Date;
successTime: Date;
notifyTime: Date;
createTime: Date;
}
export interface RefundPageReqVO extends PageParam {
merchantId?: number
appId?: number
channelId?: number
channelCode?: string
orderId?: string
tradeNo?: string
merchantOrderId?: string
merchantRefundNo?: string
notifyUrl?: string
notifyStatus?: number
status?: number
type?: number
payAmount?: number
refundAmount?: number
reason?: string
userIp?: string
channelOrderNo?: string
channelRefundNo?: string
channelErrorCode?: string
channelErrorMsg?: string
channelExtras?: string
expireTime?: Date[]
successTime?: Date[]
notifyTime?: Date[]
createTime?: Date[]
merchantId?: number;
appId?: number;
channelId?: number;
channelCode?: string;
orderId?: string;
tradeNo?: string;
merchantOrderId?: string;
merchantRefundNo?: string;
notifyUrl?: string;
notifyStatus?: number;
status?: number;
type?: number;
payAmount?: number;
refundAmount?: number;
reason?: string;
userIp?: string;
channelOrderNo?: string;
channelRefundNo?: string;
channelErrorCode?: string;
channelErrorMsg?: string;
channelExtras?: string;
expireTime?: Date[];
successTime?: Date[];
notifyTime?: Date[];
createTime?: Date[];
}
export interface PayRefundExportReqVO {
merchantId?: number
appId?: number
channelId?: number
channelCode?: string
orderId?: string
tradeNo?: string
merchantOrderId?: string
merchantRefundNo?: string
notifyUrl?: string
notifyStatus?: number
status?: number
type?: number
payAmount?: number
refundAmount?: number
reason?: string
userIp?: string
channelOrderNo?: string
channelRefundNo?: string
channelErrorCode?: string
channelErrorMsg?: string
channelExtras?: string
expireTime?: Date[]
successTime?: Date[]
notifyTime?: Date[]
createTime?: Date[]
merchantId?: number;
appId?: number;
channelId?: number;
channelCode?: string;
orderId?: string;
tradeNo?: string;
merchantOrderId?: string;
merchantRefundNo?: string;
notifyUrl?: string;
notifyStatus?: number;
status?: number;
type?: number;
payAmount?: number;
refundAmount?: number;
reason?: string;
userIp?: string;
channelOrderNo?: string;
channelRefundNo?: string;
channelErrorCode?: string;
channelErrorMsg?: string;
channelExtras?: string;
expireTime?: Date[];
successTime?: Date[];
notifyTime?: Date[];
createTime?: Date[];
}
// 查询列表退款订单
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) {
return defHttp.get({ url: '/pay/refund/get?id=' + id })
return defHttp.get({ url: '/pay/refund/get?id=' + id });
}
// 新增退款订单
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) {
return defHttp.put({ url: '/pay/refund/update', data })
return defHttp.put({ url: '/pay/refund/update', data });
}
// 删除退款订单
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) {
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() {
return defHttp.get({ url: '/system/area/tree' })
return defHttp.get({ url: '/system/area/tree' });
}
// 获得 IP 对应的地区名
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 {
id?: number
name: string
parentId: number
status: number
sort: number
leaderUserId: number
phone: string
email: string
createTime: Date
id?: number;
name: string;
parentId: number;
status: number;
sort: number;
leaderUserId: number;
phone: string;
email: string;
createTime: Date;
}
export interface DeptPageReqVO {
name?: string
status?: number
name?: string;
status?: number;
}
// 查询部门(精简)列表
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) {
return defHttp.get({ url: '/system/dept/list', params })
return defHttp.get({ url: '/system/dept/list', params });
}
// 查询部门详情
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) {
return defHttp.post({ url: '/system/dept/create', data })
return defHttp.post({ url: '/system/dept/create', data });
}
// 修改部门
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) {
return defHttp.delete({ url: '/system/dept/delete?id=' + id })
return defHttp.delete({ url: '/system/dept/delete?id=' + id });
}

View File

@ -1,36 +1,36 @@
import { defHttp } from '@/utils/http/axios'
import type { DictDataVO, DictDataPageReqVO, DictDataExportReqVO } from './types'
import { defHttp } from '@/utils/http/axios';
import type { DictDataVO, DictDataPageReqVO, DictDataExportReqVO } from './types';
// 查询字典数据(精简)列表
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) {
return defHttp.get({ url: '/system/dict-data/page', params })
return defHttp.get({ url: '/system/dict-data/page', params });
}
// 查询字典数据详情
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) {
return defHttp.post({ url: '/system/dict-data/create', data })
return defHttp.post({ url: '/system/dict-data/create', data });
}
// 修改字典数据
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) {
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) {
return defHttp.get({ url: '/system/dict-data/export', params })
return defHttp.get({ url: '/system/dict-data/export', params });
}

View File

@ -1,36 +1,36 @@
import { defHttp } from '@/utils/http/axios'
import type { DictTypeVO, DictTypePageReqVO, DictTypeExportReqVO } from './types'
import { defHttp } from '@/utils/http/axios';
import type { DictTypeVO, DictTypePageReqVO, DictTypeExportReqVO } from './types';
// 查询字典(精简)列表
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) {
return defHttp.get({ url: '/system/dict-type/page', params })
return defHttp.get({ url: '/system/dict-type/page', params });
}
// 查询字典详情
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) {
return defHttp.post({ url: '/system/dict-type/create', data })
return defHttp.post({ url: '/system/dict-type/create', data });
}
// 修改字典
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) {
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) {
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 = {
id: number
name: string
type: string
status: number
remark: string
createTime: Date
export interface DictTypeVO {
id: number;
name: string;
type: string;
status: number;
remark: string;
createTime: Date;
}
export type DictTypePageReqVO = {
name: string
type: string
status: number
createTime: Date[]
export interface DictTypePageReqVO {
name: string;
type: string;
status: number;
createTime: Date[];
}
export type DictTypeExportReqVO = {
name: string
type: string
status: number
createTime: Date[]
export interface DictTypeExportReqVO {
name: string;
type: string;
status: number;
createTime: Date[];
}
export type DictDataVO = {
id: number
sort: number
label: string
value: string
dictType: string
status: number
colorType: string
cssClass: string
remark: string
createTime: Date
export interface DictDataVO {
id: number;
sort: number;
label: string;
value: string;
dictType: string;
status: number;
colorType: string;
cssClass: string;
remark: string;
createTime: Date;
}
export type DictDataPageReqVO = {
label: string
dictType: string
status: number
export interface DictDataPageReqVO {
label: string;
dictType: string;
status: number;
}
export type DictDataExportReqVO = {
label: string
dictType: string
status: number
export interface DictDataExportReqVO {
label: string;
dictType: string;
status: number;
}

View File

@ -1,49 +1,49 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface ErrorCodeVO {
id: number
type: number
applicationName: string
code: number
message: string
memo: string
createTime: Date
id: number;
type: number;
applicationName: string;
code: number;
message: string;
memo: string;
createTime: Date;
}
export interface ErrorCodePageReqVO extends PageParam {
type?: number
applicationName?: string
code?: number
message?: string
createTime?: Date[]
type?: number;
applicationName?: string;
code?: number;
message?: string;
createTime?: Date[];
}
// 查询错误码列表
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) {
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) {
return defHttp.post({ url: '/system/error-code/create', data })
return defHttp.post({ url: '/system/error-code/create', data });
}
// 修改错误码
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) {
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) {
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 {
id: number
logType: number
traceId: number
userId: number
userType: number
username: string
status: number
userIp: string
userAgent: string
createTime: Date
id: number;
logType: number;
traceId: number;
userId: number;
userType: number;
username: string;
status: number;
userIp: string;
userAgent: string;
createTime: Date;
}
export interface LoginLogReqVO extends PageParam {
userIp?: string
username?: string
status?: boolean
createTime?: Date[]
userIp?: string;
username?: string;
status?: boolean;
createTime?: Date[];
}
// 查询登录日志列表
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) {
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) {
return defHttp.post({ url: '/system/mail-account/create', data })
return defHttp.post({ url: '/system/mail-account/create', 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) {
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) {
return defHttp.get({ url: '/system/mail-account/get?id=' + id })
return defHttp.get({ url: '/system/mail-account/get?id=' + id });
}
// 获得邮箱账号分页
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() {
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) {
return defHttp.get({ url: '/system/mail-log/get?id=' + id })
return defHttp.get({ url: '/system/mail-log/get?id=' + id });
}
// 获得邮件日志分页
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) {
return defHttp.post({ url: '/system/mail-template/create', data })
return defHttp.post({ url: '/system/mail-template/create', 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) {
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) {
return defHttp.get({ url: '/system/mail-template/get?id=' + id })
return defHttp.get({ url: '/system/mail-template/get?id=' + id });
}
// 获得邮件模版分页
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) {
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 {
id: number
name: string
permission: string
type: number
sort: number
parentId: number
path: string
icon: string
component: string
status: number
visible: boolean
keepAlive: boolean
createTime: Date
id: number;
name: string;
permission: string;
type: number;
sort: number;
parentId: number;
path: string;
icon: string;
component: string;
status: number;
visible: boolean;
keepAlive: boolean;
createTime: Date;
}
export interface MenuPageReqVO {
name?: string
status?: number
name?: string;
status?: number;
}
// 查询菜单(精简)列表
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) {
return defHttp.get({ url: '/system/menu/list', params })
return defHttp.get({ url: '/system/menu/list', params });
}
// 获取菜单详情
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) {
return defHttp.post({ url: '/system/menu/create', data })
return defHttp.post({ url: '/system/menu/create', data });
}
// 修改菜单
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) {
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 {
id: number
title: string
type: number
content: string
status: number
remark: string
creator: string
createTime: Date
id: number;
title: string;
type: number;
content: string;
status: number;
remark: string;
creator: string;
createTime: Date;
}
export interface NoticePageReqVO extends PageParam {
title?: string
status?: number
title?: string;
status?: number;
}
// 查询公告列表
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) {
return defHttp.get({ url: '/system/notice/get?id=' + id })
return defHttp.get({ url: '/system/notice/get?id=' + id });
}
// 新增公告
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) {
return defHttp.put({ url: '/system/notice/update', data })
return defHttp.put({ url: '/system/notice/update', data });
}
// 删除公告
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,32 @@
import { defHttp } from '@/utils/http/axios'
import qs from 'qs'
import { defHttp } from '@/utils/http/axios';
import qs from 'qs';
// 获得站内信分页
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) {
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[]) {
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() {
return defHttp.put({ url: '/system/notify-message/update-all-read' })
return defHttp.put({ url: '/system/notify-message/update-all-read' });
}
// 获取当前用户的最新站内信列表
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() {
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) {
return defHttp.post({ url: '/system/notify-template/create', data })
return defHttp.post({ url: '/system/notify-template/create', 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) {
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) {
return defHttp.get({ url: '/system/notify-template/get?id=' + id })
return defHttp.get({ url: '/system/notify-template/get?id=' + id });
}
// 获得站内信模板分页
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() {
return defHttp.get({ url: '/system/post/list-all-simple' })
return defHttp.get({ url: '/system/post/list-all-simple' });
}
// 导出站内信模板 Excel
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 {
id: number
clientId: string
secret: string
name: string
logo: string
description: string
status: number
accessTokenValiditySeconds: number
refreshTokenValiditySeconds: number
redirectUris: string[]
autoApprove: boolean
authorizedGrantTypes: string[]
scopes: string[]
authorities: string[]
resourceIds: string[]
additionalInformation: string
isAdditionalInformationJson: boolean
createTime: Date
id: number;
clientId: string;
secret: string;
name: string;
logo: string;
description: string;
status: number;
accessTokenValiditySeconds: number;
refreshTokenValiditySeconds: number;
redirectUris: string[];
autoApprove: boolean;
authorizedGrantTypes: string[];
scopes: string[];
authorities: string[];
resourceIds: string[];
additionalInformation: string;
isAdditionalInformationJson: boolean;
createTime: Date;
}
export interface OAuth2ClientPageReqVO extends PageParam {
name?: string
status?: number
name?: string;
status?: number;
}
// 查询 OAuth2列表
export function getOAuth2ClientPage(params: OAuth2ClientPageReqVO) {
return defHttp.get({ url: '/system/oauth2-client/page', params })
return defHttp.get({ url: '/system/oauth2-client/page', params });
}
// 查询 OAuth2详情
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
export function createOAuth2Client(data: OAuth2ClientVO) {
return defHttp.post({ url: '/system/oauth2-client/create', data })
return defHttp.post({ url: '/system/oauth2-client/create', data });
}
// 修改 OAuth2
export function updateOAuth2Client(data: OAuth2ClientVO) {
return defHttp.put({ url: '/system/oauth2-client/update', data })
return defHttp.put({ url: '/system/oauth2-client/update', data });
}
// 删除 OAuth2
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 {
id: number
accessToken: string
refreshToken: string
userId: number
userType: number
clientId: string
createTime: Date
expiresTime: Date
id: number;
accessToken: string;
refreshToken: string;
userId: number;
userType: number;
clientId: string;
createTime: Date;
expiresTime: Date;
}
export interface OAuth2TokenPageReqVO extends PageParam {
userId?: number
userType?: number
clientId?: string
userId?: number;
userType?: number;
clientId?: string;
}
// 查询 token列表
export function getAccessTokenPage(params: OAuth2TokenPageReqVO) {
return defHttp.get({ url: '/system/oauth2-token/page', params })
return defHttp.get({ url: '/system/oauth2-token/page', params });
}
// 删除 token
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 {
id: number
userNickname: string
traceId: string
userId: number
module: string
name: string
type: number
content: string
exts: Map<String, Object>
defHttpMethod: string
defHttpUrl: string
userIp: string
userAgent: string
javaMethod: string
javaMethodArgs: string
startTime: Date
duration: number
resultCode: number
resultMsg: string
resultData: string
id: number;
userNickname: string;
traceId: string;
userId: number;
module: string;
name: string;
type: number;
content: string;
exts: Map<String, Object>;
defHttpMethod: string;
defHttpUrl: string;
userIp: string;
userAgent: string;
javaMethod: string;
javaMethodArgs: string;
startTime: Date;
duration: number;
resultCode: number;
resultMsg: string;
resultData: string;
}
export interface OperateLogPageReqVO extends PageParam {
module?: string
userNickname?: string
type?: number
success?: boolean
startTime?: Date[]
module?: string;
userNickname?: string;
type?: number;
success?: boolean;
startTime?: Date[];
}
// 查询操作日志列表
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) {
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 {
userId: number
roleIds: number[]
userId: number;
roleIds: number[];
}
export interface PermissionAssignRoleMenuReqVO {
roleId: number
menuIds: number[]
roleId: number;
menuIds: number[];
}
export interface PermissionAssignRoleDataScopeReqVO {
roleId: number
dataScope: number
dataScopeDeptIds: number[]
roleId: number;
dataScope: number;
dataScopeDeptIds: 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) {
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) {
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) {
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) {
return defHttp.post({ url: '/system/permission/assign-user-role', data })
return defHttp.post({ url: '/system/permission/assign-user-role', data });
}

View File

@ -1,58 +1,58 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface PostVO {
id?: number
name: string
code: string
sort: number
status: number
remark: string
createTime?: Date
id?: number;
name: string;
code: string;
sort: number;
status: number;
remark: string;
createTime?: Date;
}
export interface PostPageReqVO extends PageParam {
code?: string
name?: string
status?: number
code?: string;
name?: string;
status?: number;
}
export interface PostExportReqVO {
code?: string
name?: string
status?: number
code?: string;
name?: string;
status?: number;
}
// 查询岗位列表
export function getPostPage(params: PostPageReqVO) {
return defHttp.get<PageResult<PostVO>>({ url: '/system/post/page', params })
return defHttp.get<PageResult<PostVO>>({ url: '/system/post/page', params });
}
// 获取岗位精简信息列表
export function listSimplePosts() {
return defHttp.get({ url: '/system/post/list-all-simple' })
return defHttp.get({ url: '/system/post/list-all-simple' });
}
// 查询岗位详情
export function getPost(id: number) {
return defHttp.get({ url: '/system/post/get?id=' + id })
return defHttp.get({ url: '/system/post/get?id=' + id });
}
// 新增岗位
export function createPost(data: PostVO) {
return defHttp.post({ url: '/system/post/create', data })
return defHttp.post({ url: '/system/post/create', data });
}
// 修改岗位
export function updatePost(data: PostVO) {
return defHttp.put({ url: '/system/post/update', data })
return defHttp.put({ url: '/system/post/update', data });
}
// 删除岗位
export function deletePost(id: number) {
return defHttp.delete({ url: '/system/post/delete?id=' + id })
return defHttp.delete({ url: '/system/post/delete?id=' + id });
}
// 导出岗位
export function exportPost(params: PostExportReqVO) {
return defHttp.download({ url: '/system/post/export', params }, '导出岗位.xls')
return defHttp.download({ url: '/system/post/export', params }, '导出岗位.xls');
}

View File

@ -1,70 +1,70 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface RoleVO {
id: number
name: string
code: string
sort: number
status: number
type: number
createTime: Date
id: number;
name: string;
code: string;
sort: number;
status: number;
type: number;
createTime: Date;
}
export interface RolePageReqVO extends PageParam {
name?: string
code?: string
status?: number
createTime?: Date[]
name?: string;
code?: string;
status?: number;
createTime?: Date[];
}
export interface UpdateStatusReqVO {
id: number
status: number
id: number;
status: number;
}
export interface RoleExportReqVO {
name?: string
code?: string
status?: number
createTime?: Date[]
name?: string;
code?: string;
status?: number;
createTime?: Date[];
}
// 查询角色列表
export function getRolePage(params: RolePageReqVO) {
return defHttp.get({ url: '/system/role/page', params })
return defHttp.get({ url: '/system/role/page', params });
}
// 查询角色(精简)列表
export function listSimpleRoles() {
return defHttp.get({ url: '/system/role/list-all-simple' })
return defHttp.get({ url: '/system/role/list-all-simple' });
}
// 查询角色详情
export function getRole(id: number) {
return defHttp.get({ url: '/system/role/get?id=' + id })
return defHttp.get({ url: '/system/role/get?id=' + id });
}
// 新增角色
export function createRole(data: RoleVO) {
return defHttp.post({ url: '/system/role/create', data })
return defHttp.post({ url: '/system/role/create', data });
}
// 修改角色
export function updateRole(data: RoleVO) {
return defHttp.put({ url: '/system/role/update', data })
return defHttp.put({ url: '/system/role/update', data });
}
// 修改角色状态
export function updateRoleStatus(data: UpdateStatusReqVO) {
return defHttp.put({ url: '/system/role/update-status', data })
return defHttp.put({ url: '/system/role/update-status', data });
}
// 删除角色
export function deleteRole(id: number) {
return defHttp.delete({ url: '/system/role/delete?id=' + id })
return defHttp.delete({ url: '/system/role/delete?id=' + id });
}
// 导出角色
export function exportRole(params: RoleExportReqVO) {
return defHttp.download({ url: '/system/post/export', params }, '导出角色.xls')
return defHttp.download({ url: '/system/post/export', params }, '导出角色.xls');
}

View File

@ -1,64 +1,64 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface SensitiveWordVO {
id: number
name: string
status: number
description: string
tags: string[]
createTime: Date
id: number;
name: string;
status: number;
description: string;
tags: string[];
createTime: Date;
}
export interface SensitiveWordPageReqVO extends PageParam {
name?: string
tag?: string
status?: number
createTime?: Date[]
name?: string;
tag?: string;
status?: number;
createTime?: Date[];
}
export interface SensitiveWordExportReqVO {
name?: string
tag?: string
status?: number
createTime?: Date[]
name?: string;
tag?: string;
status?: number;
createTime?: Date[];
}
// 查询敏感词列表
export function getSensitiveWordPage(params: SensitiveWordPageReqVO) {
return defHttp.get({ url: '/system/sensitive-word/page', params })
return defHttp.get({ url: '/system/sensitive-word/page', params });
}
// 查询敏感词详情
export function getSensitiveWord(id: number) {
return defHttp.get({ url: '/system/sensitive-word/get?id=' + id })
return defHttp.get({ url: '/system/sensitive-word/get?id=' + id });
}
// 新增敏感词
export function createSensitiveWord(data: SensitiveWordVO) {
return defHttp.post({ url: '/system/sensitive-word/create', data })
return defHttp.post({ url: '/system/sensitive-word/create', data });
}
// 修改敏感词
export function updateSensitiveWord(data: SensitiveWordVO) {
return defHttp.put({ url: '/system/sensitive-word/update', data })
return defHttp.put({ url: '/system/sensitive-word/update', data });
}
// 删除敏感词
export function deleteSensitiveWord(id: number) {
return defHttp.delete({ url: '/system/sensitive-word/delete?id=' + id })
return defHttp.delete({ url: '/system/sensitive-word/delete?id=' + id });
}
// 导出敏感词
export function exportSensitiveWord(params: SensitiveWordExportReqVO) {
return defHttp.download({ url: '/system/sensitive-word/export-excel', params }, '导出敏感词.xls')
return defHttp.download({ url: '/system/sensitive-word/export-excel', params }, '导出敏感词.xls');
}
// 获取所有敏感词的标签数组
export function getSensitiveWordTags() {
return defHttp.get({ url: '/system/sensitive-word/get-tags' })
return defHttp.get({ url: '/system/sensitive-word/get-tags' });
}
// 获得文本所包含的不合法的敏感词数组
export function validateText(id: number) {
return defHttp.get({ url: '/system/sensitive-word/validate-text?' + id })
return defHttp.get({ url: '/system/sensitive-word/validate-text?' + id });
}

View File

@ -1,50 +1,50 @@
import { defHttp } from '@/utils/http/axios'
import { defHttp } from '@/utils/http/axios';
export interface SmsChannelVO {
id: number
code: string
status: number
signature: string
remark: string
apiKey: string
apiSecret: string
callbackUrl: string
createTime: Date
id: number;
code: string;
status: number;
signature: string;
remark: string;
apiKey: string;
apiSecret: string;
callbackUrl: string;
createTime: Date;
}
export interface SmsChannelPageReqVO extends PageParam {
signature?: string
code?: string
status?: number
createTime?: Date[]
signature?: string;
code?: string;
status?: number;
createTime?: Date[];
}
// 查询短信渠道列表
export function getSmsChannelPage(params: SmsChannelPageReqVO) {
return defHttp.get({ url: '/system/sms-channel/page', params })
return defHttp.get({ url: '/system/sms-channel/page', params });
}
// 获得短信渠道精简列表
export function getSimpleSmsChannels() {
return defHttp.get({ url: '/system/sms-channel/list-all-simple' })
return defHttp.get({ url: '/system/sms-channel/list-all-simple' });
}
// 查询短信渠道详情
export function getSmsChannel(id: number) {
return defHttp.get({ url: '/system/sms-channel/get?id=' + id })
return defHttp.get({ url: '/system/sms-channel/get?id=' + id });
}
// 新增短信渠道
export function createSmsChannel(data: SmsChannelVO) {
return defHttp.post({ url: '/system/sms-channel/create', data })
return defHttp.post({ url: '/system/sms-channel/create', data });
}
// 修改短信渠道
export function updateSmsChannel(data: SmsChannelVO) {
return defHttp.put({ url: '/system/sms-channel/update', data })
return defHttp.put({ url: '/system/sms-channel/update', data });
}
// 删除短信渠道
export function deleteSmsChannel(id: number) {
return defHttp.delete({ url: '/system/sms-channel/delete?id=' + id })
return defHttp.delete({ url: '/system/sms-channel/delete?id=' + id });
}

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