Skip to content

Commit e580fc7

Browse files
committed
update
1 parent 27795ad commit e580fc7

File tree

57 files changed

+556
-613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+556
-613
lines changed

src/api/base/menu/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
* @LastEditTime: 2021-04-21 23:00:11
88
*/
99
import service from '@/utils/request'
10-
import { IResponse, IStatusParams } from '@/api/index.type'
11-
import { IMenu, IMenuParams, IMenuSelect } from './index.type'
10+
import { Axios } from '@/types/axios'
11+
import { Menu } from '@/types/menu'
1212

1313
/**
1414
* @description: 获取权限菜单
1515
* @param {*}
1616
* @return {*}
1717
* @author: gumingchen
1818
*/
19-
export function getList(params: { parent_id: number }): Promise<IResponse<IMenu[]>> {
19+
export function getList(params: { parent_id: number }): Promise<Axios.Response<Menu.Vo[]>> {
2020
return service({
2121
url: '/base/menu/list',
2222
method: 'get',
@@ -30,7 +30,7 @@ export function getList(params: { parent_id: number }): Promise<IResponse<IMenu[
3030
* @return {*}
3131
* @author: gumingchen
3232
*/
33-
export function info(params: number): Promise<IResponse<IMenuParams>> {
33+
export function info(params: number): Promise<Axios.Response<Menu.Dto>> {
3434
return service({
3535
url: `/base/menu/info/${ params }`,
3636
method: 'get'
@@ -43,7 +43,7 @@ export function info(params: number): Promise<IResponse<IMenuParams>> {
4343
* @return {*}
4444
* @author: gumingchen
4545
*/
46-
export function add(params: IMenuParams): Promise<IResponse<null>> {
46+
export function add(params: Menu.Base): Promise<Axios.Response<null>> {
4747
return service({
4848
url: '/base/menu/create',
4949
method: 'post',
@@ -57,7 +57,7 @@ export function add(params: IMenuParams): Promise<IResponse<null>> {
5757
* @return {*}
5858
* @author: gumingchen
5959
*/
60-
export function edit(params: IMenuParams): Promise<IResponse<null>> {
60+
export function edit(params: Menu.Base): Promise<Axios.Response<null>> {
6161
return service({
6262
url: '/base/menu/update',
6363
method: 'post',
@@ -71,7 +71,7 @@ export function edit(params: IMenuParams): Promise<IResponse<null>> {
7171
* @return {*}
7272
* @author: gumingchen
7373
*/
74-
export function del(params: { id: number }): Promise<IResponse<null>> {
74+
export function del(params: { id: number }): Promise<Axios.Response<null>> {
7575
return service({
7676
url: '/base/menu/delete',
7777
method: 'post',
@@ -85,7 +85,7 @@ export function del(params: { id: number }): Promise<IResponse<null>> {
8585
* @return {*}
8686
* @author: gumingchen
8787
*/
88-
export function setDisplay(params: IStatusParams): Promise<IResponse<null>> {
88+
export function setDisplay(params: Axios.StatusParams): Promise<Axios.Response<null>> {
8989
return service({
9090
url: '/base/menu/display',
9191
method: 'post',
@@ -99,7 +99,7 @@ export function setDisplay(params: IStatusParams): Promise<IResponse<null>> {
9999
* @return {*}
100100
* @author: gumingchen
101101
*/
102-
export function setAlive(params: IStatusParams): Promise<IResponse<null>> {
102+
export function setAlive(params: Axios.StatusParams): Promise<Axios.Response<null>> {
103103
return service({
104104
url: '/base/menu/alive',
105105
method: 'post',
@@ -113,7 +113,7 @@ export function setAlive(params: IStatusParams): Promise<IResponse<null>> {
113113
* @return {*}
114114
* @author: gumingchen
115115
*/
116-
export function setTab(params: IStatusParams): Promise<IResponse<null>> {
116+
export function setTab(params: Axios.StatusParams): Promise<Axios.Response<null>> {
117117
return service({
118118
url: '/base/menu/tab',
119119
method: 'post',
@@ -127,7 +127,7 @@ export function setTab(params: IStatusParams): Promise<IResponse<null>> {
127127
* @return {*}
128128
* @author: gumingchen
129129
*/
130-
export function setMultiple(params: IStatusParams): Promise<IResponse<null>> {
130+
export function setMultiple(params: Axios.StatusParams): Promise<Axios.Response<null>> {
131131
return service({
132132
url: '/base/menu/multiple',
133133
method: 'post',
@@ -141,20 +141,20 @@ export function setMultiple(params: IStatusParams): Promise<IResponse<null>> {
141141
* @return {*}
142142
* @author: gumingchen
143143
*/
144-
export function select(): Promise<IResponse<IMenuSelect[]>> {
144+
export function select(): Promise<Axios.Response<Menu.Simple[]>> {
145145
return service({
146146
url: '/base/menu/select',
147147
method: 'get'
148148
})
149149
}
150150

151151
/**
152-
* @description: 下拉列表
152+
* @description: 当前用户下拉列表
153153
* @param {*}
154154
* @return {*}
155155
* @author: gumingchen
156156
*/
157-
export function selfSelect(): Promise<IResponse<IMenuSelect[]>> {
157+
export function selfSelect(): Promise<Axios.Response<Menu.Simple[]>> {
158158
return service({
159159
url: '/base/menu/self/select',
160160
method: 'get'

src/api/base/menu/index.type.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/api/base/role/index.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@
77
* @LastEditTime: 2021-04-21 22:59:24
88
*/
99
import service from '@/utils/request'
10-
import { IPageData, IResponse } from '@/api/index.type'
11-
import { IRole, IRolePageParams } from './index.type'
10+
import { Axios } from '@/types/axios'
11+
import { Role } from '@/types/role'
12+
13+
interface pageParams extends Axios.PageParams {
14+
name: string
15+
}
1216

1317
/**
1418
* @description: 获取角色
1519
* @param {*}
1620
* @return {*}
1721
* @author: gumingchen
1822
*/
19-
export function getPage(params: IRolePageParams): Promise<IResponse<IPageData<IRole>>> {
23+
export function getPage(params: pageParams): Promise<Axios.Response<Axios.PageData<Role.Base>>> {
2024
return service({
2125
url: '/base/role/page',
2226
method: 'get',
@@ -30,7 +34,7 @@ export function getPage(params: IRolePageParams): Promise<IResponse<IPageData<IR
3034
* @return {*}
3135
* @author: gumingchen
3236
*/
33-
export function info(params: number): Promise<IResponse<IRole>> {
37+
export function info(params: number): Promise<Axios.Response<Role.Dto>> {
3438
return service({
3539
url: `/base/role/info/${ params }`,
3640
method: 'get'
@@ -43,7 +47,7 @@ export function info(params: number): Promise<IResponse<IRole>> {
4347
* @return {*}
4448
* @author: gumingchen
4549
*/
46-
export function add(params: IRole): Promise<IResponse<null>> {
50+
export function add(params: Role.Dto): Promise<Axios.Response<null>> {
4751
return service({
4852
url: '/base/role/create',
4953
method: 'post',
@@ -57,7 +61,7 @@ export function add(params: IRole): Promise<IResponse<null>> {
5761
* @return {*}
5862
* @author: gumingchen
5963
*/
60-
export function edit(params: IRole): Promise<IResponse<null>> {
64+
export function edit(params: Role.Dto): Promise<Axios.Response<null>> {
6165
return service({
6266
url: '/base/role/update',
6367
method: 'post',
@@ -71,7 +75,7 @@ export function edit(params: IRole): Promise<IResponse<null>> {
7175
* @return {*}
7276
* @author: gumingchen
7377
*/
74-
export function del(params: number[]): Promise<IResponse<null>> {
78+
export function del(params: number[]): Promise<Axios.Response<null>> {
7579
return service({
7680
url: '/base/role/delete',
7781
method: 'post',
@@ -85,7 +89,7 @@ export function del(params: number[]): Promise<IResponse<null>> {
8589
* @return {*}
8690
* @author: gumingchen
8791
*/
88-
export function select(): Promise<IResponse<IRole[]>> {
92+
export function select(): Promise<Axios.Response<Role.Simple[]>> {
8993
return service({
9094
url: '/base/role/select',
9195
method: 'get'

src/api/base/role/index.type.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/api/base/user/index.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@
77
* @LastEditTime: 2021-04-21 22:59:24
88
*/
99
import service from '@/utils/request'
10-
import { IPageData, IResponse, IStatusParams } from '@/api/index.type'
11-
import { IUser, IUserPageParams } from './index.type'
10+
import { Axios } from '@/types/axios'
11+
import { User } from '@/types/user'
12+
13+
interface pageParams extends Axios.PageParams {
14+
username: string
15+
nickname: string
16+
}
1217

1318
/**
1419
* @description: 获取用户
1520
* @param {*}
1621
* @return {*}
1722
* @author: gumingchen
1823
*/
19-
export function getPage(params: IUserPageParams): Promise<IResponse<IPageData<IUser>>> {
24+
export function getPage(params: pageParams): Promise<Axios.Response<Axios.PageData<User.Vo>>> {
2025
return service({
2126
url: '/base/user/page',
2227
method: 'get',
@@ -30,7 +35,7 @@ export function getPage(params: IUserPageParams): Promise<IResponse<IPageData<IU
3035
* @return {*}
3136
* @author: gumingchen
3237
*/
33-
export function info(params: number): Promise<IResponse<IUser>> {
38+
export function info(params: number): Promise<Axios.Response<User.Vo>> {
3439
return service({
3540
url: `/base/user/info/${ params }`,
3641
method: 'get'
@@ -43,7 +48,7 @@ export function info(params: number): Promise<IResponse<IUser>> {
4348
* @return {*}
4449
* @author: gumingchen
4550
*/
46-
export function add(params: IUser): Promise<IResponse<null>> {
51+
export function add(params: User.Dto): Promise<Axios.Response<null>> {
4752
return service({
4853
url: '/base/user/create',
4954
method: 'post',
@@ -57,7 +62,7 @@ export function add(params: IUser): Promise<IResponse<null>> {
5762
* @return {*}
5863
* @author: gumingchen
5964
*/
60-
export function edit(params: IUser): Promise<IResponse<null>> {
65+
export function edit(params: User.Dto): Promise<Axios.Response<null>> {
6166
return service({
6267
url: '/base/user/update',
6368
method: 'post',
@@ -71,7 +76,7 @@ export function edit(params: IUser): Promise<IResponse<null>> {
7176
* @return {*}
7277
* @author: gumingchen
7378
*/
74-
export function del(params: number[]): Promise<IResponse<null>> {
79+
export function del(params: number[]): Promise<Axios.Response<null>> {
7580
return service({
7681
url: '/base/user/delete',
7782
method: 'post',
@@ -85,7 +90,7 @@ export function del(params: number[]): Promise<IResponse<null>> {
8590
* @return {*}
8691
* @author: gumingchen
8792
*/
88-
export function setStatus(params: IStatusParams): Promise<IResponse<null>> {
93+
export function setStatus(params: Axios.StatusParams): Promise<Axios.Response<null>> {
8994
return service({
9095
url: '/base/user/status',
9196
method: 'post',

src/api/base/user/index.type.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/api/index.type.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)