提交 8a719686 作者: 方治民

feat: 更新依赖、pont 接口生成适配 json 传参方式、细节优化

上级 f6d06082
...@@ -21,7 +21,7 @@ export function configAutoImportPlugin(): Plugin { ...@@ -21,7 +21,7 @@ export function configAutoImportPlugin(): Plugin {
'@/config/app': ['$app'], '@/config/app': ['$app'],
'@/api/services': ['defs'], '@/api/services': ['defs'],
'@/api/services/mods': ['API'], '@/api/services/mods': ['API'],
'@/common/message': ['Message'], '@/common': ['Message'],
}, },
], ],
}) })
...@@ -33,6 +33,7 @@ export function configAutoImportPlugin(): Plugin { ...@@ -33,6 +33,7 @@ export function configAutoImportPlugin(): Plugin {
*/ */
export function configComponentsImportPlugin(): Plugin { export function configComponentsImportPlugin(): Plugin {
return Components({ return Components({
dts: 'types/components.d.ts',
resolvers: [ resolvers: [
(name: string) => { (name: string) => {
// FIX: 修复 easycom 在 APP 下不生效问题(原因不明 // FIX: 修复 easycom 在 APP 下不生效问题(原因不明
...@@ -46,6 +47,6 @@ export function configComponentsImportPlugin(): Plugin { ...@@ -46,6 +47,6 @@ export function configComponentsImportPlugin(): Plugin {
export function configImportPlugin(): Plugin[] { export function configImportPlugin(): Plugin[] {
// FIX: easycom 适配问题 // FIX: easycom 适配问题
// return [configAutoImportPlugin(), configComponentsImportPlugin()] return [configAutoImportPlugin(), configComponentsImportPlugin()]
return [configAutoImportPlugin()] // return [configAutoImportPlugin()]
} }
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
export {}
declare module '@vue/runtime-core' {
export interface GlobalComponents {
FDragItem: typeof import('./src/components/firstui/fui-drag/f-drag-item.vue')['default']
FIndexListItem: typeof import('./src/components/firstui/fui-index-list/f-index-list-item.vue')['default']
FuiActionsheet: typeof import('./src/components/firstui/fui-actionsheet/fui-actionsheet.vue')['default']
FuiAlert: typeof import('./src/components/firstui/fui-alert/fui-alert.vue')['default']
FuiAnimation: typeof import('./src/components/firstui/fui-animation/fui-animation.vue')['default']
FuiAutograph: typeof import('./src/components/firstui/fui-autograph/fui-autograph.vue')['default']
FuiAvatar: typeof import('./src/components/firstui/fui-avatar/fui-avatar.vue')['default']
FuiBackdrop: typeof import('./src/components/firstui/fui-backdrop/fui-backdrop.vue')['default']
FuiBacktop: typeof import('./src/components/firstui/fui-backtop/fui-backtop.vue')['default']
FuiBadge: typeof import('./src/components/firstui/fui-badge/fui-badge.vue')['default']
FuiBarcode: typeof import('./src/components/firstui/fui-barcode/fui-barcode.vue')['default']
FuiBottomNavbar: typeof import('./src/components/firstui/fui-bottom-navbar/fui-bottom-navbar.vue')['default']
FuiBottomPopup: typeof import('./src/components/firstui/fui-bottom-popup/fui-bottom-popup.vue')['default']
FuiBubbleBox: typeof import('./src/components/firstui/fui-bubble-box/fui-bubble-box.vue')['default']
FuiButton: typeof import('./src/components/firstui/fui-button/fui-button.vue')['default']
FuiCalendar: typeof import('./src/components/firstui/fui-calendar/fui-calendar.vue')['default']
FuiCard: typeof import('./src/components/firstui/fui-card/fui-card.vue')['default']
FuiCascader: typeof import('./src/components/firstui/fui-cascader/fui-cascader.vue')['default']
FuiCheckbox: typeof import('./src/components/firstui/fui-checkbox/fui-checkbox.vue')['default']
FuiCheckboxGroup: typeof import('./src/components/firstui/fui-checkbox-group/fui-checkbox-group.vue')['default']
FuiCircle: typeof import('./src/components/firstui/fui-circle/fui-circle.vue')['default']
FuiCol: typeof import('./src/components/firstui/fui-col/fui-col.vue')['default']
FuiCollapse: typeof import('./src/components/firstui/fui-collapse/fui-collapse.vue')['default']
FuiCollapseItem: typeof import('./src/components/firstui/fui-collapse-item/fui-collapse-item.vue')['default']
FuiCopyText: typeof import('./src/components/firstui/fui-copy-text/fui-copy-text.vue')['default']
FuiCountDown: typeof import('./src/components/firstui/fui-count-down/fui-count-down.vue')['default']
FuiCountdownVerify: typeof import('./src/components/firstui/fui-countdown-verify/fui-countdown-verify.vue')['default']
FuiCubicBezier: typeof import('./src/components/firstui/fui-cubic-bezier/fui-cubic-bezier.vue')['default']
FuiDataTag: typeof import('./src/components/firstui/fui-data-tag/fui-data-tag.vue')['default']
FuiDatePicker: typeof import('./src/components/firstui/fui-date-picker/fui-date-picker.vue')['default']
FuiDialog: typeof import('./src/components/firstui/fui-dialog/fui-dialog.vue')['default']
FuiDigitalKeyboard: typeof import('./src/components/firstui/fui-digital-keyboard/fui-digital-keyboard.vue')['default']
FuiDigitalRoller: typeof import('./src/components/firstui/fui-digital-roller/fui-digital-roller.vue')['default']
FuiDivider: typeof import('./src/components/firstui/fui-divider/fui-divider.vue')['default']
FuiDrag: typeof import('./src/components/firstui/fui-drag/fui-drag.vue')['default']
FuiDrawer: typeof import('./src/components/firstui/fui-drawer/fui-drawer.vue')['default']
FuiDropdownList: typeof import('./src/components/firstui/fui-dropdown-list/fui-dropdown-list.vue')['default']
FuiDropdownMenu: typeof import('./src/components/firstui/fui-dropdown-menu/fui-dropdown-menu.vue')['default']
FuiEmpty: typeof import('./src/components/firstui/fui-empty/fui-empty.vue')['default']
FuiFab: typeof import('./src/components/firstui/fui-fab/fui-fab.vue')['default']
FuiFilterBar: typeof import('./src/components/firstui/fui-filter-bar/fui-filter-bar.vue')['default']
FuiFooter: typeof import('./src/components/firstui/fui-footer/fui-footer.vue')['default']
FuiForm: typeof import('./src/components/firstui/fui-form/fui-form.vue')['default']
FuiFormField: typeof import('./src/components/firstui/fui-form-field/fui-form-field.vue')['default']
FuiGallery: typeof import('./src/components/firstui/fui-gallery/fui-gallery.vue')['default']
FuiGrid: typeof import('./src/components/firstui/fui-grid/fui-grid.vue')['default']
FuiGridItem: typeof import('./src/components/firstui/fui-grid-item/fui-grid-item.vue')['default']
FuiIcon: typeof import('./src/components/firstui/fui-icon/fui-icon.vue')['default']
FuiImageCropper: typeof import('./src/components/firstui/fui-image-cropper/fui-image-cropper.vue')['default']
FuiIndexList: typeof import('./src/components/firstui/fui-index-list/fui-index-list.vue')['default']
FuiInput: typeof import('./src/components/firstui/fui-input/fui-input.vue')['default']
FuiInputNumber: typeof import('./src/components/firstui/fui-input-number/fui-input-number.vue')['default']
FuiLabel: typeof import('./src/components/firstui/fui-label/fui-label.vue')['default']
FuiLandscape: typeof import('./src/components/firstui/fui-landscape/fui-landscape.vue')['default']
FuiLazyload: typeof import('./src/components/firstui/fui-lazyload/fui-lazyload.vue')['default']
FuiLicensePlate: typeof import('./src/components/firstui/fui-license-plate/fui-license-plate.vue')['default']
FuiList: typeof import('./src/components/firstui/fui-list/fui-list.vue')['default']
FuiListCell: typeof import('./src/components/firstui/fui-list-cell/fui-list-cell.vue')['default']
FuiLoadAni: typeof import('./src/components/firstui/fui-load-ani/fui-load-ani.vue')['default']
FuiLoading: typeof import('./src/components/firstui/fui-loading/fui-loading.vue')['default']
FuiLoadmore: typeof import('./src/components/firstui/fui-loadmore/fui-loadmore.vue')['default']
FuiMessage: typeof import('./src/components/firstui/fui-message/fui-message.vue')['default']
FuiModal: typeof import('./src/components/firstui/fui-modal/fui-modal.vue')['default']
FuiNavBar: typeof import('./src/components/firstui/fui-nav-bar/fui-nav-bar.vue')['default']
FuiNoticeBar: typeof import('./src/components/firstui/fui-notice-bar/fui-notice-bar.vue')['default']
FuiOverflowHidden: typeof import('./src/components/firstui/fui-overflow-hidden/fui-overflow-hidden.vue')['default']
FuiPagination: typeof import('./src/components/firstui/fui-pagination/fui-pagination.vue')['default']
FuiPanel: typeof import('./src/components/firstui/fui-panel/fui-panel.vue')['default']
FuiPicker: typeof import('./src/components/firstui/fui-picker/fui-picker.vue')['default']
FuiPoster: typeof import('./src/components/firstui/fui-poster/fui-poster.vue')['default']
FuiPosterWeex: typeof import('./src/components/firstui/fui-poster-weex/fui-poster-weex.vue')['default']
FuiPreview: typeof import('./src/components/firstui/fui-preview/fui-preview.vue')['default']
FuiProgress: typeof import('./src/components/firstui/fui-progress/fui-progress.vue')['default']
FuiPuzzleVerify: typeof import('./src/components/firstui/fui-puzzle-verify/fui-puzzle-verify.vue')['default']
FuiQrcode: typeof import('./src/components/firstui/fui-qrcode/fui-qrcode.vue')['default']
FuiRadio: typeof import('./src/components/firstui/fui-radio/fui-radio.vue')['default']
FuiRadioGroup: typeof import('./src/components/firstui/fui-radio-group/fui-radio-group.vue')['default']
FuiRate: typeof import('./src/components/firstui/fui-rate/fui-rate.vue')['default']
FuiResult: typeof import('./src/components/firstui/fui-result/fui-result.vue')['default']
FuiRotateVerify: typeof import('./src/components/firstui/fui-rotate-verify/fui-rotate-verify.vue')['default']
FuiRow: typeof import('./src/components/firstui/fui-row/fui-row.vue')['default']
FuiSafeArea: typeof import('./src/components/firstui/fui-safe-area/fui-safe-area.vue')['default']
FuiSearchBar: typeof import('./src/components/firstui/fui-search-bar/fui-search-bar.vue')['default']
FuiSegmentedControl: typeof import('./src/components/firstui/fui-segmented-control/fui-segmented-control.vue')['default']
FuiSelect: typeof import('./src/components/firstui/fui-select/fui-select.vue')['default']
FuiShareSheet: typeof import('./src/components/firstui/fui-share-sheet/fui-share-sheet.vue')['default']
FuiSingleInput: typeof import('./src/components/firstui/fui-single-input/fui-single-input.vue')['default']
FuiSkeleton: typeof import('./src/components/firstui/fui-skeleton/fui-skeleton.vue')['default']
FuiSlider: typeof import('./src/components/firstui/fui-slider/fui-slider.vue')['default']
FuiSliderCaptcha: typeof import('./src/components/firstui/fui-slider-captcha/fui-slider-captcha.vue')['default']
FuiSlideVerify: typeof import('./src/components/firstui/fui-slide-verify/fui-slide-verify.vue')['default']
FuiSpin: typeof import('./src/components/firstui/fui-spin/fui-spin.vue')['default']
FuiStatusBar: typeof import('./src/components/firstui/fui-status-bar/fui-status-bar.vue')['default']
FuiSteps: typeof import('./src/components/firstui/fui-steps/fui-steps.vue')['default']
FuiSticky: typeof import('./src/components/firstui/fui-sticky/fui-sticky.vue')['default']
FuiSwipeAction: typeof import('./src/components/firstui/fui-swipe-action/fui-swipe-action.vue')['default']
FuiSwipeactionGroup: typeof import('./src/components/firstui/fui-swipeaction-group/fui-swipeaction-group.vue')['default']
FuiSwiperDot: typeof import('./src/components/firstui/fui-swiper-dot/fui-swiper-dot.vue')['default']
FuiSwitch: typeof import('./src/components/firstui/fui-switch/fui-switch.vue')['default']
FuiTabbar: typeof import('./src/components/firstui/fui-tabbar/fui-tabbar.vue')['default']
FuiTable: typeof import('./src/components/firstui/fui-table/fui-table.vue')['default']
FuiTabs: typeof import('./src/components/firstui/fui-tabs/fui-tabs.vue')['default']
FuiTag: typeof import('./src/components/firstui/fui-tag/fui-tag.vue')['default']
FuiText: typeof import('./src/components/firstui/fui-text/fui-text.vue')['default']
FuiTextarea: typeof import('./src/components/firstui/fui-textarea/fui-textarea.vue')['default']
FuiTimeaxis: typeof import('./src/components/firstui/fui-timeaxis/fui-timeaxis.vue')['default']
FuiTimeaxisNode: typeof import('./src/components/firstui/fui-timeaxis-node/fui-timeaxis-node.vue')['default']
FuiTimer: typeof import('./src/components/firstui/fui-timer/fui-timer.vue')['default']
FuiToast: typeof import('./src/components/firstui/fui-toast/fui-toast.vue')['default']
FuiTopPopup: typeof import('./src/components/firstui/fui-top-popup/fui-top-popup.vue')['default']
FuiUpload: typeof import('./src/components/firstui/fui-upload/fui-upload.vue')['default']
FuiVtabs: typeof import('./src/components/firstui/fui-vtabs/fui-vtabs.vue')['default']
FuiVtabsContent: typeof import('./src/components/firstui/fui-vtabs-content/fui-vtabs-content.vue')['default']
FuiWaterfall: typeof import('./src/components/firstui/fui-waterfall/fui-waterfall.vue')['default']
FuiWaterfallItem: typeof import('./src/components/firstui/fui-waterfall-item/fui-waterfall-item.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
...@@ -63,19 +63,19 @@ ...@@ -63,19 +63,19 @@
} }
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-app": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-app-plus": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-app-plus": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-components": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-components": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-h5": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-h5": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-lark": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-lark": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-qq": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-qq": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3060720221017002",
"@vue/runtime-core": "^3.2.40", "@vue/runtime-core": "^3.2.41",
"@vueuse/core": "^8.9.4", "@vueuse/core": "^8.9.4",
"axios": "^0.26.1", "axios": "^0.26.1",
"dayjs": "^1.11.5", "dayjs": "^1.11.5",
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"pinia": "^2.0.23", "pinia": "^2.0.23",
"qs": "~6.9.7", "qs": "~6.9.7",
"vue": "^3.2.40", "vue": "^3.2.41",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.2.2",
"vue-types": "^4.2.1" "vue-types": "^4.2.1"
}, },
...@@ -91,19 +91,20 @@ ...@@ -91,19 +91,20 @@
"@commitlint/cli": "^17.1.2", "@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^16.2.4", "@commitlint/config-conventional": "^16.2.4",
"@dcloudio/types": "^3.0.15", "@dcloudio/types": "^3.0.15",
"@dcloudio/uni-automator": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-automator": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-cli-shared": "^3.0.0-alpha-3060420220922008", "@dcloudio/uni-cli-shared": "^3.0.0-alpha-3060720221017002",
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3060420220922008", "@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3060720221017001",
"@types/lodash-es": "^4.17.6", "@types/lodash-es": "^4.17.6",
"@types/mockjs": "^1.0.7", "@types/mockjs": "^1.0.7",
"@types/prettier": "^2.7.1", "@types/prettier": "^2.7.1",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.40.0", "@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.0", "@typescript-eslint/parser": "^5.40.1",
"commitizen": "^4.2.5", "commitizen": "^4.2.5",
"conventional-changelog-cli": "^2.2.2", "conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.0.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.25.0", "eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
...@@ -115,13 +116,13 @@ ...@@ -115,13 +116,13 @@
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"pont-engine": "^1.4.0", "pont-engine": "^1.4.0",
"postcss": "^8.4.17", "postcss": "^8.4.18",
"postcss-html": "^1.5.0", "postcss-html": "^1.5.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"sort-package-json": "^1.57.0", "sort-package-json": "^1.57.0",
"stylelint": "^14.13.0", "stylelint": "^14.14.0",
"stylelint-config-html": "^1.1.0", "stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.3", "stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^8.0.0", "stylelint-config-recommended": "^8.0.0",
...@@ -132,7 +133,7 @@ ...@@ -132,7 +133,7 @@
"typescript": "^4.8.4", "typescript": "^4.8.4",
"unplugin-auto-import": "^0.11.2", "unplugin-auto-import": "^0.11.2",
"unplugin-vue-components": "^0.22.8", "unplugin-vue-components": "^0.22.8",
"vite": "^3.1.7", "vite": "^3.1.8",
"vue-eslint-parser": "^9.1.0" "vue-eslint-parser": "^9.1.0"
}, },
"engines": { "engines": {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"originType": "SwaggerV2", "originType": "SwaggerV2",
"originUrl": "http://127.0.0.1:8081/api/v2/api-docs", "originUrl": "http://127.0.0.1:8081/api/v2/api-docs",
"templateType": "fetch", "templateType": "fetch",
"templatePath": "./pont.template", "templatePath": "./pont-template",
"transformPath": "./pont.transform", "transformPath": "./pont-transform",
"outDir": "./src/api/services", "outDir": "./src/api/services",
"surrounding": "typeScript", "surrounding": "typeScript",
"mocks": { "mocks": {
......
...@@ -12,19 +12,44 @@ export class FileStructures extends Pont.FileStructures { ...@@ -12,19 +12,44 @@ export class FileStructures extends Pont.FileStructures {
} }
export default class BasicGenerator extends CodeGenerator { export default class BasicGenerator extends CodeGenerator {
checkJsonParam(inter: Interface, paramsCode: string): boolean {
const prettier = require('prettier')
const requestParams = inter.getRequestParams(this.surrounding)
const code = prettier.format(paramsCode, { parser: 'typescript' })
return code.includes('{}') && requestParams.includes('body')
}
// 认为没有返回值的接口表示下载(通常是)
isDownload(inter: Interface): boolean {
return inter.responseType === 'any'
}
// 认为包含 form 参数的接口表示带有上传功能
isUpload(inter: Interface): boolean {
return inter.getRequestParams(this.surrounding).includes('form')
}
getParams(inter: Interface, paramsCode: string) { getParams(inter: Interface, paramsCode: string) {
let requestParams = inter.getRequestParams(this.surrounding) let requestParams = inter.getRequestParams(this.surrounding)
let bodyTypeDef = ''
const prettier = require('prettier') const prettier = require('prettier')
if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) { if (prettier.format(paramsCode, { parser: 'typescript' }).includes('{}')) {
if (!requestParams.includes('form')) { if (!requestParams.includes('form')) {
requestParams = requestParams.replace('params', 'params?') requestParams = requestParams.replace('params', 'params?')
} }
if (requestParams.includes('body')) {
requestParams = requestParams.replace('params?: Params, ', '')
bodyTypeDef = requestParams.replace(/^.*body: (.*),.*$/gi, '$1')
}
} }
return `${requestParams.replace( return `${requestParams.replace(
'options?: any', 'options?: any',
`config?: http.RequestConfig<Params${requestParams.includes('form') ? ' | FormData' : ''}>`, `config?: http.RequestConfig<${
bodyTypeDef ? bodyTypeDef : `Params${requestParams.includes('form') ? ' | FormData' : ''}`
}>`,
)}, options?: http.RequestOptions` )}, options?: http.RequestOptions`
} }
...@@ -64,7 +89,12 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -64,7 +89,12 @@ export default class BasicGenerator extends CodeGenerator {
const paramsCode = inter.getParamsCode('Params', this.surrounding) const paramsCode = inter.getParamsCode('Params', this.surrounding)
const requestParams = this.getParams(inter, paramsCode) const requestParams = this.getParams(inter, paramsCode)
const undef = inter.response.getInitialValue() === 'undefined' const undef = inter.response.getInitialValue() === 'undefined'
const isBody = this.checkJsonParam(inter, paramsCode)
// TODO
// 扩展 hooks mode
// 采用 vue-request 或 @tanstack/vue-query
// export function useRequest()
return ` return `
/** /**
* @desc ${inter.description} * @desc ${inter.description}
...@@ -73,7 +103,7 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -73,7 +103,7 @@ export default class BasicGenerator extends CodeGenerator {
${undef ? '' : `import * as defs from '../../baseClass';`} ${undef ? '' : `import * as defs from '../../baseClass';`}
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export ${paramsCode} ${isBody ? '' : `export ${paramsCode}`}
${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`} ${undef ? '' : `export const init = ${inter.response.getInitialValue(true)};`}
...@@ -84,11 +114,13 @@ export default class BasicGenerator extends CodeGenerator { ...@@ -84,11 +114,13 @@ export default class BasicGenerator extends CodeGenerator {
${ ${
method === 'GET' method === 'GET'
? 'params' ? 'params'
: `data: ${requestParams.includes('form') ? 'form || params' : 'params'}` : `data: ${requestParams.includes('form') ? 'form || params' : isBody ? 'body' : 'params'}`
}, },
${ ${
requestParams.includes('form') requestParams.includes('form')
? `headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },` ? `headers: { 'Content-Type': 'multipart/form-data;charset=UTF-8' },`
: isBody
? `headers: { 'Content-Type': 'application/json' },`
: '' : ''
} }
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
"description": "身份认证", "description": "身份认证",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "登录", "description": "登录",
"name": "login", "name": "login",
"method": "post", "method": "post",
...@@ -89,7 +91,9 @@ ...@@ -89,7 +91,9 @@
"parameters": [] "parameters": []
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "注册", "description": "注册",
"name": "register", "name": "register",
"method": "post", "method": "post",
...@@ -235,6 +239,32 @@ ...@@ -235,6 +239,32 @@
} }
} }
] ]
},
{
"description": "检查登录状态",
"name": "valid",
"method": "get",
"path": "/api/auth/valid",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "boolean",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
} }
], ],
"name": "auth" "name": "auth"
...@@ -243,7 +273,7 @@ ...@@ -243,7 +273,7 @@
"description": "示例", "description": "示例",
"interfaces": [ "interfaces": [
{ {
"description": "hello", "description": "Hello World",
"name": "hello", "name": "hello",
"method": "get", "method": "get",
"path": "/api/example/", "path": "/api/example/",
...@@ -269,7 +299,7 @@ ...@@ -269,7 +299,7 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "download", "description": "文件下载",
"name": "download", "name": "download",
"method": "get", "method": "get",
"path": "/api/example/download", "path": "/api/example/download",
...@@ -285,7 +315,7 @@ ...@@ -285,7 +315,7 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "fail", "description": "测试失败",
"name": "fail", "name": "fail",
"method": "get", "method": "get",
"path": "/api/example/fail", "path": "/api/example/fail",
...@@ -311,7 +341,88 @@ ...@@ -311,7 +341,88 @@
"parameters": [] "parameters": []
}, },
{ {
"description": "page", "description": "查询用户属性",
"name": "findUserExtensionInfo",
"method": "get",
"path": "/api/example/findUserExtensionInfo",
"response": {
"typeArgs": [
{
"typeArgs": [],
"typeName": "UserExtensionVo",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
],
"typeName": "Result",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": []
},
{
"consumes": [
"application/json"
],
"description": "JSON 传参",
"name": "json",
"method": "post",
"path": "/api/example/json",
"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": "body",
"description": "param",
"name": "param",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "PageParam",
"isDefsType": true,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
},
{
"description": "分页条件查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/example/page", "path": "/api/example/page",
...@@ -401,20 +512,42 @@ ...@@ -401,20 +512,42 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
] ]
}
],
"name": "example"
}, },
{ {
"description": "测试 MyBatis Plus 查询", "description": "文件管理",
"name": "test", "interfaces": [
{
"description": "文件下载",
"name": "download",
"method": "get", "method": "get",
"path": "/api/example/test", "path": "/api/common/file/download",
"response": { "response": {
"typeArgs": [ "typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"parameters": [
{ {
"in": "query",
"description": "bucket",
"name": "bucket",
"required": true,
"dataType": {
"typeArgs": [], "typeArgs": [],
"typeName": "string", "typeName": "string",
"isDefsType": false, "isDefsType": false,
...@@ -423,24 +556,28 @@ ...@@ -423,24 +556,28 @@
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
} }
], },
"typeName": "Result", {
"isDefsType": true, "in": "query",
"description": "object",
"name": "object",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
},
"parameters": []
} }
], }
"name": "example" ]
}, },
{ {
"description": "文件管理", "consumes": [
"interfaces": [ "multipart/form-data"
{ ],
"consumes": ["multipart/form-data"],
"description": "文件上传", "description": "文件上传",
"name": "upload", "name": "upload",
"method": "post", "method": "post",
...@@ -481,6 +618,51 @@ ...@@ -481,6 +618,51 @@
} }
} }
] ]
},
{
"consumes": [
"application/json"
],
"description": "Base64 图片上传",
"name": "uploadBase64Image",
"method": "post",
"path": "/api/common/file/uploadBase64Image",
"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": "Base64 图片信息",
"name": "base64Image",
"required": true,
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
}
}
]
} }
], ],
"name": "file" "name": "file"
...@@ -489,11 +671,13 @@ ...@@ -489,11 +671,13 @@
"description": "权限管理", "description": "权限管理",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "新增", "description": "新增",
"name": "add", "name": "add",
"method": "post", "method": "post",
"path": "/api/manage/permission/add", "path": "/api/sys/permission/add",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -675,7 +859,11 @@ ...@@ -675,7 +859,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
} }
}, },
...@@ -697,11 +885,13 @@ ...@@ -697,11 +885,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "删除", "description": "删除",
"name": "deleted", "name": "deleted",
"method": "post", "method": "post",
"path": "/api/manage/permission/deleted", "path": "/api/sys/permission/deleted",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -743,7 +933,7 @@ ...@@ -743,7 +933,7 @@
"description": "查询", "description": "查询",
"name": "find", "name": "find",
"method": "get", "method": "get",
"path": "/api/manage/permission/find", "path": "/api/sys/permission/find",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -782,11 +972,13 @@ ...@@ -782,11 +972,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "修改", "description": "修改",
"name": "modify", "name": "modify",
"method": "post", "method": "post",
"path": "/api/manage/permission/modify", "path": "/api/sys/permission/modify",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -983,7 +1175,11 @@ ...@@ -983,7 +1175,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
} }
}, },
...@@ -1008,7 +1204,7 @@ ...@@ -1008,7 +1204,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/manage/permission/page", "path": "/api/sys/permission/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1095,18 +1291,20 @@ ...@@ -1095,18 +1291,20 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
] ]
}, },
{ {
"consumes": ["application/x-www-form-urlencoded"],
"description": "树结构查询", "description": "树结构查询",
"name": "tree", "name": "tree",
"method": "get", "method": "get",
"path": "/api/manage/permission/tree", "path": "/api/sys/permission/tree",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1141,7 +1339,7 @@ ...@@ -1141,7 +1339,7 @@
"in": "query", "in": "query",
"description": "pid", "description": "pid",
"name": "pid", "name": "pid",
"required": true, "required": false,
"dataType": { "dataType": {
"typeArgs": [], "typeArgs": [],
"typeName": "string", "typeName": "string",
...@@ -1161,11 +1359,13 @@ ...@@ -1161,11 +1359,13 @@
"description": "角色管理", "description": "角色管理",
"interfaces": [ "interfaces": [
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "新增", "description": "新增",
"name": "add", "name": "add",
"method": "post", "method": "post",
"path": "/api/manage/role/add", "path": "/api/sys/role/add",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1219,11 +1419,13 @@ ...@@ -1219,11 +1419,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "分配权限", "description": "分配权限",
"name": "assign", "name": "assign",
"method": "post", "method": "post",
"path": "/api/manage/role/assign", "path": "/api/sys/role/assign",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1277,11 +1479,13 @@ ...@@ -1277,11 +1479,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "删除", "description": "删除",
"name": "deleted", "name": "deleted",
"method": "post", "method": "post",
"path": "/api/manage/role/deleted", "path": "/api/sys/role/deleted",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1304,8 +1508,8 @@ ...@@ -1304,8 +1508,8 @@
"parameters": [ "parameters": [
{ {
"in": "query", "in": "query",
"description": "id", "description": "ids 多个以逗号分割",
"name": "id", "name": "ids",
"required": true, "required": true,
"dataType": { "dataType": {
"typeArgs": [], "typeArgs": [],
...@@ -1323,7 +1527,7 @@ ...@@ -1323,7 +1527,7 @@
"description": "查询", "description": "查询",
"name": "find", "name": "find",
"method": "get", "method": "get",
"path": "/api/manage/role/find", "path": "/api/sys/role/find",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1362,11 +1566,13 @@ ...@@ -1362,11 +1566,13 @@
] ]
}, },
{ {
"consumes": ["application/json"], "consumes": [
"application/json"
],
"description": "修改", "description": "修改",
"name": "modify", "name": "modify",
"method": "post", "method": "post",
"path": "/api/manage/role/modify", "path": "/api/sys/role/modify",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1438,7 +1644,7 @@ ...@@ -1438,7 +1644,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/manage/role/page", "path": "/api/sys/role/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1525,7 +1731,10 @@ ...@@ -1525,7 +1731,10 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
...@@ -1535,7 +1744,7 @@ ...@@ -1535,7 +1744,7 @@
"description": "选项查询", "description": "选项查询",
"name": "selector", "name": "selector",
"method": "get", "method": "get",
"path": "/api/manage/role/selector", "path": "/api/sys/role/selector",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1574,109 +1783,13 @@ ...@@ -1574,109 +1783,13 @@
"description": "用户管理", "description": "用户管理",
"interfaces": [ "interfaces": [
{ {
"description": "获取用户菜单", "consumes": [
"name": "getMenuList", "application/json"
"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": "分配角色", "description": "分配角色",
"name": "assign", "name": "assign",
"method": "post", "method": "post",
"path": "/api/user/manage/assign", "path": "/api/sys/user/assign",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1733,7 +1846,7 @@ ...@@ -1733,7 +1846,7 @@
"description": "分页查询", "description": "分页查询",
"name": "page", "name": "page",
"method": "get", "method": "get",
"path": "/api/user/manage/page", "path": "/api/sys/user/page",
"response": { "response": {
"typeArgs": [ "typeArgs": [
{ {
...@@ -1820,7 +1933,10 @@ ...@@ -1820,7 +1933,10 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'ASC'", "'DESC'"], "enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": [] "typeProperties": []
} }
} }
...@@ -1828,6 +1944,110 @@ ...@@ -1828,6 +1944,110 @@
} }
], ],
"name": "user" "name": "user"
},
{
"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": []
}
],
"name": "userView"
} }
], ],
"baseClasses": [ "baseClasses": [
...@@ -1985,6 +2205,72 @@ ...@@ -1985,6 +2205,72 @@
"templateArgs": [] "templateArgs": []
}, },
{ {
"description": "公共的分页排序查询参数",
"name": "PageParam",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pageNo",
"description": "当前页数",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "pageSize",
"description": "分页条数",
"required": true
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "sortField",
"description": "排序字段",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [
"'ASC'",
"'DESC'"
],
"typeProperties": []
},
"name": "sortOrder",
"description": "排序方向(ASC|DESC)",
"required": false
}
],
"templateArgs": []
},
{
"description": "公共分页查询响应输出", "description": "公共分页查询响应输出",
"name": "PageVo", "name": "PageVo",
"properties": [ "properties": [
...@@ -2246,7 +2532,11 @@ ...@@ -2246,7 +2532,11 @@
"isDefsType": false, "isDefsType": false,
"templateIndex": -1, "templateIndex": -1,
"compileTemplateKeyword": "#/definitions/", "compileTemplateKeyword": "#/definitions/",
"enum": ["'DIR'", "'MENU'", "'BUTTON'"], "enum": [
"'DIR'",
"'MENU'",
"'BUTTON'"
],
"typeProperties": [] "typeProperties": []
}, },
"name": "type", "name": "type",
...@@ -2471,6 +2761,40 @@ ...@@ -2471,6 +2761,40 @@
"templateArgs": [] "templateArgs": []
}, },
{ {
"name": "UserExtensionVo",
"properties": [
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "age",
"description": "年龄",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "number",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "gender",
"description": "性别",
"required": false
}
],
"templateArgs": []
},
{
"name": "UserInfo", "name": "UserInfo",
"properties": [ "properties": [
{ {
...@@ -2525,6 +2849,20 @@ ...@@ -2525,6 +2849,20 @@
"enum": [], "enum": [],
"typeProperties": [] "typeProperties": []
}, },
"name": "mobile",
"description": "手机号",
"required": false
},
{
"dataType": {
"typeArgs": [],
"typeName": "string",
"isDefsType": false,
"templateIndex": -1,
"compileTemplateKeyword": "#/definitions/",
"enum": [],
"typeProperties": []
},
"name": "realName", "name": "realName",
"description": "真实姓名", "description": "真实姓名",
"required": false "required": false
......
...@@ -31,6 +31,20 @@ declare namespace defs { ...@@ -31,6 +31,20 @@ declare namespace defs {
redirect?: string redirect?: string
} }
export class PageParam {
/** 当前页数 */
pageNo?: number
/** 分页条数 */
pageSize?: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export class PageVo<T0 = any> { export class PageVo<T0 = any> {
/** 数据 */ /** 数据 */
data?: Array<T0> data?: Array<T0>
...@@ -123,6 +137,14 @@ declare namespace defs { ...@@ -123,6 +137,14 @@ declare namespace defs {
uid?: string uid?: string
} }
export class UserExtensionVo {
/** 年龄 */
age?: number
/** 性别 */
gender?: number
}
export class UserInfo { export class UserInfo {
/** 头像 */ /** 头像 */
avatar?: string avatar?: string
...@@ -133,6 +155,9 @@ declare namespace defs { ...@@ -133,6 +155,9 @@ declare namespace defs {
/** 用户主页 */ /** 用户主页 */
homePath?: string homePath?: string
/** 手机号 */
mobile?: string
/** 真实姓名 */ /** 真实姓名 */
realName?: string realName?: string
...@@ -265,6 +290,24 @@ namespace API { ...@@ -265,6 +290,24 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/**
* 检查登录状态
* /api/auth/valid
*/
export namespace valid {
export class Params {}
export type Response = boolean
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
} }
/** /**
...@@ -272,7 +315,7 @@ namespace API { ...@@ -272,7 +315,7 @@ namespace API {
*/ */
export namespace example { export namespace example {
/** /**
* hello * Hello World
* /api/example/ * /api/example/
*/ */
export namespace hello { export namespace hello {
...@@ -290,7 +333,7 @@ namespace API { ...@@ -290,7 +333,7 @@ namespace API {
} }
/** /**
* download * 文件下载
* /api/example/download * /api/example/download
*/ */
export namespace download { export namespace download {
...@@ -308,7 +351,7 @@ namespace API { ...@@ -308,7 +351,7 @@ namespace API {
} }
/** /**
* fail * 测试失败
* /api/example/fail * /api/example/fail
*/ */
export namespace fail { export namespace fail {
...@@ -326,7 +369,43 @@ namespace API { ...@@ -326,7 +369,43 @@ namespace API {
} }
/** /**
* page * 查询用户属性
* /api/example/findUserExtensionInfo
*/
export namespace findUserExtensionInfo {
export class Params {}
export type Response = defs.UserExtensionVo
export const init: Response
export function request(
params?: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* JSON 传参
* /api/example/json
*/
export namespace json {
export class Params {}
export type Response = defs.PageVo<string>
export const init: Response
export function request(
body: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
): Promise<Response>
}
/**
* 分页条件查询
* /api/example/page * /api/example/page
*/ */
export namespace page { export namespace page {
...@@ -351,31 +430,36 @@ namespace API { ...@@ -351,31 +430,36 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 测试 MyBatis Plus 查询 * 文件管理
* /api/example/test
*/ */
export namespace test { export namespace file {
export class Params {} /**
* 文件下载
* /api/common/file/download
*/
export namespace download {
export class Params {
/** bucket */
bucket: string
/** object */
object: string
}
export type Response = string export type Response = any
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 文件管理
*/
export namespace file {
/**
* 文件上传 * 文件上传
* /api/common/file/upload * /api/common/file/upload
*/ */
...@@ -393,6 +477,27 @@ namespace API { ...@@ -393,6 +477,27 @@ namespace API {
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/**
* Base64 图片上传
* /api/common/file/uploadBase64Image
*/
export namespace uploadBase64Image {
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export type Response = string
export const init: Response
export function request(
params: Params,
config?: http.RequestConfig<Params>,
options?: http.RequestOptions,
): Promise<Response>
}
} }
/** /**
...@@ -401,7 +506,7 @@ namespace API { ...@@ -401,7 +506,7 @@ namespace API {
export namespace permission { export namespace permission {
/** /**
* 新增 * 新增
* /api/manage/permission/add * /api/sys/permission/add
*/ */
export namespace add { export namespace add {
export class Params { export class Params {
...@@ -444,7 +549,7 @@ namespace API { ...@@ -444,7 +549,7 @@ namespace API {
/** /**
* 删除 * 删除
* /api/manage/permission/deleted * /api/sys/permission/deleted
*/ */
export namespace deleted { export namespace deleted {
export class Params { export class Params {
...@@ -465,7 +570,7 @@ namespace API { ...@@ -465,7 +570,7 @@ namespace API {
/** /**
* 查询 * 查询
* /api/manage/permission/find * /api/sys/permission/find
*/ */
export namespace find { export namespace find {
export class Params { export class Params {
...@@ -486,7 +591,7 @@ namespace API { ...@@ -486,7 +591,7 @@ namespace API {
/** /**
* 修改 * 修改
* /api/manage/permission/modify * /api/sys/permission/modify
*/ */
export namespace modify { export namespace modify {
export class Params { export class Params {
...@@ -531,7 +636,7 @@ namespace API { ...@@ -531,7 +636,7 @@ namespace API {
/** /**
* 分页查询 * 分页查询
* /api/manage/permission/page * /api/sys/permission/page
*/ */
export namespace page { export namespace page {
export class Params { export class Params {
...@@ -558,12 +663,12 @@ namespace API { ...@@ -558,12 +663,12 @@ namespace API {
/** /**
* 树结构查询 * 树结构查询
* /api/manage/permission/tree * /api/sys/permission/tree
*/ */
export namespace tree { export namespace tree {
export class Params { export class Params {
/** pid */ /** pid */
pid: string pid?: string
} }
export type Response = Array<defs.PermissionVo> export type Response = Array<defs.PermissionVo>
...@@ -584,7 +689,7 @@ namespace API { ...@@ -584,7 +689,7 @@ namespace API {
export namespace role { export namespace role {
/** /**
* 新增 * 新增
* /api/manage/role/add * /api/sys/role/add
*/ */
export namespace add { export namespace add {
export class Params { export class Params {
...@@ -607,7 +712,7 @@ namespace API { ...@@ -607,7 +712,7 @@ namespace API {
/** /**
* 分配权限 * 分配权限
* /api/manage/role/assign * /api/sys/role/assign
*/ */
export namespace assign { export namespace assign {
export class Params { export class Params {
...@@ -630,12 +735,12 @@ namespace API { ...@@ -630,12 +735,12 @@ namespace API {
/** /**
* 删除 * 删除
* /api/manage/role/deleted * /api/sys/role/deleted
*/ */
export namespace deleted { export namespace deleted {
export class Params { export class Params {
/** id */ /** ids 多个以逗号分割 */
id: string ids: string
} }
export type Response = string export type Response = string
...@@ -651,7 +756,7 @@ namespace API { ...@@ -651,7 +756,7 @@ namespace API {
/** /**
* 查询 * 查询
* /api/manage/role/find * /api/sys/role/find
*/ */
export namespace find { export namespace find {
export class Params { export class Params {
...@@ -672,7 +777,7 @@ namespace API { ...@@ -672,7 +777,7 @@ namespace API {
/** /**
* 修改 * 修改
* /api/manage/role/modify * /api/sys/role/modify
*/ */
export namespace modify { export namespace modify {
export class Params { export class Params {
...@@ -697,7 +802,7 @@ namespace API { ...@@ -697,7 +802,7 @@ namespace API {
/** /**
* 分页查询 * 分页查询
* /api/manage/role/page * /api/sys/role/page
*/ */
export namespace page { export namespace page {
export class Params { export class Params {
...@@ -724,7 +829,7 @@ namespace API { ...@@ -724,7 +829,7 @@ namespace API {
/** /**
* 选项查询 * 选项查询
* /api/manage/role/selector * /api/sys/role/selector
*/ */
export namespace selector { export namespace selector {
export class Params {} export class Params {}
...@@ -746,49 +851,68 @@ namespace API { ...@@ -746,49 +851,68 @@ namespace API {
*/ */
export namespace user { export namespace user {
/** /**
* 获取用户菜单 * 分配角色
* /api/user/getMenuList * /api/sys/user/assign
*/ */
export namespace getMenuList { export namespace assign {
export class Params {} export class Params {
/** id */
id: string
/** ids 多个以逗号分割 */
ids: string
}
export type Response = Array<defs.MenuVo> export type Response = string
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/** /**
* 获取用户权限 * 分页查询
* /api/user/getPermCode * /api/sys/user/page
*/ */
export namespace getPermCode { export namespace page {
export class Params {} export class Params {
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = Array<string> export type Response = defs.PageVo<defs.UserVo>
export const init: Response export const init: Response
export function request( export function request(
params?: Params, params: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
}
/** /**
* 获取登录用户信息 * 用户信息
* /api/user/getUserInfo
*/ */
export namespace getUserInfo { export namespace userView {
/**
* 获取用户菜单
* /api/user/getMenuList
*/
export namespace getMenuList {
export class Params {} export class Params {}
export type Response = defs.UserInfo export type Response = Array<defs.MenuVo>
export const init: Response export const init: Response
...@@ -800,50 +924,36 @@ namespace API { ...@@ -800,50 +924,36 @@ namespace API {
} }
/** /**
* 分配角色 * 获取用户权限
* /api/user/manage/assign * /api/user/getPermCode
*/ */
export namespace assign { export namespace getPermCode {
export class Params { export class Params {}
/** id */
id: string
/** ids 多个以逗号分割 */
ids: string
}
export type Response = string export type Response = Array<string>
export const init: Response export const init: Response
export function request( export function request(
params: Params, params?: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
} }
/** /**
* 分页查询 * 获取登录用户信息
* /api/user/manage/page * /api/user/getUserInfo
*/ */
export namespace page { export namespace getUserInfo {
export class Params { export class Params {}
/** 当前页数 */
pageNo: number
/** 分页条数 */
pageSize: number
/** 排序字段 */
sortField?: string
/** 排序方向(ASC|DESC) */
sortOrder?: 'ASC' | 'DESC'
}
export type Response = defs.PageVo<defs.UserVo> export type Response = defs.UserInfo
export const init: Response export const init: Response
export function request( export function request(
params: Params, params?: Params,
config?: http.RequestConfig<Params>, config?: http.RequestConfig<Params>,
options?: http.RequestOptions, options?: http.RequestOptions,
): Promise<Response> ): Promise<Response>
......
...@@ -26,6 +26,20 @@ export class MenuVo { ...@@ -26,6 +26,20 @@ export class MenuVo {
redirect = '' redirect = ''
} }
export class PageParam {
/** 当前页数 */
pageNo = undefined
/** 分页条数 */
pageSize = undefined
/** 排序字段 */
sortField = ''
/** 排序方向(ASC|DESC) */
sortOrder = 'ASC'
}
export class PageVo { export class PageVo {
/** 数据 */ /** 数据 */
data = [] data = []
...@@ -118,6 +132,14 @@ export class RoleVo { ...@@ -118,6 +132,14 @@ export class RoleVo {
uid = '' uid = ''
} }
export class UserExtensionVo {
/** 年龄 */
age = undefined
/** 性别 */
gender = undefined
}
export class UserInfo { export class UserInfo {
/** 头像 */ /** 头像 */
avatar = '' avatar = ''
...@@ -128,6 +150,9 @@ export class UserInfo { ...@@ -128,6 +150,9 @@ export class UserInfo {
/** 用户主页 */ /** 用户主页 */
homePath = '' homePath = ''
/** 手机号 */
mobile = ''
/** 真实姓名 */ /** 真实姓名 */
realName = '' realName = ''
......
...@@ -4,5 +4,6 @@ ...@@ -4,5 +4,6 @@
import * as login from './login' import * as login from './login'
import * as logout from './logout' import * as logout from './logout'
import * as register from './register' import * as register from './register'
import * as valid from './valid'
export { login, logout, register } export { login, logout, register, valid }
/** /**
* @desc 测试 MyBatis Plus 查询 * @desc 检查登录状态
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
...@@ -12,7 +12,7 @@ export const init = new defs.Result() ...@@ -12,7 +12,7 @@ export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/example/test', url: '/auth/valid',
method: 'GET', method: 'GET',
params, params,
......
/** /**
* @desc download * @desc 文件下载
*/ */
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
......
/** /**
* @desc fail * @desc 测试失败
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
/**
* @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: '/example/findUserExtensionInfo',
method: 'GET',
params,
...config,
},
options,
)
}
/** /**
* @desc hello * @desc Hello World
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
import * as hello from './hello' import * as hello from './hello'
import * as download from './download' import * as download from './download'
import * as fail from './fail' import * as fail from './fail'
import * as findUserExtensionInfo from './findUserExtensionInfo'
import * as json from './json'
import * as page from './page' import * as page from './page'
import * as test from './test'
export { hello, download, fail, page, test } export { hello, download, fail, findUserExtensionInfo, json, page }
/**
* @desc JSON 传参
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export const init = new defs.Result()
export function request(
body: defs.PageParam,
config?: http.RequestConfig<defs.PageParam>,
options?: http.RequestOptions,
) {
return defHttp.request(
{
url: '/example/json',
method: 'POST',
data: body,
headers: { 'Content-Type': 'application/json' },
...config,
},
options,
)
}
/** /**
* @desc page * @desc 分页条件查询
*/ */
import * as defs from '../../baseClass' import * as defs from '../../baseClass'
......
/**
* @desc 文件下载
*/
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** bucket */
bucket: string
/** object */
object: string
}
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/download',
method: 'GET',
params,
...config,
},
options,
)
}
/** /**
* @description 文件管理 * @description 文件管理
*/ */
import * as download from './download'
import * as upload from './upload' import * as upload from './upload'
import * as uploadBase64Image from './uploadBase64Image'
export { upload } export { download, upload, uploadBase64Image }
/**
* @desc Base64 图片上传
*/
import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios'
export class Params {
/** Base64 图片信息 */
base64Image: string
}
export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request(
{
url: '/common/file/uploadBase64Image',
method: 'POST',
data: params,
...config,
},
options,
)
}
...@@ -4,6 +4,7 @@ import * as file from './file' ...@@ -4,6 +4,7 @@ import * as file from './file'
import * as permission from './permission' import * as permission from './permission'
import * as role from './role' import * as role from './role'
import * as user from './user' import * as user from './user'
import * as userView from './userView'
export const API = { export const API = {
auth, auth,
...@@ -12,4 +13,5 @@ export const API = { ...@@ -12,4 +13,5 @@ export const API = {
permission, permission,
role, role,
user, user,
userView,
} }
...@@ -37,7 +37,7 @@ export const init = new defs.Result() ...@@ -37,7 +37,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/add', url: '/sys/permission/add',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/deleted', url: '/sys/permission/deleted',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/find', url: '/sys/permission/find',
method: 'GET', method: 'GET',
params, params,
......
...@@ -39,7 +39,7 @@ export const init = new defs.Result() ...@@ -39,7 +39,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/modify', url: '/sys/permission/modify',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/page', url: '/sys/permission/page',
method: 'GET', method: 'GET',
params, params,
......
...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios' ...@@ -7,7 +7,7 @@ import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** pid */ /** pid */
pid: string pid?: string
} }
export const init = new defs.Result() export const init = new defs.Result()
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/permission/tree', url: '/sys/permission/tree',
method: 'GET', method: 'GET',
params, params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/add', url: '/sys/role/add',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/assign', url: '/sys/role/assign',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -6,8 +6,8 @@ import * as defs from '../../baseClass' ...@@ -6,8 +6,8 @@ import * as defs from '../../baseClass'
import { defHttp } from '/@/utils/http/axios' import { defHttp } from '/@/utils/http/axios'
export class Params { export class Params {
/** id */ /** ids 多个以逗号分割 */
id: string ids: string
} }
export const init = new defs.Result() export const init = new defs.Result()
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/deleted', url: '/sys/role/deleted',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -15,7 +15,7 @@ export const init = new defs.Result() ...@@ -15,7 +15,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/find', url: '/sys/role/find',
method: 'GET', method: 'GET',
params, params,
......
...@@ -19,7 +19,7 @@ export const init = new defs.Result() ...@@ -19,7 +19,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/modify', url: '/sys/role/modify',
method: 'POST', method: 'POST',
data: params, data: params,
......
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/page', url: '/sys/role/page',
method: 'GET', method: 'GET',
params, params,
......
...@@ -12,7 +12,7 @@ export const init = new defs.Result() ...@@ -12,7 +12,7 @@ export const init = new defs.Result()
export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params?: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/manage/role/selector', url: '/sys/role/selector',
method: 'GET', method: 'GET',
params, params,
......
...@@ -17,7 +17,7 @@ export const init = new defs.Result() ...@@ -17,7 +17,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/user/manage/assign', url: '/sys/user/assign',
method: 'POST', method: 'POST',
data: params, data: params,
......
/** /**
* @description 用户管理 * @description 用户管理
*/ */
import * as getMenuList from './getMenuList'
import * as getPermCode from './getPermCode'
import * as getUserInfo from './getUserInfo'
import * as assign from './assign' import * as assign from './assign'
import * as page from './page' import * as page from './page'
export { getMenuList, getPermCode, getUserInfo, assign, page } export { assign, page }
...@@ -21,7 +21,7 @@ export const init = new defs.Result() ...@@ -21,7 +21,7 @@ export const init = new defs.Result()
export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) { export function request(params: Params, config?: http.RequestConfig<Params>, options?: http.RequestOptions) {
return defHttp.request( return defHttp.request(
{ {
url: '/user/manage/page', url: '/sys/user/page',
method: 'GET', method: 'GET',
params, params,
......
/**
* @description 用户信息
*/
import * as getMenuList from './getMenuList'
import * as getPermCode from './getPermCode'
import * as getUserInfo from './getUserInfo'
export { getMenuList, getPermCode, getUserInfo }
import { Message } from './message'
// export some global utils function
export { Message }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论