File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * @Description :
3
+ * @Author : godric
4
+ * @Date : 2020-03-29 21:49:11
5
+ * @LastEditTime : 2020-03-30 22:55:12
6
+ * @LastEditors : godric
7
+ */
8
+ export interface MenuListItem {
9
+ id : number ;
10
+ name : string ;
11
+ parentId : number ;
12
+ url : string ;
13
+ type : number ;
14
+ icon : string ;
15
+ visible : boolean ;
16
+ orderNum : number ;
17
+ createBy : string ;
18
+ createDate : Date ;
19
+ updateBy : string ;
20
+ updateDate : Date ;
21
+ }
22
+
23
+ export interface TreeNode {
24
+ id : number ;
25
+ parentId : number ;
26
+ label : string ;
27
+ value : string ;
28
+ level : number ;
29
+ other : string ;
30
+ createBy : string ;
31
+ createDate : Date ;
32
+ updateBy : string ;
33
+ updateDate : Date ;
34
+ }
35
+
36
+ export interface R < T > {
37
+ success : boolean ;
38
+ ns : string ;
39
+ code : number ;
40
+ msg : string ;
41
+ result : T ;
42
+ }
Original file line number Diff line number Diff line change
1
+ import request from '@/utils/request' ;
2
+ import { TreeNode , R , MenuListItem } from './data' ;
3
+
4
+ /*
5
+ * @Description :
6
+ * @Author : godric
7
+ * @Date : 2020-03-29 21:49:17
8
+ * @LastEditTime : 2020-03-30 23:11:48
9
+ * @LastEditors : godric
10
+ */
11
+ const URL_PREFIX = '/api/tiangong/menu' ;
12
+
13
+ export async function queryAll ( ) {
14
+ const data = await request < R < TreeNode > > ( `${ URL_PREFIX } /all` ) ;
15
+ return {
16
+ data : data . result ,
17
+ } ;
18
+ }
19
+
20
+ export async function add ( params : MenuListItem ) {
21
+ return request ( `${ URL_PREFIX } /add` , {
22
+ data : params ,
23
+ method : 'POST' ,
24
+ } ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments