Skip to content

Commit 80e2745

Browse files
committed
fix: 默认 policy type
1 parent ead44b1 commit 80e2745

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/enums/appEnum.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ export enum ProviderCategory {
1313
OAuth = 'OAuth',
1414
Generic = 'Generic',
1515
}
16+
17+
export enum PolicyType {
18+
CUSTOM = 'CUSTOM',
19+
SYSTEM = 'CUSTOM',
20+
DEFAULT = 'DEFAULT',
21+
}

src/pages/Policy/Create/_hooks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { updatePolicy, UpdatePolicyRequest } from '@/services/policy/updatePolic
66
import { getPolicyInfo } from '@/services/policy/getPolicyInfo';
77
import { listResources } from '@/services/resource/listResources';
88
import { App } from 'antd';
9+
import { PolicyType } from '@/enums';
910

1011
const INTL = {
1112
CREATE_SUCCESS: {
@@ -182,7 +183,7 @@ export default function usePolicyHook() {
182183
let policy = {
183184
name: values.name,
184185
description: values.description,
185-
type: values.type,
186+
type: values.type ? values.type : PolicyType.CUSTOM,
186187
subjects: values.subjects,
187188
status: '0',
188189
statements: values.statements?.map((item) => {

0 commit comments

Comments
 (0)