提交 f42e00c7 作者: 方治民

feat: 完成网络请求适配(与 Web 端保持用法一致)、更新 pont 模板增加示例接口、代码格式化统一等

上级 8cb757d9
...@@ -6,7 +6,7 @@ end_of_line=lf ...@@ -6,7 +6,7 @@ end_of_line=lf
insert_final_newline=true insert_final_newline=true
indent_style=space indent_style=space
indent_size=4 indent_size=4
max_line_length = 100 max_line_length = 120
[*.{yml,yaml}] [*.{yml,yaml}]
indent_style = space indent_style = space
......
# API 接口地址 # API 接口地址
VITE_GLOB_API_URL=http://localhost:8080 VITE_GLOB_API_URL=http://localhost:8181
# API 接口地址前缀 # API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/api VITE_GLOB_API_URL_PREFIX=/api
...@@ -14,3 +14,5 @@ dist ...@@ -14,3 +14,5 @@ dist
Dockerfile Dockerfile
/example /example
unpackage unpackage
types/auto-imports.d.ts
...@@ -10,16 +10,22 @@ module.exports = { ...@@ -10,16 +10,22 @@ module.exports = {
jsx: true, jsx: true,
}, },
}, },
extends: [ extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
'prettier',
'plugin:prettier/recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: { rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-explicit-any': 0, '@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-namespace': 'off', '@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'vue/script-setup-uses-vars': 'error',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'vue/custom-event-name-casing': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-alert': 'error', 'no-alert': 'error',
'vue/html-self-closing': 0, 'vue/html-self-closing': 0,
'vue/html-indent': ['error', 4], 'vue/html-indent': ['error', 4],
......
...@@ -31,3 +31,5 @@ pnpm-debug.log* ...@@ -31,3 +31,5 @@ pnpm-debug.log*
.vite .vite
.hbuilderx .hbuilderx
unpackage unpackage
.mocks/
\ No newline at end of file
...@@ -9,3 +9,5 @@ ...@@ -9,3 +9,5 @@
/public/* /public/*
manifest.json manifest.json
types/auto-imports.d.ts
...@@ -22,10 +22,13 @@ ...@@ -22,10 +22,13 @@
<!-- prettier-ignore --> <!-- prettier-ignore -->
- [x] 项目构建,文档编写 - [x] 项目构建,文档编写
- [x] [conventional-changelog](https://www.cnblogs.com/mengfangui/p/12634845.html) - [x] [changelog](https://www.cnblogs.com/mengfangui/p/12634845.html)
- [ ] 完善网络请求相关配置 - [x] 完善网络请求相关配置
- [ ] 集成 [Pont](https://github.com/alibaba/pont) - [x] 集成 [Pont](https://github.com/alibaba/pont)
- [ ] 适配上传/下载接口的自动化生成模板(包装 uni.uploadFile 与 uni.downloadFile 方法实现)
- [ ] 集成 vue-i18n
- [ ] 完善页面主体布局 - [ ] 完善页面主体布局
- [ ] 设计模块化权限控制 - [ ] 设计模块化权限控制
- [ ] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html) - [ ] 接入 [消息推送](https://uniapp.dcloud.net.cn/unipush.html)
- [ ] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html) - [ ] 接入 [APP 升级中心](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html)
- [ ] 跟进官方更新进度,将 uni-app 依赖升级到 3.0 正式版,[日志](https://uniapp.dcloud.io/release-note-alpha.html)
/**
* Get the configuration file variable name
* @param env
*/
export const getConfigFileName = (env: Record<string, any>) => {
return `__PRODUCTION__${env.VITE_GLOB_APP_SHORT_NAME || '__APP'}__CONF__`.toUpperCase().replace(/\s/g, '')
}
...@@ -13,9 +13,11 @@ export function configAutoImportPlugin(): Plugin { ...@@ -13,9 +13,11 @@ export function configAutoImportPlugin(): Plugin {
imports: [ imports: [
'vue', 'vue',
'uni-app', 'uni-app',
// '@vueuse/core', {
{ '/@/config/app': ['$app'] }, '/@/config/app': ['$app'],
{ '/@/api/types': ['API'] }, '/@/api/services': ['defs'],
'/@/api/services/mods': ['API'],
},
], ],
}) })
} }
...@@ -4,12 +4,7 @@ import { configAutoImportPlugin } from './autoImport' ...@@ -4,12 +4,7 @@ import { configAutoImportPlugin } from './autoImport'
import pkg from '../../package.json' import pkg from '../../package.json'
export function createVitePlugins(viteEnv: ViteEnv) { export function createVitePlugins(viteEnv: ViteEnv) {
const { const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION, VITE_GLOB_API_URL, VITE_GLOB_API_URL_PREFIX } = viteEnv
VITE_GLOB_APP_NAME,
VITE_GLOB_APP_DESCRIPTION,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
} = viteEnv
// 以红色字体输出信息 // 以红色字体输出信息
const color = '\x1b[91m' const color = '\x1b[91m'
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
- ⭐Prettier - Code formatter - ⭐Prettier - Code formatter
- ⭐EditorConfig - ⭐EditorConfig
- ⭐TODO Highlight - ⭐TODO Highlight
- ⭐Volar
-[pont](https://marketplace.visualstudio.com/items?itemName=jasonHzq.vscode-pont) 接口自动化工具,**必装**
- ESLint - ESLint
- stylelint - stylelint
...@@ -27,7 +29,6 @@ ...@@ -27,7 +29,6 @@
- Path Intellisense - Path Intellisense
- Turbo Console Log - Turbo Console Log
- Vetur/Volar (eg: 两者二选一, Volar 对于 Vue3+TS 相对较友好, **本项目采用 Volar**)
- Ant-Design-Vue-Helper - Ant-Design-Vue-Helper
- GitLens - GitLens
......
...@@ -75,9 +75,11 @@ ...@@ -75,9 +75,11 @@
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3040220220310005", "@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3040220220310005",
"@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3040220220310005", "@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3040220220310005",
"@vueuse/core": "^8.1.2", "@vueuse/core": "^8.1.2",
"axios": "^0.26.1",
"dayjs": "^1.11.0", "dayjs": "^1.11.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"qs": "^6.10.3",
"vue": "^3.2.31" "vue": "^3.2.31"
}, },
"devDependencies": { "devDependencies": {
...@@ -91,6 +93,7 @@ ...@@ -91,6 +93,7 @@
"@types/lodash-es": "^4.17.6", "@types/lodash-es": "^4.17.6",
"@types/mockjs": "^1.0.6", "@types/mockjs": "^1.0.6",
"@types/prettier": "^2.4.4", "@types/prettier": "^2.4.4",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.16.0", "@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0", "@typescript-eslint/parser": "^5.16.0",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
...@@ -105,6 +108,7 @@ ...@@ -105,6 +108,7 @@
"less": "^4.1.2", "less": "^4.1.2",
"lint-staged": "^12.3.7", "lint-staged": "^12.3.7",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"pont-engine": "^1.2.0",
"postcss": "^8.4.12", "postcss": "^8.4.12",
"postcss-html": "^1.3.0", "postcss-html": "^1.3.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
......
...@@ -23,9 +23,11 @@ specifiers: ...@@ -23,9 +23,11 @@ specifiers:
'@types/lodash-es': ^4.17.6 '@types/lodash-es': ^4.17.6
'@types/mockjs': ^1.0.6 '@types/mockjs': ^1.0.6
'@types/prettier': ^2.4.4 '@types/prettier': ^2.4.4
'@types/qs': ^6.9.7
'@typescript-eslint/eslint-plugin': ^5.16.0 '@typescript-eslint/eslint-plugin': ^5.16.0
'@typescript-eslint/parser': ^5.16.0 '@typescript-eslint/parser': ^5.16.0
'@vueuse/core': ^8.1.2 '@vueuse/core': ^8.1.2
axios: ^0.26.1
commitizen: ^4.2.4 commitizen: ^4.2.4
conventional-changelog-cli: ^2.2.2 conventional-changelog-cli: ^2.2.2
cz-conventional-changelog: ^3.3.0 cz-conventional-changelog: ^3.3.0
...@@ -41,10 +43,12 @@ specifiers: ...@@ -41,10 +43,12 @@ specifiers:
lodash-es: ^4.17.21 lodash-es: ^4.17.21
mockjs: ^1.1.0 mockjs: ^1.1.0
npm-run-all: ^4.1.5 npm-run-all: ^4.1.5
pont-engine: ^1.2.0
postcss: ^8.4.12 postcss: ^8.4.12
postcss-html: ^1.3.0 postcss-html: ^1.3.0
postcss-less: ^6.0.0 postcss-less: ^6.0.0
prettier: ^2.6.0 prettier: ^2.6.0
qs: ^6.10.3
rimraf: ^3.0.2 rimraf: ^3.0.2
sort-package-json: ^1.55.0 sort-package-json: ^1.55.0
stylelint: ^14.6.0 stylelint: ^14.6.0
...@@ -74,9 +78,11 @@ dependencies: ...@@ -74,9 +78,11 @@ dependencies:
'@dcloudio/uni-mp-weixin': registry.npmjs.org/@dcloudio/uni-mp-weixin/3.0.0-alpha-3040220220310006_postcss@8.4.12+vue@3.2.31 '@dcloudio/uni-mp-weixin': registry.npmjs.org/@dcloudio/uni-mp-weixin/3.0.0-alpha-3040220220310006_postcss@8.4.12+vue@3.2.31
'@dcloudio/uni-quickapp-webview': registry.npmjs.org/@dcloudio/uni-quickapp-webview/3.0.0-alpha-3040220220310006_postcss@8.4.12+vue@3.2.31 '@dcloudio/uni-quickapp-webview': registry.npmjs.org/@dcloudio/uni-quickapp-webview/3.0.0-alpha-3040220220310006_postcss@8.4.12+vue@3.2.31
'@vueuse/core': registry.npmjs.org/@vueuse/core/8.1.2_vue@3.2.31 '@vueuse/core': registry.npmjs.org/@vueuse/core/8.1.2_vue@3.2.31
axios: registry.npmjs.org/axios/0.26.1
dayjs: registry.npmjs.org/dayjs/1.11.0 dayjs: registry.npmjs.org/dayjs/1.11.0
lodash-es: registry.npmjs.org/lodash-es/4.17.21 lodash-es: registry.npmjs.org/lodash-es/4.17.21
mockjs: registry.npmjs.org/mockjs/1.1.0 mockjs: registry.npmjs.org/mockjs/1.1.0
qs: registry.npmjs.org/qs/6.10.3
vue: registry.npmjs.org/vue/3.2.31 vue: registry.npmjs.org/vue/3.2.31
devDependencies: devDependencies:
...@@ -90,6 +96,7 @@ devDependencies: ...@@ -90,6 +96,7 @@ devDependencies:
'@types/lodash-es': registry.npmjs.org/@types/lodash-es/4.17.6 '@types/lodash-es': registry.npmjs.org/@types/lodash-es/4.17.6
'@types/mockjs': registry.npmjs.org/@types/mockjs/1.0.6 '@types/mockjs': registry.npmjs.org/@types/mockjs/1.0.6
'@types/prettier': registry.npmjs.org/@types/prettier/2.4.4 '@types/prettier': registry.npmjs.org/@types/prettier/2.4.4
'@types/qs': registry.npmjs.org/@types/qs/6.9.7
'@typescript-eslint/eslint-plugin': registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0_3fed250b11519414a4c7d52468dd6bf5 '@typescript-eslint/eslint-plugin': registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0_3fed250b11519414a4c7d52468dd6bf5
'@typescript-eslint/parser': registry.npmjs.org/@typescript-eslint/parser/5.16.0_eslint@8.11.0+typescript@4.6.2 '@typescript-eslint/parser': registry.npmjs.org/@typescript-eslint/parser/5.16.0_eslint@8.11.0+typescript@4.6.2
commitizen: registry.npmjs.org/commitizen/4.2.4 commitizen: registry.npmjs.org/commitizen/4.2.4
...@@ -104,6 +111,7 @@ devDependencies: ...@@ -104,6 +111,7 @@ devDependencies:
less: registry.npmjs.org/less/4.1.2 less: registry.npmjs.org/less/4.1.2
lint-staged: registry.npmjs.org/lint-staged/12.3.7 lint-staged: registry.npmjs.org/lint-staged/12.3.7
npm-run-all: registry.npmjs.org/npm-run-all/4.1.5 npm-run-all: registry.npmjs.org/npm-run-all/4.1.5
pont-engine: registry.npmjs.org/pont-engine/1.2.0
postcss: registry.npmjs.org/postcss/8.4.12 postcss: registry.npmjs.org/postcss/8.4.12
postcss-html: registry.npmjs.org/postcss-html/1.3.0 postcss-html: registry.npmjs.org/postcss-html/1.3.0
postcss-less: registry.npmjs.org/postcss-less/6.0.0_postcss@8.4.12 postcss-less: registry.npmjs.org/postcss-less/6.0.0_postcss@8.4.12
...@@ -2550,6 +2558,12 @@ packages: ...@@ -2550,6 +2558,12 @@ packages:
version: 1.0.2 version: 1.0.2
dev: true dev: true
registry.npmjs.org/@types/blueimp-md5/2.18.0:
resolution: {integrity: sha512-f4A+++lGZGJvVSgeyMkqA7BEf2BVQli6F+qEykKb49c5ieWQBkfpn6CP5c1IZr2Yi2Ofl6Fj+v0e1fN18Z8Cnw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/blueimp-md5/-/blueimp-md5-2.18.0.tgz}
name: '@types/blueimp-md5'
version: 2.18.0
dev: true
registry.npmjs.org/@types/eslint-scope/3.7.3: registry.npmjs.org/@types/eslint-scope/3.7.3:
resolution: {integrity: sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz} resolution: {integrity: sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz}
name: '@types/eslint-scope' name: '@types/eslint-scope'
...@@ -2620,6 +2634,12 @@ packages: ...@@ -2620,6 +2634,12 @@ packages:
version: 1.0.6 version: 1.0.6
dev: true dev: true
registry.npmjs.org/@types/node/12.20.47:
resolution: {integrity: sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-12.20.47.tgz}
name: '@types/node'
version: 12.20.47
dev: true
registry.npmjs.org/@types/node/17.0.22: registry.npmjs.org/@types/node/17.0.22:
resolution: {integrity: sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-17.0.22.tgz} resolution: {integrity: sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/node/-/node-17.0.22.tgz}
name: '@types/node' name: '@types/node'
...@@ -2642,6 +2662,12 @@ packages: ...@@ -2642,6 +2662,12 @@ packages:
version: 2.4.4 version: 2.4.4
dev: true dev: true
registry.npmjs.org/@types/qs/6.9.7:
resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz}
name: '@types/qs'
version: 6.9.7
dev: true
registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0_3fed250b11519414a4c7d52468dd6bf5: registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0_3fed250b11519414a4c7d52468dd6bf5:
resolution: {integrity: sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz} resolution: {integrity: sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz}
id: registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0 id: registry.npmjs.org/@typescript-eslint/eslint-plugin/5.16.0
...@@ -3422,6 +3448,16 @@ packages: ...@@ -3422,6 +3448,16 @@ packages:
postcss: registry.npmjs.org/postcss/8.4.12 postcss: registry.npmjs.org/postcss/8.4.12
postcss-value-parser: registry.npmjs.org/postcss-value-parser/4.2.0 postcss-value-parser: registry.npmjs.org/postcss-value-parser/4.2.0
registry.npmjs.org/axios/0.26.1:
resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/axios/-/axios-0.26.1.tgz}
name: axios
version: 0.26.1
dependencies:
follow-redirects: registry.npmjs.org/follow-redirects/1.14.9
transitivePeerDependencies:
- debug
dev: false
registry.npmjs.org/babel-loader/8.2.3_fa907c5a4f16ccc493e21649ccc59574: registry.npmjs.org/babel-loader/8.2.3_fa907c5a4f16ccc493e21649ccc59574:
resolution: {integrity: sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz} resolution: {integrity: sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz}
id: registry.npmjs.org/babel-loader/8.2.3 id: registry.npmjs.org/babel-loader/8.2.3
...@@ -3529,6 +3565,12 @@ packages: ...@@ -3529,6 +3565,12 @@ packages:
version: 3.7.2 version: 3.7.2
dev: false dev: false
registry.npmjs.org/blueimp-md5/2.19.0:
resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz}
name: blueimp-md5
version: 2.19.0
dev: true
registry.npmjs.org/body-parser/1.19.2: registry.npmjs.org/body-parser/1.19.2:
resolution: {integrity: sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz} resolution: {integrity: sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz}
name: body-parser name: body-parser
...@@ -3748,6 +3790,13 @@ packages: ...@@ -3748,6 +3790,13 @@ packages:
version: 2.2.1 version: 2.2.1
dev: true dev: true
registry.npmjs.org/cli-width/3.0.0:
resolution: {integrity: sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz}
name: cli-width
version: 3.0.0
engines: {node: '>= 10'}
dev: true
registry.npmjs.org/cliui/7.0.4: registry.npmjs.org/cliui/7.0.4:
resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz} resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz}
name: cliui name: cliui
...@@ -3810,7 +3859,6 @@ packages: ...@@ -3810,7 +3859,6 @@ packages:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/commander/-/commander-2.20.3.tgz} resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/commander/-/commander-2.20.3.tgz}
name: commander name: commander
version: 2.20.3 version: 2.20.3
dev: false
registry.npmjs.org/commander/8.3.0: registry.npmjs.org/commander/8.3.0:
resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/commander/-/commander-8.3.0.tgz} resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/commander/-/commander-8.3.0.tgz}
...@@ -5289,6 +5337,15 @@ packages: ...@@ -5289,6 +5337,15 @@ packages:
escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5 escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5
dev: true dev: true
registry.npmjs.org/figures/3.2.0:
resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/figures/-/figures-3.2.0.tgz}
name: figures
version: 3.2.0
engines: {node: '>=8'}
dependencies:
escape-string-regexp: registry.npmjs.org/escape-string-regexp/1.0.5
dev: true
registry.npmjs.org/file-entry-cache/6.0.1: registry.npmjs.org/file-entry-cache/6.0.1:
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz} resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz}
name: file-entry-cache name: file-entry-cache
...@@ -5417,6 +5474,18 @@ packages: ...@@ -5417,6 +5474,18 @@ packages:
version: 3.2.5 version: 3.2.5
dev: true dev: true
registry.npmjs.org/follow-redirects/1.14.9:
resolution: {integrity: sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz}
name: follow-redirects
version: 1.14.9
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
dev: false
registry.npmjs.org/forwarded/0.2.0: registry.npmjs.org/forwarded/0.2.0:
resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz} resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz}
name: forwarded name: forwarded
...@@ -5446,6 +5515,16 @@ packages: ...@@ -5446,6 +5515,16 @@ packages:
jsonfile: registry.npmjs.org/jsonfile/6.1.0 jsonfile: registry.npmjs.org/jsonfile/6.1.0
universalify: registry.npmjs.org/universalify/2.0.0 universalify: registry.npmjs.org/universalify/2.0.0
registry.npmjs.org/fs-extra/5.0.0:
resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz}
name: fs-extra
version: 5.0.0
dependencies:
graceful-fs: registry.npmjs.org/graceful-fs/4.2.9
jsonfile: registry.npmjs.org/jsonfile/4.0.0
universalify: registry.npmjs.org/universalify/0.1.2
dev: true
registry.npmjs.org/fs-extra/8.1.0: registry.npmjs.org/fs-extra/8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz} resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz}
name: fs-extra name: fs-extra
...@@ -6026,6 +6105,27 @@ packages: ...@@ -6026,6 +6105,27 @@ packages:
through: registry.npmjs.org/through/2.3.8 through: registry.npmjs.org/through/2.3.8
dev: true dev: true
registry.npmjs.org/inquirer/7.3.3:
resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz}
name: inquirer
version: 7.3.3
engines: {node: '>=8.0.0'}
dependencies:
ansi-escapes: registry.npmjs.org/ansi-escapes/4.3.2
chalk: registry.npmjs.org/chalk/4.1.2
cli-cursor: registry.npmjs.org/cli-cursor/3.1.0
cli-width: registry.npmjs.org/cli-width/3.0.0
external-editor: registry.npmjs.org/external-editor/3.1.0
figures: registry.npmjs.org/figures/3.2.0
lodash: registry.npmjs.org/lodash/4.17.21
mute-stream: registry.npmjs.org/mute-stream/0.0.8
run-async: registry.npmjs.org/run-async/2.4.1
rxjs: registry.npmjs.org/rxjs/6.6.7
string-width: registry.npmjs.org/string-width/4.2.3
strip-ansi: registry.npmjs.org/strip-ansi/6.0.1
through: registry.npmjs.org/through/2.3.8
dev: true
registry.npmjs.org/internal-slot/1.0.3: registry.npmjs.org/internal-slot/1.0.3:
resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz} resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz}
name: internal-slot name: internal-slot
...@@ -6991,6 +7091,12 @@ packages: ...@@ -6991,6 +7091,12 @@ packages:
version: 0.0.7 version: 0.0.7
dev: true dev: true
registry.npmjs.org/mute-stream/0.0.8:
resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz}
name: mute-stream
version: 0.0.8
dev: true
registry.npmjs.org/nanoid/3.3.1: registry.npmjs.org/nanoid/3.3.1:
resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz} resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz}
name: nanoid name: nanoid
...@@ -7036,6 +7142,20 @@ packages: ...@@ -7036,6 +7142,20 @@ packages:
version: 1.0.5 version: 1.0.5
dev: true dev: true
registry.npmjs.org/node-fetch/2.6.7:
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz}
name: node-fetch
version: 2.6.7
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: registry.npmjs.org/whatwg-url/5.0.0
dev: true
registry.npmjs.org/node-releases/2.0.2: registry.npmjs.org/node-releases/2.0.2:
resolution: {integrity: sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz} resolution: {integrity: sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz}
name: node-releases name: node-releases
...@@ -7113,7 +7233,6 @@ packages: ...@@ -7113,7 +7233,6 @@ packages:
resolution: {integrity: sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz} resolution: {integrity: sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz}
name: object-inspect name: object-inspect
version: 1.12.0 version: 1.12.0
dev: true
registry.npmjs.org/object-keys/1.1.1: registry.npmjs.org/object-keys/1.1.1:
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz} resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz}
...@@ -7443,6 +7562,25 @@ packages: ...@@ -7443,6 +7562,25 @@ packages:
find-up: registry.npmjs.org/find-up/4.1.0 find-up: registry.npmjs.org/find-up/4.1.0
dev: false dev: false
registry.npmjs.org/pont-engine/1.2.0:
resolution: {integrity: sha512-QMtzdxhpoARbq/SpXmrUf5RMS6RLzdM8rLA7SGukAqBjrEhAMRNOdbOmNDVayM/RwPkK5FUDxIVBxh2pOLpQ3A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/pont-engine/-/pont-engine-1.2.0.tgz}
name: pont-engine
version: 1.2.0
hasBin: true
dependencies:
chalk: registry.npmjs.org/chalk/2.4.2
commander: registry.npmjs.org/commander/2.20.3
fs-extra: registry.npmjs.org/fs-extra/5.0.0
inquirer: registry.npmjs.org/inquirer/7.3.3
lodash: registry.npmjs.org/lodash/4.17.21
node-fetch: registry.npmjs.org/node-fetch/2.6.7
prettier: registry.npmjs.org/prettier/2.6.0
translation.js: registry.npmjs.org/translation.js/0.7.15
typescript: registry.npmjs.org/typescript/3.9.10
transitivePeerDependencies:
- encoding
dev: true
registry.npmjs.org/postcss-comment/2.0.0: registry.npmjs.org/postcss-comment/2.0.0:
resolution: {integrity: sha512-5zT5iKU7c0tK9KJFNrVf+g1MGTkzf/4V3e0Zzm2g1uoFQC5jeTHmB9O1iAqh97+jnKpc6al204e0pwFUiCwseg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/postcss-comment/-/postcss-comment-2.0.0.tgz} resolution: {integrity: sha512-5zT5iKU7c0tK9KJFNrVf+g1MGTkzf/4V3e0Zzm2g1uoFQC5jeTHmB9O1iAqh97+jnKpc6al204e0pwFUiCwseg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/postcss-comment/-/postcss-comment-2.0.0.tgz}
name: postcss-comment name: postcss-comment
...@@ -7750,6 +7888,15 @@ packages: ...@@ -7750,6 +7888,15 @@ packages:
hasBin: true hasBin: true
dev: true dev: true
registry.npmjs.org/qs/6.10.3:
resolution: {integrity: sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/qs/-/qs-6.10.3.tgz}
name: qs
version: 6.10.3
engines: {node: '>=0.6'}
dependencies:
side-channel: registry.npmjs.org/side-channel/1.0.4
dev: false
registry.npmjs.org/qs/6.9.7: registry.npmjs.org/qs/6.9.7:
resolution: {integrity: sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/qs/-/qs-6.9.7.tgz} resolution: {integrity: sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/qs/-/qs-6.9.7.tgz}
name: qs name: qs
...@@ -8297,7 +8444,6 @@ packages: ...@@ -8297,7 +8444,6 @@ packages:
call-bind: registry.npmjs.org/call-bind/1.0.2 call-bind: registry.npmjs.org/call-bind/1.0.2
get-intrinsic: registry.npmjs.org/get-intrinsic/1.1.1 get-intrinsic: registry.npmjs.org/get-intrinsic/1.1.1
object-inspect: registry.npmjs.org/object-inspect/1.12.0 object-inspect: registry.npmjs.org/object-inspect/1.12.0
dev: true
registry.npmjs.org/signal-exit/3.0.7: registry.npmjs.org/signal-exit/3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz} resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz}
...@@ -9018,6 +9164,23 @@ packages: ...@@ -9018,6 +9164,23 @@ packages:
engines: {node: '>=0.6'} engines: {node: '>=0.6'}
dev: true dev: true
registry.npmjs.org/tr46/0.0.3:
resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz}
name: tr46
version: 0.0.3
dev: true
registry.npmjs.org/translation.js/0.7.15:
resolution: {integrity: sha512-TFgTbvbUY73JXIir3A/MUBDkdlstYOIF3PzpzsC8T5FZVCWrRHtdLeICN0G//GblX3vKCg3cSdCnTovq1/utxw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/translation.js/-/translation.js-0.7.15.tgz}
name: translation.js
version: 0.7.15
dependencies:
'@types/blueimp-md5': registry.npmjs.org/@types/blueimp-md5/2.18.0
'@types/node': registry.npmjs.org/@types/node/12.20.47
blueimp-md5: registry.npmjs.org/blueimp-md5/2.19.0
tslib: registry.npmjs.org/tslib/1.14.1
dev: true
registry.npmjs.org/trim-newlines/3.0.1: registry.npmjs.org/trim-newlines/3.0.1:
resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz} resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz}
name: trim-newlines name: trim-newlines
...@@ -9147,6 +9310,14 @@ packages: ...@@ -9147,6 +9310,14 @@ packages:
mime-types: registry.npmjs.org/mime-types/2.1.35 mime-types: registry.npmjs.org/mime-types/2.1.35
dev: true dev: true
registry.npmjs.org/typescript/3.9.10:
resolution: {integrity: sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz}
name: typescript
version: 3.9.10
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
registry.npmjs.org/typescript/4.6.2: registry.npmjs.org/typescript/4.6.2:
resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz} resolution: {integrity: sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz}
name: typescript name: typescript
...@@ -9469,6 +9640,12 @@ packages: ...@@ -9469,6 +9640,12 @@ packages:
graceful-fs: registry.npmjs.org/graceful-fs/4.2.9 graceful-fs: registry.npmjs.org/graceful-fs/4.2.9
dev: false dev: false
registry.npmjs.org/webidl-conversions/3.0.1:
resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz}
name: webidl-conversions
version: 3.0.1
dev: true
registry.npmjs.org/webpack-sources/3.2.3: registry.npmjs.org/webpack-sources/3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz} resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz}
name: webpack-sources name: webpack-sources
...@@ -9524,6 +9701,15 @@ packages: ...@@ -9524,6 +9701,15 @@ packages:
- uglify-js - uglify-js
dev: false dev: false
registry.npmjs.org/whatwg-url/5.0.0:
resolution: {integrity: sha1-lmRU6HZUYuN2RNNib2dCzotwll0=, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz}
name: whatwg-url
version: 5.0.0
dependencies:
tr46: registry.npmjs.org/tr46/0.0.3
webidl-conversions: registry.npmjs.org/webidl-conversions/3.0.1
dev: true
registry.npmjs.org/which-boxed-primitive/1.0.2: registry.npmjs.org/which-boxed-primitive/1.0.2:
resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz} resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz}
name: which-boxed-primitive name: which-boxed-primitive
......
{
"originUrl": "http://localhost:8181/api/v2/api-docs",
"templatePath": "./pont.template",
"outDir": "./src/api/services",
"surrounding": "typeScript",
"mocks": {
"enable": true,
"basePath": "",
"port": 3101,
"wrapper": "{\"status\": 200, \"body\": {response}, \"message\": \"OK\"}"
},
"templateType": "fetch",
"prettierConfig": {
"printWidth": 120,
"semi": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all",
"proseWrap": "never",
"endOfLine": "lf"
}
}
import { Interface, BaseClass, Property, CodeGenerator } from 'pont-engine'
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const API_URL_PREFIX = '/api'
export default class BasicGenerator extends CodeGenerator {
getParams(inter: Interface, paramsCode: string) {
let requestParams = inter.getRequestParams(this.surrounding)
const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
requestParams = requestParams.replace('params', 'params?')
}
return `${requestParams.replace(
'options?: any',
`config?: http.RequestConfig<Params${requestParams.includes('form') ? ' | FormData' : ''}>`,
)}, options?: http.RequestOptions`
}
getInterfaceContentInDeclaration(inter: Interface) {
const paramsCode = inter.getParamsCode('Params')
const requestParams = this.getParams(inter, paramsCode)
return `
export ${paramsCode}
export type Response = ${inter.responseType.replace(/defs.Result\<(.*)\>/, '$1')};
export const init: Response;
export function request(${requestParams}): Promise<Response>;
`
}
getBaseClassInDeclaration(base: BaseClass) {
const originProps = base.properties
base.properties = base.properties.map((prop) => {
return new Property({
...prop,
required: false,
})
})
const result = super.getBaseClassInDeclaration(base)
base.properties = originProps
return result
}
getInterfaceContent(inter: Interface) {
const method = inter.method.toUpperCase()
const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode)
return `
/**
* @desc ${inter.description}
*/
import * as defs from '../../baseClass';
import { defHttp } from '/@/utils/http/axios'
export ${paramsCode}
export const init = ${inter.response.getInitialValue()};
export function request(${requestParams}) {
return defHttp.request({
url: "${inter.path.replace(API_URL_PREFIX, '')}",
method: '${method}',
${
method === 'GET'
? 'params'
: `data: ${requestParams.includes('form') ? 'form || params' : 'params'}`
},
...config,
}, options);
}
`
}
reviseModName(modName: string) {
// .replace(/\//g, '.').replace(/^\./, '').replace(/\./g, '_') 转换 / .为下划线
// exp: /api/v1/users => api_v1_users
// exp: api.v1.users => api_v1_users
return modName.replace(/\//g, '.').replace(/^\./, '').replace(/\./g, '_')
}
/** 获取所有模块的 index 入口文件 */
getModsIndex() {
let conclusion = `
export const API = {
${this.dataSource.mods.map((mod) => this.reviseModName(mod.name)).join(', \n')}
};
`
// dataSource name means multiple dataSource
if (this.dataSource.name) {
conclusion = `
export const ${this.dataSource.name} = {
${this.dataSource.mods.map((mod) => this.reviseModName(mod.name)).join(', \n')}
};
`
}
return `
${this.dataSource.mods
.map((mod) => {
const modName = this.reviseModName(mod.name)
return `import * as ${modName} from './${modName}';`
})
.join('\n')}
${conclusion}
`
}
/** 获取接口类和基类的总的 index 入口文件代码 */
getIndex() {
let conclusion = `
import * as defs from './baseClass';
import './mods/';
export { defs };
`
// dataSource name means multiple dataSource
if (this.dataSource.name) {
conclusion = `
import { ${this.dataSource.name} as defs } from './baseClass';
export { ${this.dataSource.name} } from './mods/';
export { defs };
`
}
return conclusion
}
}
module.exports = { module.exports = {
printWidth: 100, printWidth: 120,
semi: false, semi: false,
tabWidth: 4, tabWidth: 4,
vueIndentScriptAndStyle: true, vueIndentScriptAndStyle: true,
...@@ -8,12 +8,4 @@ module.exports = { ...@@ -8,12 +8,4 @@ module.exports = {
proseWrap: 'never', proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict', htmlWhitespaceSensitivity: 'strict',
endOfLine: 'lf', endOfLine: 'lf',
overrides: [
{
files: ['*.{yml,yaml,styl}'],
options: {
tabWidth: 2,
},
},
],
} }
[
{
"mods": [
{
"description": "",
"interfaces": [
{
"consumes": [
"application/json"
],
"description": "登录",
"name": "login",
"method": "post",
"path": "/api/auth/login",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "LoginVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "账号(支持用户名/手机号/邮箱)",
"name": "account",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "密码",
"name": "password",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "登出",
"name": "logout",
"method": "get",
"path": "/api/auth/logout",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"consumes": [
"application/json"
],
"description": "注册",
"name": "register",
"method": "post",
"path": "/api/auth/register",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "头像",
"name": "avatar",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "邮箱",
"name": "email",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "是否启用",
"name": "enable",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "简介",
"name": "introduction",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "手机号",
"name": "mobile",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "密码",
"name": "password",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "真实姓名",
"name": "realName",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "用户名",
"name": "username",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
}
],
"name": "auth"
},
{
"description": "",
"interfaces": [
{
"description": "hello",
"name": "hello",
"method": "get",
"path": "/api/hello/",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "fail",
"name": "fail",
"method": "get",
"path": "/api/hello/fail",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "page",
"name": "page",
"method": "get",
"path": "/api/hello/page",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "PageVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "当前页数",
"name": "pageNo",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "分页条数",
"name": "pageSize",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序字段",
"name": "sortField",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序方向(ASC|DESC)",
"name": "sortOrder",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
}
}
]
}
],
"name": "hello"
},
{
"description": "",
"interfaces": [
{
"consumes": [
"multipart/form-data"
],
"description": "文件上传",
"name": "upload",
"method": "post",
"path": "/api/common/minio/upload",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "formData",
"description": "文件",
"name": "file",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "File",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
}
],
"name": "minio"
},
{
"description": "",
"interfaces": [
{
"consumes": [
"application/json"
],
"description": "新增",
"name": "add",
"method": "post",
"path": "/api/manage/permission/add",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "组件",
"name": "component",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "是否启用",
"name": "enable",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "是否隐藏",
"name": "hidden",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "图标",
"name": "icon",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "元数据",
"name": "meta",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "名称",
"name": "name",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "路径",
"name": "path",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "父级ID",
"name": "pid",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "重定向",
"name": "redirect",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "序号",
"name": "serial",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "权限类型",
"name": "type",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": []
}
},
{
"in": "query",
"description": "标识",
"name": "uid",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/json"
],
"description": "删除",
"name": "deleted",
"method": "post",
"path": "/api/manage/permission/deleted",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "查询",
"name": "find",
"method": "get",
"path": "/api/manage/permission/find",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/json"
],
"description": "修改",
"name": "modify",
"method": "post",
"path": "/api/manage/permission/modify",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "组件",
"name": "component",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "是否启用",
"name": "enable",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "是否隐藏",
"name": "hidden",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "图标",
"name": "icon",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "元数据",
"name": "meta",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "名称",
"name": "name",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "路径",
"name": "path",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "父级ID",
"name": "pid",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "重定向",
"name": "redirect",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "序号",
"name": "serial",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "权限类型",
"name": "type",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": []
}
},
{
"in": "query",
"description": "标识",
"name": "uid",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页查询",
"name": "page",
"method": "get",
"path": "/api/manage/permission/page",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "PageVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "当前页数",
"name": "pageNo",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "分页条数",
"name": "pageSize",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序字段",
"name": "sortField",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序方向(ASC|DESC)",
"name": "sortOrder",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/x-www-form-urlencoded"
],
"description": "树结构查询",
"name": "tree",
"method": "get",
"path": "/api/manage/permission/tree",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "父级 id",
"name": "pid",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
}
],
"name": "permission"
},
{
"description": "",
"interfaces": [
{
"consumes": [
"application/json"
],
"description": "新增",
"name": "add",
"method": "post",
"path": "/api/manage/role/add",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "名称",
"name": "name",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "标识",
"name": "uid",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/json"
],
"description": "分配权限",
"name": "assign",
"method": "post",
"path": "/api/manage/role/assign",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "ids 多个以逗号分割",
"name": "ids",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/json"
],
"description": "删除",
"name": "deleted",
"method": "post",
"path": "/api/manage/role/deleted",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "查询",
"name": "find",
"method": "get",
"path": "/api/manage/role/find",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "RoleVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"consumes": [
"application/json"
],
"description": "修改",
"name": "modify",
"method": "post",
"path": "/api/manage/role/modify",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "名称",
"name": "name",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "标识",
"name": "uid",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页查询",
"name": "page",
"method": "get",
"path": "/api/manage/role/page",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "RoleVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "PageVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "当前页数",
"name": "pageNo",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "分页条数",
"name": "pageSize",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序字段",
"name": "sortField",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序方向(ASC|DESC)",
"name": "sortOrder",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
}
}
]
},
{
"description": "选项查询",
"name": "selector",
"method": "get",
"path": "/api/manage/role/selector",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "RoleVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
}
],
"name": "role"
},
{
"description": "",
"interfaces": [
{
"description": "获取用户菜单",
"name": "getMenuList",
"method": "get",
"path": "/api/user/getMenuList",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "MenuVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取用户权限",
"name": "getPermCode",
"method": "get",
"path": "/api/user/getPermCode",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"description": "获取登录用户信息",
"name": "getUserInfo",
"method": "get",
"path": "/api/user/getUserInfo",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserInfo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"consumes": [
"application/json"
],
"description": "分配角色",
"name": "assign",
"method": "post",
"path": "/api/user/manage/assign",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "id",
"name": "id",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "ids 多个以逗号分割",
"name": "ids",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页查询",
"name": "page",
"method": "get",
"path": "/api/user/manage/page",
"response": {
"typeArgs": [
{
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "PageVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{
"in": "query",
"description": "当前页数",
"name": "pageNo",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "分页条数",
"name": "pageSize",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序字段",
"name": "sortField",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
},
{
"in": "query",
"description": "排序方向(ASC|DESC)",
"name": "sortOrder",
"required": false,
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
}
}
]
}
],
"name": "user"
}
],
"baseClasses": [
{
"name": "LoginVo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "token",
"description": "token",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "userId",
"description": "主键",
"required": false
}
],
"templateArgs": []
},
{
"name": "MenuVo",
"properties": [
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "MenuVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "children",
"description": "子权限",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "component",
"description": "组件",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
{
"typeArgs": [],
"typeName": "object",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "ObjectMap",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "meta",
"description": "元数据",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "name",
"description": "名称",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "path",
"description": "路径",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "redirect",
"description": "重定向",
"required": false
}
],
"templateArgs": []
},
{
"name": "PageVo",
"properties": [
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": 0,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "data",
"description": "数据",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "latest",
"description": "数据最新时间",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "total",
"description": "数据总数",
"required": false
}
],
"templateArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
]
},
{
"name": "PermissionVo",
"properties": [
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "children",
"description": "子权限",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "component",
"description": "组件",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "enable",
"description": "是否启用",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "hidden",
"description": "是否隐藏",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "icon",
"description": "图标",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "id",
"description": "主键",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
{
"typeArgs": [],
"typeName": "object",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "ObjectMap",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "meta",
"description": "元数据",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "name",
"description": "名称",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "path",
"description": "路径",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pid",
"description": "父级ID",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "serial",
"description": "序号",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": []
},
"name": "type",
"description": "权限类型",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "uid",
"description": "标识",
"required": false
}
],
"templateArgs": []
},
{
"name": "Result",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "LoginVo",
"isDefsType": true,
"templateIndex": 0,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "body",
"description": "内容",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "code",
"description": "业务标识码",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "details",
"description": "详细信息",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "error",
"description": "异常信息",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "message",
"description": "消息",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "status",
"description": "状态码",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "times",
"description": "耗时",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "timestamp",
"description": "响应时间",
"required": false
}
],
"templateArgs": [
{
"typeArgs": [],
"typeName": "LoginVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
]
},
{
"name": "RoleVo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "id",
"description": "主键",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "name",
"description": "名称",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "PermissionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "permissions",
"description": "权限",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "uid",
"description": "标识",
"required": false
}
],
"templateArgs": []
},
{
"name": "UserInfo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "avatar",
"description": "头像",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "desc",
"description": "介绍",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "homePath",
"description": "用户主页",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "realName",
"description": "真实姓名",
"required": false
},
{
"dataType": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "RoleVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Array",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "roles",
"description": "角色",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "userId",
"description": "主键",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "username",
"description": "用户名",
"required": false
}
],
"templateArgs": []
},
{
"name": "UserVo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "avatar",
"description": "头像",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "createTime",
"description": "最后登录时间",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "deleted",
"description": "是否删除",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "email",
"description": "邮箱",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "enabled",
"description": "是否启用",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "id",
"description": "主键",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "lastLoginIp",
"description": "最后登录IP地址",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "lastLoginTime",
"description": "最后登录时间",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "mobile",
"description": "手机号",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "realName",
"description": "真实姓名",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "title",
"description": "职称",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "username",
"description": "用户名",
"required": false
}
],
"templateArgs": []
}
],
"name": ""
}
]
\ No newline at end of file
type ObjectMap<Key extends string | number | symbol = any, Value = any> = {
[key in Key]: Value
}
declare namespace defs {
export class LoginVo {
/** token */
token?: string
/** 主键 */
userId?: number
}
export class MenuVo {
/** 子权限 */
children?: Array<defs.MenuVo>
/** 组件 */
component?: string
/** 元数据 */
meta?: ObjectMap<any, object>
/** 名称 */
name?: string
/** 路径 */
path?: string
/** 重定向 */
redirect?: string
}
export class PageVo<T0 = any> {
/** 数据 */
data?: Array<T0>
/** 数据最新时间 */
latest?: string
/** 数据总数 */
total?: number
}
export class PermissionVo {
/** 子权限 */
children?: Array<defs.PermissionVo>
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 主键 */
id?: number
/** 元数据 */
meta?: ObjectMap<any, object>
/** 名称 */
name?: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 序号 */
serial?: number
/** 权限类型 */
type?: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid?: string
}
export class Result<T0 = any> {
/** 内容 */
body?: T0
/** 业务标识码 */
code?: number
/** 详细信息 */
details?: string
/** 异常信息 */
error?: string
/** 消息 */
message?: string
/** 状态码 */
status?: number
/** 耗时 */
times?: string
/** 响应时间 */
timestamp?: string
}
export class RoleVo {
/** 主键 */
id?: number
/** 名称 */
name?: string
/** 权限 */
permissions?: Array<defs.PermissionVo>
/** 标识 */
uid?: string
}
export class UserInfo {
/** 头像 */
avatar?: string
/** 介绍 */
desc?: string
/** 用户主页 */
homePath?: string
/** 真实姓名 */
realName?: string
/** 角色 */
roles?: Array<defs.RoleVo>
/** 主键 */
userId?: number
/** 用户名 */
username?: string
}
export class UserVo {
/** 头像 */
avatar?: string
/** 最后登录时间 */
createTime?: string
/** 是否删除 */
deleted?: boolean
/** 邮箱 */
email?: string
/** 是否启用 */
enabled?: boolean
/** 主键 */
id?: number
/** 最后登录IP地址 */
lastLoginIp?: string
/** 最后登录时间 */
lastLoginTime?: string
/** 手机号 */
mobile?: string
/** 真实姓名 */
realName?: string
/** 职称 */
title?: string
/** 用户名 */
username?: string
}
}
declare namespace API {
/**
*
*/
export namespace auth {
/**
* 登录
* /api/auth/login
*/
export namespace login {
export class Params {
/** 账号(支持用户名/手机号/邮箱) */
account: string
/** 密码 */
password: string
}
export type Response = defs.LoginVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 登出
* /api/auth/logout
*/
export namespace logout {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 注册
* /api/auth/register
*/
export namespace register {
export class Params {
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace hello {
/**
* hello
* /api/hello/
*/
export namespace hello {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* fail
* /api/hello/fail
*/
export namespace fail {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* page
* /api/hello/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<string>
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace minio {
/**
* 文件上传
* /api/common/minio/upload
*/
export namespace upload {
export class Params {}
export type Response = string
export const init: Response
export function request(
params?: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace permission {
/**
* 新增
* /api/manage/permission/add
*/
export namespace add {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /api/manage/permission/deleted
*/
export namespace deleted {
export class Params {
/** id */
id: number
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 查询
* /api/manage/permission/find
*/
export namespace find {
export class Params {
/** id */
id: number
}
export type Response = defs.PermissionVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 修改
* /api/manage/permission/modify
*/
export namespace modify {
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: number
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /api/manage/permission/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.PermissionVo>
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 树结构查询
* /api/manage/permission/tree
*/
export namespace tree {
export class Params {
/** 父级 id */
pid?: number
}
export type Response = Array<defs.PermissionVo>
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace role {
/**
* 新增
* /api/manage/role/add
*/
export namespace add {
export class Params {
/** 名称 */
name: string
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分配权限
* /api/manage/role/assign
*/
export namespace assign {
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 删除
* /api/manage/role/deleted
*/
export namespace deleted {
export class Params {
/** id */
id: number
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 查询
* /api/manage/role/find
*/
export namespace find {
export class Params {
/** id */
id: number
}
export type Response = defs.RoleVo
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 修改
* /api/manage/role/modify
*/
export namespace modify {
export class Params {
/** id */
id: number
/** 名称 */
name: string
/** 标识 */
uid: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /api/manage/role/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.RoleVo>
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 选项查询
* /api/manage/role/selector
*/
export namespace selector {
export class Params {}
export type Response = Array<defs.RoleVo>
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
/**
*
*/
export namespace user {
/**
* 获取用户菜单
* /api/user/getMenuList
*/
export namespace getMenuList {
export class Params {}
export type Response = Array<defs.MenuVo>
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 获取用户权限
* /api/user/getPermCode
*/
export namespace getPermCode {
export class Params {}
export type Response = Array<string>
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 获取登录用户信息
* /api/user/getUserInfo
*/
export namespace getUserInfo {
export class Params {}
export type Response = defs.UserInfo
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分配角色
* /api/user/manage/assign
*/
export namespace assign {
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页查询
* /api/user/manage/page
*/
export namespace page {
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.UserVo>
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
}
}
export class LoginVo {
/** token */
token = ''
/** 主键 */
userId = undefined
}
export class MenuVo {
/** 子权限 */
children = []
/** 组件 */
component = ''
/** 元数据 */
meta = undefined
/** 名称 */
name = ''
/** 路径 */
path = ''
/** 重定向 */
redirect = ''
}
export class PageVo {
/** 数据 */
data = []
/** 数据最新时间 */
latest = ''
/** 数据总数 */
total = undefined
}
export class PermissionVo {
/** 子权限 */
children = []
/** 组件 */
component = ''
/** 是否启用 */
enable = false
/** 是否隐藏 */
hidden = false
/** 图标 */
icon = ''
/** 主键 */
id = undefined
/** 元数据 */
meta = undefined
/** 名称 */
name = ''
/** 路径 */
path = ''
/** 父级ID */
pid = undefined
/** 序号 */
serial = undefined
/** 权限类型 */
type = 'DIR'
/** 标识 */
uid = ''
}
export class Result {
/** 内容 */
body = new LoginVo()
/** 业务标识码 */
code = undefined
/** 详细信息 */
details = ''
/** 异常信息 */
error = ''
/** 消息 */
message = ''
/** 状态码 */
status = undefined
/** 耗时 */
times = ''
/** 响应时间 */
timestamp = ''
}
export class RoleVo {
/** 主键 */
id = undefined
/** 名称 */
name = ''
/** 权限 */
permissions = []
/** 标识 */
uid = ''
}
export class UserInfo {
/** 头像 */
avatar = ''
/** 介绍 */
desc = ''
/** 用户主页 */
homePath = ''
/** 真实姓名 */
realName = ''
/** 角色 */
roles = []
/** 主键 */
userId = undefined
/** 用户名 */
username = ''
}
export class UserVo {
/** 头像 */
avatar = ''
/** 最后登录时间 */
createTime = ''
/** 是否删除 */
deleted = false
/** 邮箱 */
email = ''
/** 是否启用 */
enabled = false
/** 主键 */
id = undefined
/** 最后登录IP地址 */
lastLoginIp = ''
/** 最后登录时间 */
lastLoginTime = ''
/** 手机号 */
mobile = ''
/** 真实姓名 */
realName = ''
/** 职称 */
title = ''
/** 用户名 */
username = ''
}
import * as defs from './baseClass'
import './mods/'
export { defs }
/**
* @description
*/
import * as login from './login'
import * as logout from './logout'
import * as register from './register'
export { login, logout, register }
/**
* @desc 登录
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 账号(支持用户名/手机号/邮箱) */
account: string
/** 密码 */
password: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/login',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 登出
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/logout',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 注册
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 头像 */
avatar?: string
/** 邮箱 */
email?: string
/** 是否启用 */
enable?: boolean
/** 简介 */
introduction?: string
/** 手机号 */
mobile: string
/** 密码 */
password: string
/** 真实姓名 */
realName: string
/** 用户名 */
username: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/auth/register',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc fail
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/hello/fail',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc hello
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/hello/',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as hello from './hello'
import * as fail from './fail'
import * as page from './page'
export { hello, fail, page }
/**
* @desc page
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/hello/page',
method: 'GET',
params,
...config,
},
options,
)
}
import * as auth from './auth'
import * as hello from './hello'
import * as minio from './minio'
import * as permission from './permission'
import * as role from './role'
import * as user from './user'
export const API = {
auth,
hello,
minio,
permission,
role,
user,
}
/**
* @description
*/
import * as upload from './upload'
export { upload }
/**
* @desc 文件上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(
params?: Params,
form: FormData,
config?: http.RequestConfig<Params | FormData>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/common/minio/upload',
method: 'POST',
data: form || params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/deleted',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as add from './add'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as tree from './tree'
export { add, deleted, find, modify, page, tree }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 组件 */
component?: string
/** 是否启用 */
enable?: boolean
/** 是否隐藏 */
hidden?: boolean
/** 图标 */
icon?: string
/** id */
id: number
/** 元数据 */
meta?: string
/** 名称 */
name: string
/** 路径 */
path?: string
/** 父级ID */
pid?: number
/** 重定向 */
redirect?: string
/** 序号 */
serial?: number
/** 权限类型 */
type: 'DIR' | 'MENU' | 'BUTTON'
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 树结构查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 父级 id */
pid?: number
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/permission/tree',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 新增
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 名称 */
name: string
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/add',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分配权限
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/assign',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 删除
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/deleted',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/find',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as add from './add'
import * as assign from './assign'
import * as deleted from './deleted'
import * as find from './find'
import * as modify from './modify'
import * as page from './page'
import * as selector from './selector'
export { add, assign, deleted, find, modify, page, selector }
/**
* @desc 修改
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** 名称 */
name: string
/** 标识 */
uid: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/modify',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/page',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 选项查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/manage/role/selector',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 分配角色
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** id */
id: number
/** ids 多个以逗号分割 */
ids: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/user/manage/assign',
method: 'POST',
data: params,
...config,
},
options,
)
}
/**
* @desc 获取用户菜单
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/user/getMenuList',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 获取用户权限
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/user/getPermCode',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @desc 获取登录用户信息
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {}
export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/user/getUserInfo',
method: 'GET',
params,
...config,
},
options,
)
}
/**
* @description
*/
import * as getMenuList from './getMenuList'
import * as getPermCode from './getPermCode'
import * as getUserInfo from './getUserInfo'
import * as assign from './assign'
import * as page from './page'
export { getMenuList, getPermCode, getUserInfo, assign, page }
/**
* @desc 分页查询
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/user/manage/page',
method: 'GET',
params,
...config,
},
options,
)
}
/** export interface Result<T = any> {
* 通用响应内容包装 /**
*/ * 状态码
*/
namespace API { status: Status
export interface Result<T = any> {
/** /**
* 状态码 * 消息
*/ */
status: Status message: string
/** /**
* 消息 * 响应时间
*/ */
message: string timestamp: string
/** /**
* 响应时间 * 接口耗时(不含网络通信时间)
*/ */
timestamp: string times: string
/** /**
* 接口耗时(不含网络通信时间) * 自定义错误码
*/ */
times: string code: number
/** /**
* 自定义错误码 * 详细信息
*/ */
code: number details?: string
/** /**
* 详细信息 * 异常信息
*/ */
details?: string error?: string
/** /**
* 异常信息 * 响应内容
*/ */
error?: string body: T
}
/**
* 响应内容
*/
body: T
}
export enum Status { export enum Status {
/** /**
* 成功 * 成功
*/ */
OK = 200, OK = 200,
/** /**
* 用户认证失败 * 用户认证失败
*/ */
NON_AUTHORITATIVE_INFORMATION = 203, NON_AUTHORITATIVE_INFORMATION = 203,
/** /**
* 失败的请求,通常是一些验证错误(当出现该状态码时,将产生对应的业务错误编码,可以使用 Result.details 进行交互提醒) * 失败的请求,通常是一些验证错误(当出现该状态码时,将产生对应的业务错误编码,可以使用 Result.details 进行交互提醒)
*/ */
FAIL = 400, FAIL = 400,
/** /**
* 鉴权失败 * 鉴权失败
*/ */
UNAUTHORIZED = 401, UNAUTHORIZED = 401,
/** /**
* Token 错误/失效 * Token 错误/失效
*/ */
FORBIDDEN = 403, FORBIDDEN = 403,
/** /**
* 找不到资源 * 找不到资源
*/ */
NOT_FOUND = 404, NOT_FOUND = 404,
/** /**
* 不支持的请求类型 * 不支持的请求类型
*/ */
METHOD_NOT_ALLOWED = 405, METHOD_NOT_ALLOWED = 405,
/** /**
* 服务器错误 * 服务器错误
*/ */
INTERNAL_SERVER_ERROR = 500, INTERNAL_SERVER_ERROR = 500,
/** /**
* 未知错误 * 未知错误
*/ */
UNKNOWN_ERROR = 500, UNKNOWN_ERROR = 500,
/** /**
* API 未实现 * API 未实现
*/ */
NOT_IMPLEMENTED = 501, NOT_IMPLEMENTED = 501,
/** /**
* 服务异常(网关提醒) * 服务异常(网关提醒)
*/ */
BAD_GATEWAY = 502, BAD_GATEWAY = 502,
/** /**
* 服务暂停(网关提醒) * 服务暂停(网关提醒)
*/ */
SERVICE_UNAVAILABLE = 503, SERVICE_UNAVAILABLE = 503,
} }
export function toMessage(status: Status): string { export function toMessage(status: Status): string {
switch (status) { switch (status) {
case Status.OK: case Status.OK:
return '成功' return '成功'
case Status.FAIL: case Status.FAIL:
return '失败' return '失败'
case Status.UNAUTHORIZED: case Status.UNAUTHORIZED:
return '用户认证失败' return '用户认证失败'
case Status.FORBIDDEN: case Status.FORBIDDEN:
return '拒绝访问' return '拒绝访问'
case Status.NOT_FOUND: case Status.NOT_FOUND:
return '找不到资源' return '找不到资源'
case Status.INTERNAL_SERVER_ERROR: case Status.INTERNAL_SERVER_ERROR:
return '服务器错误' return '服务器错误'
case Status.NOT_IMPLEMENTED: case Status.NOT_IMPLEMENTED:
return '未实现' return '未实现'
case Status.BAD_GATEWAY: case Status.BAD_GATEWAY:
return '网关错误' return '网关错误'
case Status.SERVICE_UNAVAILABLE: case Status.SERVICE_UNAVAILABLE:
return '服务暂停' return '服务暂停'
default: default:
return '未知错误' return '未知错误'
}
} }
} }
export { API }
// token key
export const TOKEN_KEY = 'TOKEN__'
export const LOCALE_KEY = 'LOCALE__'
// user info key
export const USER_INFO_KEY = 'USER__INFO__'
// role info key
export const ROLES_KEY = 'ROLES__KEY__'
// project config key
export const PROJ_CFG_KEY = 'PROJ__CFG__KEY__'
// lock info
export const LOCK_INFO_KEY = 'LOCK__INFO__KEY__'
export const MULTIPLE_TABS_KEY = 'MULTIPLE_TABS__KEY__'
export const APP_DARK_MODE_KEY_ = '__APP__DARK__MODE__'
// base global local key
export const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY__'
// base global session key
export const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY__'
export enum CacheTypeEnum {
SESSION,
LOCAL,
}
/**
* @description: Request result set
*/
export enum ResultEnum {}
/**
* @description: request method
*/
export enum RequestEnum {
GET = 'GET',
POST = 'POST',
PUT = 'PUT',
DELETE = 'DELETE',
}
/**
* @description: contentType
*/
export enum ContentTypeEnum {
// json
JSON = 'application/json;charset=UTF-8',
// form-data qs
FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
// form-data upload
FORM_DATA = 'multipart/form-data;charset=UTF-8',
}
const Message = {
success: (msg: string) => {
uni.showToast({
title: msg,
icon: 'success',
})
},
error: (msg: string) => {
uni.showToast({
title: msg,
icon: 'error',
})
},
}
const createErrorModal = (options: { title: string; content: string }) => {
uni.showModal({
title: options.title,
content: options.content,
showCancel: false,
})
}
/**
* @description: message
*/
export function useMessage() {
return {
createMessage: Message,
createErrorModal,
}
}
import type { GlobConfig } from '/#/config'
import { getAppEnvConfig } from '/@/utils/env'
export const useGlobSetting = (): Readonly<GlobConfig> => {
const {
VITE_GLOB_APP_NAME,
VITE_GLOB_APP_DESCRIPTION,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
} = getAppEnvConfig()
// Take global configuration
const glob: Readonly<GlobConfig> = {
name: VITE_GLOB_APP_NAME,
description: VITE_GLOB_APP_DESCRIPTION,
apiUrl: VITE_GLOB_API_URL,
urlPrefix: VITE_GLOB_API_URL_PREFIX,
uploadUrl: VITE_GLOB_UPLOAD_URL,
}
return glob as Readonly<GlobConfig>
}
<script setup lang="ts"> <script setup lang="ts">
const title = ref('Hello World') const title = ref('Hello World')
// TODO: 测试接口
API.hello.hello.request().then((body) => {
console.log(body)
})
API.hello.page
.request({
pageNo: 1,
pageSize: 10,
})
.then((body) => {
console.log(body)
})
</script> </script>
<template> <template>
......
import { isDevMode } from '/@/utils/env'
// System default cache time, in seconds
export const DEFAULT_CACHE_TIME = 60 * 60 * 24 * 7
// aes encryption key
export const cacheCipher = {
key: '_11111000001111@',
iv: '@11111000001111_',
}
// Whether the system cache is encrypted using aes
export const enableStorageEncryption = !isDevMode()
import { TOKEN_KEY } from '/@/enums/cacheEnum'
export function getToken() {
return getAuthCache(TOKEN_KEY)
}
export function getAuthCache(key: string): string | null {
try {
const value = uni.getStorageSync(key)
if (value) {
return value
}
} catch (e) {}
return null
}
export function setAuthCache(key: string, value: string) {
try {
uni.setStorageSync(key, value)
} catch (e) {}
}
export function clearAuthCache() {
try {
uni.clearStorageSync()
} catch (e) {}
}
import pkg from '../../package.json'
import { getConfigFileName } from '../../build/getConfigFileName'
export function getCommonStoragePrefix() {
return `${pkg.name}__${getEnv()}`.toUpperCase()
}
// Generate cache key according to version
export function getStorageShortName() {
return `${getCommonStoragePrefix()}${`__${pkg.version}`}__`.toUpperCase()
}
export function getAppEnvConfig() {
const ENV_NAME = getConfigFileName(import.meta.env)
const ENV = (import.meta.env.DEV
? // Get the global configuration (the configuration will be extracted independently when packaging)
(import.meta.env as unknown as ViteEnv)
: window[ENV_NAME as any]) as unknown as ViteEnv
const {
VITE_GLOB_APP_NAME,
VITE_GLOB_APP_DESCRIPTION,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
} = ENV
return {
VITE_GLOB_APP_NAME,
VITE_GLOB_APP_DESCRIPTION,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
VITE_GLOB_UPLOAD_URL,
}
}
/**
* @description: Development mode
*/
export const devMode = 'development'
/**
* @description: Production mode
*/
export const prodMode = 'production'
/**
* @description: Get environment variables
* @returns:
* @example:
*/
export function getEnv(): string {
return import.meta.env.MODE
}
/**
* @description: Is it a development mode
* @returns:
* @example:
*/
export function isDevMode(): boolean {
return import.meta.env.DEV
}
/**
* @description: Is it a production mode
* @returns:
* @example:
*/
export function isProdMode(): boolean {
return import.meta.env.PROD
}
import type { AxiosRequestConfig, AxiosInstance, AxiosResponse, AxiosError, AxiosPromise } from 'axios'
import type { RequestOptions, Result, UploadFileParams } from '/#/axios'
import type { CreateAxiosOptions } from './axiosTransform'
import axios from 'axios'
import qs from 'qs'
import { AxiosCanceler } from './axiosCancel'
import { isFunction } from '/@/utils/is'
import { cloneDeep } from 'lodash-es'
import { ContentTypeEnum } from '/@/enums/httpEnum'
import { RequestEnum } from '/@/enums/httpEnum'
/**
* 覆盖实现,使用 uni.request 实现网络请求
* @param config 请求配置
* @returns 请求结果
*/
axios.defaults.adapter = function (config: CreateAxiosOptions): AxiosPromise<any> {
return new Promise((resolve, reject) => {
uni.request({
method: config.method.toUpperCase() as RequestEnum,
url: config.url,
data: config.data || config.params,
header: config.headers,
responseType: config.responseType,
timeout: config.timeout,
dataType: 'json',
success: (response) => {
resolve({
config,
data: response.data,
headers: response.header,
status: response.statusCode,
statusText: '',
})
},
fail: (response) => {
reject({
config,
response: response.errMsg,
})
},
})
})
}
export * from './axiosTransform'
/**
* @description: axios module
*/
export class VAxios {
private axiosInstance: AxiosInstance
private readonly options: CreateAxiosOptions
constructor(options: CreateAxiosOptions) {
this.options = options
this.axiosInstance = axios.create(options)
this.setupInterceptors()
}
/**
* @description: Create axios instance
*/
private createAxios(config: CreateAxiosOptions): void {
this.axiosInstance = axios.create(config)
}
private getTransform() {
const { transform } = this.options
return transform
}
getAxios(): AxiosInstance {
return this.axiosInstance
}
/**
* @description: Reconfigure axios
*/
configAxios(config: CreateAxiosOptions) {
if (!this.axiosInstance) {
return
}
this.createAxios(config)
}
/**
* @description: Set general header
*/
setHeader(headers: any): void {
if (!this.axiosInstance) {
return
}
Object.assign(this.axiosInstance.defaults.headers, headers)
}
/**
* @description: Interceptor configuration
*/
private setupInterceptors() {
const transform = this.getTransform()
if (!transform) {
return
}
const { requestInterceptors, requestInterceptorsCatch, responseInterceptors, responseInterceptorsCatch } =
transform
const axiosCanceler = new AxiosCanceler()
// Request interceptor configuration processing
this.axiosInstance.interceptors.request.use((config: AxiosRequestConfig) => {
// If cancel repeat request is turned on, then cancel repeat request is prohibited
// @ts-ignore
const { ignoreCancelToken } = config.requestOptions
const ignoreCancel =
ignoreCancelToken !== undefined ? ignoreCancelToken : this.options.requestOptions?.ignoreCancelToken
!ignoreCancel && axiosCanceler.addPending(config)
if (requestInterceptors && isFunction(requestInterceptors)) {
config = requestInterceptors(config, this.options)
}
return config
}, undefined)
// Request interceptor error capture
requestInterceptorsCatch &&
isFunction(requestInterceptorsCatch) &&
this.axiosInstance.interceptors.request.use(undefined, requestInterceptorsCatch)
// Response result interceptor processing
this.axiosInstance.interceptors.response.use((res: AxiosResponse<any>) => {
res && axiosCanceler.removePending(res.config)
if (responseInterceptors && isFunction(responseInterceptors)) {
res = responseInterceptors(res)
}
return res
}, undefined)
// Response result interceptor error capture
responseInterceptorsCatch &&
isFunction(responseInterceptorsCatch) &&
this.axiosInstance.interceptors.response.use(undefined, (error) => {
// @ts-ignore
responseInterceptorsCatch(this.axiosInstance, error)
})
}
/**
* @description: File Upload
*/
uploadFile<T = any>(config: AxiosRequestConfig, params: UploadFileParams) {
const formData = new window.FormData()
const customFilename = params.name || 'file'
if (params.filename) {
formData.append(customFilename, params.file, params.filename)
} else {
formData.append(customFilename, params.file)
}
if (params.data) {
Object.keys(params.data).forEach((key) => {
const value = params.data![key]
if (Array.isArray(value)) {
value.forEach((item) => {
formData.append(`${key}[]`, item)
})
return
}
formData.append(key, params.data![key])
})
}
return this.axiosInstance.request<T>({
...config,
method: 'POST',
data: formData,
headers: {
'Content-type': ContentTypeEnum.FORM_DATA,
// @ts-ignore
ignoreCancelToken: true,
},
})
}
// support form-data
supportFormData(config: AxiosRequestConfig) {
const headers = config.headers || this.options.headers
const contentType = headers?.['Content-Type'] || headers?.['content-type']
if (
contentType !== ContentTypeEnum.FORM_URLENCODED ||
!Reflect.has(config, 'data') ||
config.method?.toUpperCase() === RequestEnum.GET
) {
return config
}
return {
...config,
data: qs.stringify(config.data, { arrayFormat: 'brackets' }),
}
}
get<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
return this.request({ ...config, method: 'GET' }, options)
}
post<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
return this.request({ ...config, method: 'POST' }, options)
}
put<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
return this.request({ ...config, method: 'PUT' }, options)
}
delete<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
return this.request({ ...config, method: 'DELETE' }, options)
}
request<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
let conf: CreateAxiosOptions = cloneDeep(config)
const transform = this.getTransform()
const { requestOptions } = this.options
const opt: RequestOptions = Object.assign({}, requestOptions, options)
const { beforeRequestHook, requestCatchHook, transformRequestHook } = transform || {}
if (beforeRequestHook && isFunction(beforeRequestHook)) {
conf = beforeRequestHook(conf, opt)
}
conf.requestOptions = opt
conf = this.supportFormData(conf)
return new Promise((resolve, reject) => {
this.axiosInstance
.request<any, AxiosResponse<Result>>(conf)
.then((res: AxiosResponse<Result>) => {
if (transformRequestHook && isFunction(transformRequestHook)) {
try {
const ret = transformRequestHook(res, opt)
resolve(ret)
} catch (err) {
reject(err || new Error('request error!'))
}
return
}
resolve(res as unknown as Promise<T>)
})
.catch((e: Error | AxiosError) => {
if (requestCatchHook && isFunction(requestCatchHook)) {
reject(requestCatchHook(e, opt))
return
}
if (axios.isAxiosError(e)) {
// rewrite error message from axios in here
}
reject(e)
})
})
}
}
import type { AxiosRequestConfig, Canceler } from 'axios'
import axios from 'axios'
import { isFunction } from '/@/utils/is'
// Used to store the identification and cancellation function of each request
let pendingMap = new Map<string, Canceler>()
export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&')
export class AxiosCanceler {
/**
* Add request
* @param {Object} config
*/
addPending(config: AxiosRequestConfig) {
this.removePending(config)
const url = getPendingUrl(config)
config.cancelToken =
config.cancelToken ||
new axios.CancelToken((cancel) => {
if (!pendingMap.has(url)) {
// If there is no current request in pending, add it
pendingMap.set(url, cancel)
}
})
}
/**
* @description: Clear all pending
*/
removeAllPending() {
pendingMap.forEach((cancel) => {
cancel && isFunction(cancel) && cancel()
})
pendingMap.clear()
}
/**
* Removal request
* @param {Object} config
*/
removePending(config: AxiosRequestConfig) {
const url = getPendingUrl(config)
if (pendingMap.has(url)) {
// If there is a current request identifier in pending,
// the current request needs to be cancelled and removed
const cancel = pendingMap.get(url)
cancel && cancel(url)
pendingMap.delete(url)
}
}
/**
* @description: reset
*/
reset(): void {
pendingMap = new Map<string, Canceler>()
}
}
import { AxiosError, AxiosInstance } from 'axios'
/**
* 请求重试机制
*/
export class AxiosRetry {
/**
* 重试
*/
retry(AxiosInstance: AxiosInstance, error: AxiosError) {
const { config } = error.response
// @ts-ignore
const { waitTime, count } = config?.requestOptions?.retryRequest
// @ts-ignore
config.__retryCount = config.__retryCount || 0
// @ts-ignore
if (config.__retryCount >= count) {
return Promise.reject(error)
}
// @ts-ignore
config.__retryCount += 1
return this.delay(waitTime).then(() => AxiosInstance(config))
}
/**
* 延迟
*/
private delay(waitTime: number) {
return new Promise((resolve) => setTimeout(resolve, waitTime))
}
}
/**
* Data processing class, can be configured according to the project
*/
import type { AxiosRequestConfig, AxiosResponse } from 'axios'
import type { RequestOptions, Result } from '/#/axios'
export interface CreateAxiosOptions extends AxiosRequestConfig {
authenticationScheme?: string
transform?: AxiosTransform
requestOptions?: RequestOptions
}
export abstract class AxiosTransform {
/**
* @description: Process configuration before request
* @description: Process configuration before request
*/
beforeRequestHook?: (config: AxiosRequestConfig, options: RequestOptions) => AxiosRequestConfig
/**
* @description: Request successfully processed
*/
transformRequestHook?: (res: AxiosResponse<Result>, options: RequestOptions) => any
/**
* @description: 请求失败处理
*/
requestCatchHook?: (e: Error, options: RequestOptions) => Promise<any>
/**
* @description: 请求之前的拦截器
*/
requestInterceptors?: (config: AxiosRequestConfig, options: CreateAxiosOptions) => AxiosRequestConfig
/**
* @description: 请求之后的拦截器
*/
responseInterceptors?: (res: AxiosResponse<any>) => AxiosResponse<any>
/**
* @description: 请求之前的拦截器错误处理
*/
requestInterceptorsCatch?: (error: Error) => void
/**
* @description: 请求之后的拦截器错误处理
*/
responseInterceptorsCatch?: (axiosInstance: AxiosResponse, error: Error) => void
}
import type { ErrorMessageMode } from '/#/axios'
import { useMessage } from '/@/hooks/app/useMessage'
import * as HTTP from '/@/api/types'
const { createMessage, createErrorModal } = useMessage()
export function checkStatus(status: number, _msg: string, errorMessageMode: ErrorMessageMode = 'message'): void {
const errMessage = HTTP.toMessage(status)
if (errMessage) {
if (errorMessageMode === 'modal') {
createErrorModal({ title: '错误提示', content: errMessage })
} else if (errorMessageMode === 'message') {
createMessage.error(errMessage)
}
}
}
import { isObject, isString } from '/@/utils/is'
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
export function joinTimestamp<T extends boolean>(join: boolean, restful: T): T extends true ? string : object
export function joinTimestamp(join: boolean, restful = false): string | object {
if (!join) {
return restful ? '' : {}
}
const now = new Date().getTime()
if (restful) {
return `?_t=${now}`
}
return { _t: now }
}
/**
* @description: Format request parameter time
*/
export function formatRequestDate(params: Recordable) {
if (Object.prototype.toString.call(params) !== '[object Object]') {
return
}
for (const key in params) {
const format = params[key]?.format ?? null
if (format && typeof format === 'function') {
params[key] = params[key].format(DATE_TIME_FORMAT)
}
if (isString(key)) {
const value = params[key]
if (value) {
try {
params[key] = isString(value) ? value.trim() : value
} catch (error: any) {
throw new Error(error)
}
}
}
if (isObject(params[key])) {
formatRequestDate(params[key])
}
}
}
// axios配置 可自行根据项目进行更改,只需更改该文件即可,其他文件可以不动
// The axios configuration can be changed according to the project, just change the file, other files can be left unchanged
import type { AxiosResponse } from 'axios'
import { clone } from 'lodash-es'
import type { RequestOptions, Result } from '/#/axios'
import type { AxiosTransform, CreateAxiosOptions } from './axiosTransform'
import { VAxios } from './Axios'
import { checkStatus } from './checkStatus'
import { useGlobSetting } from '/@/hooks/setting'
import { useMessage } from '/@/hooks/app/useMessage'
import { RequestEnum, ContentTypeEnum } from '/@/enums/httpEnum'
import { isString } from '/@/utils/is'
import { getToken, clearAuthCache } from '/@/utils/auth'
import { setObjToUrlParams, deepMerge } from '/@/utils'
import { joinTimestamp, formatRequestDate } from './helper'
import { AxiosRetry } from '/@/utils/http/axios/axiosRetry'
import * as HTTP from '/@/api/types'
const globSetting = useGlobSetting()
const urlPrefix = globSetting.urlPrefix
const { createMessage, createErrorModal } = useMessage()
/**
* @description: 数据处理,方便区分多种处理方式
*/
const transform: AxiosTransform = {
/**
* @description: 处理请求数据。如果数据不是预期格式,可直接抛出错误
*/
transformRequestHook: (res: AxiosResponse<Result>, options: RequestOptions) => {
const { isTransformResponse, isReturnNativeResponse } = options
// 是否返回原生响应头 比如:需要获取响应头时使用该属性
if (isReturnNativeResponse) {
return res
}
// 不进行任何处理,直接返回
// 用于页面代码可能需要直接获取code,data,message这些信息时开启
if (!isTransformResponse) {
return res.data
}
// 错误的时候返回
const { data } = res
if (!data) {
// return '[HTTP] Request has no return value';
throw new Error('请求出错,请稍候重试')
}
// 这里 status,body,message为 后台统一的字段,需要在 types.ts 内修改为项目自己的接口返回格式
const { status, body, message, details } = data
// 这里逻辑可以根据项目进行修改
const hasSuccess = data && Reflect.has(data, 'status') && status === HTTP.Status.OK
if (hasSuccess) {
return body
}
// 在此处根据自己项目的实际情况对不同的code执行不同的操作
// 如果不希望中断当前请求,请return数据,否则直接抛出异常即可
let timeoutMsg = ''
switch (status) {
case HTTP.Status.UNAUTHORIZED:
timeoutMsg = '登录信息过期,请重新登录!'
clearAuthCache()
// TODO: 跳转到登录页
break
default:
if (details) {
timeoutMsg = details
} else if (message) {
timeoutMsg = message
}
}
// errorMessageMode=‘modal’的时候会显示modal错误弹窗,而不是消息提示,用于一些比较重要的错误
// errorMessageMode='none' 一般是调用时明确表示不希望自动弹出错误提示
if (options.errorMessageMode === 'modal') {
createErrorModal({ title: '错误提示', content: timeoutMsg })
} else if (options.errorMessageMode === 'message') {
createMessage.error(timeoutMsg)
}
throw new Error(timeoutMsg || '请求出错,请稍候重试')
},
// 请求之前处理config
beforeRequestHook: (config, options) => {
const { apiUrl, joinPrefix, joinParamsToUrl, formatDate, joinTime = true, urlPrefix } = options
if (joinPrefix) {
config.url = `${urlPrefix}${config.url}`
}
if (apiUrl && isString(apiUrl)) {
config.url = `${apiUrl}${config.url}`
}
const params = config.params || {}
const data = config.data || false
formatDate && data && !isString(data) && formatRequestDate(data)
if (config.method?.toUpperCase() === RequestEnum.GET) {
if (!isString(params)) {
// 给 get 请求加上时间戳参数,避免从缓存中拿数据。
config.params = Object.assign(params || {}, joinTimestamp(joinTime, false))
} else {
// 兼容restful风格
config.url = config.url + params + `${joinTimestamp(joinTime, true)}`
config.params = undefined
}
} else {
if (!isString(params)) {
formatDate && formatRequestDate(params)
if (Reflect.has(config, 'data') && config.data && Object.keys(config.data).length > 0) {
config.data = data
config.params = params
} else {
// 非GET请求如果没有提供data,则将params视为data
config.data = params
config.params = undefined
}
if (joinParamsToUrl) {
config.url = setObjToUrlParams(config.url as string, Object.assign({}, config.params, config.data))
}
} else {
// 兼容restful风格
config.url = config.url + params
config.params = undefined
}
}
return config
},
/**
* @description: 请求拦截器处理
*/
requestInterceptors: (config, options) => {
// 请求之前处理config
const token = getToken()
if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
// jwt token
;(config as Recordable).headers.Authorization = options.authenticationScheme
? `${options.authenticationScheme} ${token}`
: token
}
return config
},
/**
* @description: 响应拦截器处理
*/
responseInterceptors: (res: AxiosResponse<any>) => {
return res
},
/**
* @description: 响应错误处理
*/
responseInterceptorsCatch: (axiosInstance: AxiosResponse, error: any) => {
const { response, code, message, config } = error || {}
const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'
const msg: string = response?.data?.error?.message ?? ''
const err: string = error?.toString?.() ?? ''
let errMessage = ''
try {
if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) {
errMessage = '接口请求超时,请重试!'
}
if (err?.includes('Network Error')) {
errMessage = '网络异常,请检查您的网络连接是否正常!'
}
if (errMessage) {
if (errorMessageMode === 'modal') {
createErrorModal({ title: '错误提示', content: errMessage })
} else if (errorMessageMode === 'message') {
createMessage.error(errMessage)
}
return Promise.reject(error)
}
} catch (error) {
throw new Error(error as unknown as string)
}
console.warn(config)
checkStatus(error?.response?.status, msg, errorMessageMode)
// 添加自动重试机制 保险起见 只针对GET请求
const retryRequest = new AxiosRetry()
const { isOpenRetry } = config.requestOptions.retryRequest
config.method?.toUpperCase() === RequestEnum.GET &&
isOpenRetry &&
// @ts-ignore
retryRequest.retry(axiosInstance, error)
return Promise.reject(error)
},
}
function createAxios(opt?: Partial<CreateAxiosOptions>) {
return new VAxios(
deepMerge(
{
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes
// authentication schemes,e.g: Bearer
// authenticationScheme: 'Bearer',
authenticationScheme: '',
timeout: 10 * 1000,
// 基础接口地址
// baseURL: globSetting.apiUrl,
// headers: { 'Content-Type': ContentTypeEnum.JSON },
// 如果是form-data格式
headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
// 数据处理方式
transform: clone(transform),
// 配置项,下面的选项都可以在独立的接口请求中覆盖
requestOptions: {
// 默认将prefix 添加到url
joinPrefix: true,
// 是否返回原生响应头 比如:需要获取响应头时使用该属性
isReturnNativeResponse: false,
// 需要对返回数据进行处理
isTransformResponse: true,
// post请求的时候添加参数到url
joinParamsToUrl: false,
// 格式化提交参数时间
formatDate: true,
// 消息提示类型
errorMessageMode: 'message',
// 接口地址
apiUrl: globSetting.apiUrl,
// 接口拼接地址
urlPrefix: urlPrefix,
// 是否加入时间戳
joinTime: true,
// 忽略重复请求
ignoreCancelToken: true,
// 是否携带token
withToken: true,
retryRequest: {
isOpenRetry: true,
count: 5,
waitTime: 100,
},
},
},
opt || {},
),
)
}
// TODO: 实际项目所需的请求配置,可自定义扩展
export const defHttp = createAxios()
// other api url
// export const otherHttp = createAxios({
// requestOptions: {
// apiUrl: 'xxx',
// urlPrefix: 'xxx',
// },
// });
import type { App, Plugin } from 'vue'
import { unref } from 'vue'
import { isObject } from '/@/utils/is'
export const noop = () => {}
/**
* @description: Set ui mount node
*/
export function getPopupContainer(node?: HTMLElement): HTMLElement {
return (node?.parentNode as HTMLElement) ?? document.body
}
/**
* Add the object as a parameter to the URL
* @param baseUrl url
* @param obj
* @returns {string}
* eg:
* let obj = {a: '3', b: '4'}
* setObjToUrlParams('www.baidu.com', obj)
* ==>www.baidu.com?a=3&b=4
*/
export function setObjToUrlParams(baseUrl: string, obj: any): string {
let parameters = ''
for (const key in obj) {
parameters += key + '=' + encodeURIComponent(obj[key]) + '&'
}
parameters = parameters.replace(/&$/, '')
return /\?$/.test(baseUrl) ? baseUrl + parameters : baseUrl.replace(/\/?$/, '?') + parameters
}
export function deepMerge<T = any>(src: any = {}, target: any = {}): T {
let key: string
for (key in target) {
src[key] = isObject(src[key]) ? deepMerge(src[key], target[key]) : (src[key] = target[key])
}
return src
}
// dynamic use hook props
export function getDynamicProps<T, U>(props: T): Partial<U> {
const ret: Recordable = {}
Object.keys(props).map((key) => {
ret[key] = unref((props as Recordable)[key])
})
return ret as Partial<U>
}
export const withInstall = <T>(component: T, alias?: string) => {
const comp = component as any
comp.install = (app: App) => {
app.component(comp.name || comp.displayName, component)
if (alias) {
app.config.globalProperties[alias] = component
}
}
return component as T & Plugin
}
const toString = Object.prototype.toString
export function is(val: unknown, type: string) {
return toString.call(val) === `[object ${type}]`
}
export function isDef<T = unknown>(val?: T): val is T {
return typeof val !== 'undefined'
}
export function isUnDef<T = unknown>(val?: T): val is T {
return !isDef(val)
}
export function isObject(val: any): val is Record<any, any> {
return val !== null && is(val, 'Object')
}
export function isEmpty<T = unknown>(val: T): val is T {
if (isArray(val) || isString(val)) {
return val.length === 0
}
if (val instanceof Map || val instanceof Set) {
return val.size === 0
}
if (isObject(val)) {
return Object.keys(val).length === 0
}
return false
}
export function isDate(val: unknown): val is Date {
return is(val, 'Date')
}
export function isNull(val: unknown): val is null {
return val === null
}
export function isNullAndUnDef(val: unknown): val is null | undefined {
return isUnDef(val) && isNull(val)
}
export function isNullOrUnDef(val: unknown): val is null | undefined {
return isUnDef(val) || isNull(val)
}
export function isNumber(val: unknown): val is number {
return is(val, 'Number')
}
export function isPromise<T = any>(val: unknown): val is Promise<T> {
return is(val, 'Promise') && isObject(val) && isFunction(val.then) && isFunction(val.catch)
}
export function isString(val: unknown): val is string {
return is(val, 'String')
}
export function isFunction(val: unknown): val is Function {
return typeof val === 'function'
}
export function isBoolean(val: unknown): val is boolean {
return is(val, 'Boolean')
}
export function isRegExp(val: unknown): val is RegExp {
return is(val, 'RegExp')
}
export function isArray(val: any): val is Array<any> {
return val && Array.isArray(val)
}
export function isWindow(val: any): val is Window {
return typeof window !== 'undefined' && is(val, 'Window')
}
export function isElement(val: unknown): val is Element {
return isObject(val) && !!val.tagName
}
export function isMap(val: unknown): val is Map<any, any> {
return is(val, 'Map')
}
export const isServer = typeof window === 'undefined'
export const isClient = !isServer
export function isUrl(path: string): boolean {
const reg =
/(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/
return reg.test(path)
}
const projectName = import.meta.env.VITE_GLOB_APP_NAME
export function warn(message: string) {
console.warn(`[${projectName} warn]:${message}`)
}
export function error(message: string) {
throw new Error(`[${projectName} error]:${message}`)
}
{ {
"compilerOptions": { "compilerOptions": {
"target": "esnext", "target": "esnext",
"useDefineForClassFields": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"strict": true, "strict": true,
"noLib": false,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strictFunctionTypes": false,
"jsx": "preserve", "jsx": "preserve",
"baseUrl": ".",
"allowJs": true,
"sourceMap": true, "sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["esnext", "dom"], "resolveJsonModule": true,
"types": ["@dcloudio/types"], "noUnusedLocals": true,
"baseUrl": ".", "noUnusedParameters": true,
"experimentalDecorators": true,
"lib": ["dom", "esnext"],
"noImplicitAny": false,
"skipLibCheck": true,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"types": ["vite/client", "@dcloudio/types"],
"removeComments": true,
"paths": { "paths": {
"/@/*": ["src/*"], "/@/*": ["src/*"],
"/#/*": ["types/*"] "/#/*": ["types/*"]
...@@ -23,7 +35,11 @@ ...@@ -23,7 +35,11 @@
"src/**/*.tsx", "src/**/*.tsx",
"src/**/*.vue", "src/**/*.vue",
"types/**/*.d.ts", "types/**/*.d.ts",
"build/**/*.ts" "types/**/*.ts",
"build/**/*.ts",
"build/**/*.d.ts",
"mock/**/*.ts",
"vite.config.ts"
], ],
"exclude": ["node_modules", "unpackage"] "exclude": ["node_modules", "unpackage", "dist", "**/*.js"]
} }
// Generated by 'unplugin-auto-import' // Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control // We suggest you to commit this file into source control
declare global { declare global {
const $app: typeof import('/@/config/app')['$app'] const $app: typeof import('/@/config/app')['$app']
const API: typeof import('/@/api/types')['API'] const API: typeof import('/@/api/services/mods')['API']
const computed: typeof import('vue')['computed'] const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp'] const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef'] const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent'] const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope'] const defs: typeof import('/@/api/services')['defs']
const EffectScope: typeof import('vue')['EffectScope'] const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const EffectScope: typeof import('vue')['EffectScope']
const getCurrentScope: typeof import('vue')['getCurrentScope'] const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const h: typeof import('vue')['h'] const getCurrentScope: typeof import('vue')['getCurrentScope']
const inject: typeof import('vue')['inject'] const h: typeof import('vue')['h']
const isReadonly: typeof import('vue')['isReadonly'] const inject: typeof import('vue')['inject']
const isRef: typeof import('vue')['isRef'] const isReadonly: typeof import('vue')['isReadonly']
const markRaw: typeof import('vue')['markRaw'] const isRef: typeof import('vue')['isRef']
const nextTick: typeof import('vue')['nextTick'] const markRaw: typeof import('vue')['markRaw']
const onActivated: typeof import('vue')['onActivated'] const nextTick: typeof import('vue')['nextTick']
const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites'] const onActivated: typeof import('vue')['onActivated']
const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress'] const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
const onBeforeMount: typeof import('vue')['onBeforeMount'] const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onDeactivated: typeof import('vue')['onDeactivated'] const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onError: typeof import('@dcloudio/uni-app')['onError'] const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured'] const onError: typeof import('@dcloudio/uni-app')['onError']
const onHide: typeof import('@dcloudio/uni-app')['onHide'] const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch'] const onHide: typeof import('@dcloudio/uni-app')['onHide']
const onLoad: typeof import('@dcloudio/uni-app')['onLoad'] const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch']
const onMounted: typeof import('vue')['onMounted'] const onLoad: typeof import('@dcloudio/uni-app')['onLoad']
const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap'] const onMounted: typeof import('vue')['onMounted']
const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged'] const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']
const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked'] const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']
const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed'] const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']
const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged'] const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']
const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound'] const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']
const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll'] const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound']
const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh'] const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll']
const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom'] const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh']
const onReady: typeof import('@dcloudio/uni-app')['onReady'] const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom']
const onRenderTracked: typeof import('vue')['onRenderTracked'] const onReady: typeof import('@dcloudio/uni-app')['onReady']
const onRenderTriggered: typeof import('vue')['onRenderTriggered'] const onRenderTracked: typeof import('vue')['onRenderTracked']
const onResize: typeof import('@dcloudio/uni-app')['onResize'] const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose'] const onResize: typeof import('@dcloudio/uni-app')['onResize']
const onServerPrefetch: typeof import('vue')['onServerPrefetch'] const onScopeDispose: typeof import('vue')['onScopeDispose']
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage'] const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline'] const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
const onShow: typeof import('@dcloudio/uni-app')['onShow'] const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap'] const onShow: typeof import('@dcloudio/uni-app')['onShow']
const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange'] const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap']
const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection'] const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange']
const onUnload: typeof import('@dcloudio/uni-app')['onUnload'] const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection']
const onUnmounted: typeof import('vue')['onUnmounted'] const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
const onUpdated: typeof import('vue')['onUpdated'] const onUnmounted: typeof import('vue')['onUnmounted']
const provide: typeof import('vue')['provide'] const onUpdated: typeof import('vue')['onUpdated']
const reactive: typeof import('vue')['reactive'] const provide: typeof import('vue')['provide']
const readonly: typeof import('vue')['readonly'] const reactive: typeof import('vue')['reactive']
const ref: typeof import('vue')['ref'] const readonly: typeof import('vue')['readonly']
const resolveComponent: typeof import('vue')['resolveComponent'] const ref: typeof import('vue')['ref']
const shallowReactive: typeof import('vue')['shallowReactive'] const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReadonly: typeof import('vue')['shallowReadonly'] const shallowReactive: typeof import('vue')['shallowReactive']
const shallowRef: typeof import('vue')['shallowRef'] const shallowReadonly: typeof import('vue')['shallowReadonly']
const toRaw: typeof import('vue')['toRaw'] const shallowRef: typeof import('vue')['shallowRef']
const toRef: typeof import('vue')['toRef'] const toRaw: typeof import('vue')['toRaw']
const toRefs: typeof import('vue')['toRefs'] const toRef: typeof import('vue')['toRef']
const triggerRef: typeof import('vue')['triggerRef'] const toRefs: typeof import('vue')['toRefs']
const unref: typeof import('vue')['unref'] const triggerRef: typeof import('vue')['triggerRef']
const useAttrs: typeof import('vue')['useAttrs'] const unref: typeof import('vue')['unref']
const useCssModule: typeof import('vue')['useCssModule'] const useAttrs: typeof import('vue')['useAttrs']
const useCssVars: typeof import('vue')['useCssVars'] const useCssModule: typeof import('vue')['useCssModule']
const useSlots: typeof import('vue')['useSlots'] const useCssVars: typeof import('vue')['useCssVars']
const watch: typeof import('vue')['watch'] const useSlots: typeof import('vue')['useSlots']
const watchEffect: typeof import('vue')['watchEffect'] const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
} }
export {} export {}
export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined
export type RequestOptions = http.RequestOptions
export interface RetryRequest {
isOpenRetry: boolean
count: number
waitTime: number
}
export type Result<T = any> = defs.Result<T>
// multipart/form-data: upload file
export interface UploadFileParams {
// Other parameters
data?: Recordable
// File parameter interface field name
name?: string
// file name
file: File | Blob
// file name
filename?: string
[key: string]: any
}
export interface GlobConfig {
// APP 名称
name: string
// APP 描述
description: string
// API 接口地址
apiUrl: string
// API 接口地址前缀
urlPrefix?: string
// 文件上传地址
uploadUrl?: string
}
declare type Recordable<T = any> = Record<string, T> import type { AxiosRequestConfig } from 'axios'
interface ImportMetaEnv extends ViteEnv { declare global {
__: unknown type Recordable<T = any> = Record<string, T>
}
interface ImportMetaEnv extends ViteEnv {
__: unknown
}
interface ViteEnv {
// APP 名称
VITE_GLOB_APP_NAME: string
// APP 描述
VITE_GLOB_APP_DESCRIPTION?: string
// API 接口地址
VITE_GLOB_API_URL: string
// API 接口地址前缀
VITE_GLOB_API_URL_PREFIX?: string
// 公共文件上传 API URL
VITE_GLOB_UPLOAD_URL?: string
}
declare interface ViteEnv { // 扩展类型,用于在 pont 生成的 api.d.ts 内部使用
// APP 名称 namespace http {
VITE_GLOB_APP_NAME: string declare interface RequestOptions {
// APP 描述 // Splicing request parameters to url
VITE_GLOB_APP_DESCRIPTION?: string joinParamsToUrl?: boolean
// API 接口地址 // Format request parameter time
VITE_GLOB_API_URL: string formatDate?: boolean
// API 接口地址前缀 // Whether to process the request result
VITE_GLOB_API_URL_PREFIX?: string isTransformResponse?: boolean
// 公共文件上传 API URL // Whether to return native response headers
VITE_GLOB_UPLOAD_URL?: string // For example: use this attribute when you need to get the response headers
isReturnNativeResponse?: boolean
// Whether to join url
joinPrefix?: boolean
// Interface address, use the default apiUrl if you leave it blank
apiUrl?: string
// 请求拼接路径
urlPrefix?: string
// Error message prompt type
errorMessageMode?: ErrorMessageMode
// Whether to add a timestamp
joinTime?: boolean
ignoreCancelToken?: boolean
// Whether to send token in header
withToken?: boolean
// 请求重试机制
retryRequest?: RetryRequest
}
type RequestConfig<T = any> = AxiosRequestConfig<T>
}
} }
export {}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论