Showing
7 changed files
with
39 additions
and
8 deletions
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | @closeTest="onCloseTest" |
10 | 10 | ref="testParamsRequestRef" |
11 | 11 | :data="dataMap.mapParamsObj" |
12 | + :interfaceType="interfaceType" | |
12 | 13 | /> |
13 | 14 | </TabPane> |
14 | 15 | <TabPane |
... | ... | @@ -24,6 +25,7 @@ |
24 | 25 | @testBodyInterface="handleTestBodyInterface" |
25 | 26 | @closeTest="onCloseTest" |
26 | 27 | ref="testBodyRequestRef" |
28 | + :interfaceType="interfaceType" | |
27 | 29 | :data="dataMap.mapBodyObj" |
28 | 30 | /> |
29 | 31 | </TabPane> |
... | ... | @@ -33,6 +35,7 @@ |
33 | 35 | @testHeaderInterface="handleTestHeaderInterface" |
34 | 36 | @closeTest="onCloseTest" |
35 | 37 | ref="testHeaderRequestRef" |
38 | + :interfaceType="interfaceType" | |
36 | 39 | :data="dataMap.mapHeaderObj" |
37 | 40 | /> |
38 | 41 | </TabPane> |
... | ... | @@ -64,6 +67,9 @@ |
64 | 67 | originUrlType: { |
65 | 68 | type: String, |
66 | 69 | }, |
70 | + interfaceType: { | |
71 | + type: String, | |
72 | + }, | |
67 | 73 | }); |
68 | 74 | |
69 | 75 | const emits = defineEmits(['activeKey']); | ... | ... |
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <div> |
3 | 3 | <div class="mt-8"> |
4 | 4 | <div class="flex"> |
5 | - <div class="flex" v-if="isAdmin(role)"> | |
5 | + <div class="flex" v-if="interfaceType === 'SYSTEM' && isAdmin(role)"> | |
6 | 6 | <Select |
7 | 7 | v-model:value="selectTenant" |
8 | 8 | allowClear |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | /> |
23 | 23 | </div> |
24 | 24 | <Button |
25 | - :disabled="isAdmin(role) ? testDisabled : false" | |
25 | + :disabled="interfaceType === 'SYSTEM' && isAdmin(role) ? testDisabled : false" | |
26 | 26 | class="ml-2" |
27 | 27 | @click="handleTest(isSingleClickText)" |
28 | 28 | type="primary" |
... | ... | @@ -75,6 +75,9 @@ |
75 | 75 | data: { |
76 | 76 | type: Object, |
77 | 77 | }, |
78 | + interfaceType: { | |
79 | + type: String, | |
80 | + }, | |
78 | 81 | }); |
79 | 82 | |
80 | 83 | onMounted(async () => { | ... | ... |
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <div> |
3 | 3 | <div class="mt-8"> |
4 | 4 | <div class="flex"> |
5 | - <div class="flex" v-if="isAdmin(role)"> | |
5 | + <div class="flex" v-if="interfaceType === 'SYSTEM' && isAdmin(role)"> | |
6 | 6 | <Select |
7 | 7 | allowClear |
8 | 8 | v-model:value="selectTenant" |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | /> |
23 | 23 | </div> |
24 | 24 | <Button |
25 | - :disabled="isAdmin(role) ? testDisabled : false" | |
25 | + :disabled="interfaceType === 'SYSTEM' && isAdmin(role) ? testDisabled : false" | |
26 | 26 | class="ml-2" |
27 | 27 | @click="handleTest(isSingleClickText)" |
28 | 28 | type="primary" |
... | ... | @@ -64,6 +64,9 @@ |
64 | 64 | data: { |
65 | 65 | type: Object, |
66 | 66 | }, |
67 | + interfaceType: { | |
68 | + type: String, | |
69 | + }, | |
67 | 70 | }); |
68 | 71 | |
69 | 72 | onMounted(async () => { | ... | ... |
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <div> |
3 | 3 | <div class="mt-8"> |
4 | 4 | <div class="flex"> |
5 | - <div class="flex" v-if="isAdmin(role)"> | |
5 | + <div class="flex" v-if="interfaceType === 'SYSTEM' && isAdmin(role)"> | |
6 | 6 | <Select |
7 | 7 | allowClear |
8 | 8 | v-model:value="selectTenant" |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | /> |
23 | 23 | </div> |
24 | 24 | <Button |
25 | - :disabled="isAdmin(role) ? testDisabled : false" | |
25 | + :disabled="interfaceType === 'SYSTEM' && isAdmin(role) ? testDisabled : false" | |
26 | 26 | class="ml-2" |
27 | 27 | @click="handleTest(isSingleClickText)" |
28 | 28 | type="primary" |
... | ... | @@ -66,6 +66,9 @@ |
66 | 66 | data: { |
67 | 67 | type: Object, |
68 | 68 | }, |
69 | + interfaceType: { | |
70 | + type: String, | |
71 | + }, | |
69 | 72 | }); |
70 | 73 | |
71 | 74 | onMounted(async () => { | ... | ... |
... | ... | @@ -2,6 +2,9 @@ import { BasicColumn, FormSchema } from '/@/components/Table'; |
2 | 2 | import { h } from 'vue'; |
3 | 3 | import { Tag } from 'ant-design-vue'; |
4 | 4 | import { findDictItemByCode } from '/@/api/system/dict'; |
5 | +import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | |
6 | +import { getAuthCache } from '/@/utils/auth'; | |
7 | +import { isAdmin } from '/@/enums/roleEnum'; | |
5 | 8 | |
6 | 9 | // 表格配置 |
7 | 10 | export const columns: BasicColumn[] = [ |
... | ... | @@ -93,6 +96,12 @@ export const searchFormSchema: FormSchema[] = [ |
93 | 96 | ], |
94 | 97 | placeholder: '请选择接口类型', |
95 | 98 | }, |
99 | + ifShow: ({}) => { | |
100 | + const userInfo: any = getAuthCache(USER_INFO_KEY); | |
101 | + const role: string = userInfo?.roles[0]; | |
102 | + if (isAdmin(role)) return true; | |
103 | + else return false; | |
104 | + }, | |
96 | 105 | }, |
97 | 106 | ]; |
98 | 107 | |
... | ... | @@ -135,7 +144,7 @@ export const schemas: FormSchema[] = [ |
135 | 144 | colProps: { |
136 | 145 | span: 8, |
137 | 146 | }, |
138 | - defaultValue: 'SYSTEM', | |
147 | + defaultValue: 'CUSTOM', | |
139 | 148 | componentProps: { |
140 | 149 | options: [ |
141 | 150 | { |
... | ... | @@ -148,6 +157,12 @@ export const schemas: FormSchema[] = [ |
148 | 157 | }, |
149 | 158 | ], |
150 | 159 | }, |
160 | + ifShow: ({}) => { | |
161 | + const userInfo: any = getAuthCache(USER_INFO_KEY); | |
162 | + const role: string = userInfo?.roles[0]; | |
163 | + if (isAdmin(role)) return true; | |
164 | + else return false; | |
165 | + }, | |
151 | 166 | }, |
152 | 167 | { |
153 | 168 | field: 'requestContentType', | ... | ... |