Commit 1375f08110c875160e760108ac9203c5767a39b7
Merge branch 'ft' into 'main_dev'
pref: 优化公共接口管理接口类型默认为系统默认 See merge request yunteng/thingskit-front!721
Showing
2 changed files
with
12 additions
and
2 deletions
@@ -126,7 +126,7 @@ export const schemas: FormSchema[] = [ | @@ -126,7 +126,7 @@ export const schemas: FormSchema[] = [ | ||
126 | colProps: { | 126 | colProps: { |
127 | span: 8, | 127 | span: 8, |
128 | }, | 128 | }, |
129 | - defaultValue: 'CUSTOM', | 129 | + defaultValue: 'SYSTEM', |
130 | componentProps: { | 130 | componentProps: { |
131 | api: findDictItemByCode, | 131 | api: findDictItemByCode, |
132 | params: { | 132 | params: { |
@@ -71,6 +71,9 @@ | @@ -71,6 +71,9 @@ | ||
71 | import { useUtils } from './hooks/useUtils'; | 71 | import { useUtils } from './hooks/useUtils'; |
72 | import { Tag } from 'ant-design-vue'; | 72 | import { Tag } from 'ant-design-vue'; |
73 | import { RequestMethodTypeEnum, RequestOriginTypeEnum } from './config/enum'; | 73 | import { RequestMethodTypeEnum, RequestOriginTypeEnum } from './config/enum'; |
74 | + import { isAdmin } from '/@/enums/roleEnum'; | ||
75 | + import { USER_INFO_KEY } from '/@/enums/cacheEnum'; | ||
76 | + import { getAuthCache } from '/@/utils/auth'; | ||
74 | 77 | ||
75 | const { | 78 | const { |
76 | resetReqHttpType, | 79 | resetReqHttpType, |
@@ -82,6 +85,10 @@ | @@ -82,6 +85,10 @@ | ||
82 | 85 | ||
83 | const emits = defineEmits(['success', 'register']); | 86 | const emits = defineEmits(['success', 'register']); |
84 | 87 | ||
88 | + const userInfo: any = getAuthCache(USER_INFO_KEY); | ||
89 | + | ||
90 | + const role: string = userInfo?.roles[0]; | ||
91 | + | ||
85 | const { createMessage } = useMessage(); | 92 | const { createMessage } = useMessage(); |
86 | 93 | ||
87 | const isUpdate = ref(false); | 94 | const isUpdate = ref(false); |
@@ -172,8 +179,11 @@ | @@ -172,8 +179,11 @@ | ||
172 | const filter = simpleRequestRef.value?.getFilterValue(); | 179 | const filter = simpleRequestRef.value?.getFilterValue(); |
173 | const requestOriginUrl = getOriginUrlType(values); | 180 | const requestOriginUrl = getOriginUrlType(values); |
174 | const params = (Objects as Recordable)?.Params?.filter((item) => item.key); | 181 | const params = (Objects as Recordable)?.Params?.filter((item) => item.key); |
175 | - | ||
176 | (Objects as Recordable).Params = params; | 182 | (Objects as Recordable).Params = params; |
183 | + //超级管理员或平台管理员接口类型为系统默认 | ||
184 | + if (isAdmin(role)) { | ||
185 | + values.interfaceType = 'SYSTEM'; //系统默认 | ||
186 | + } | ||
177 | const data = { | 187 | const data = { |
178 | ...values, | 188 | ...values, |
179 | id: !putId.value ? null : putId.value, | 189 | id: !putId.value ? null : putId.value, |