diff --git a/apps/portal/serializers/portal.py b/apps/portal/serializers/portal.py index 78ce7dbdf51..6494ad39814 100644 --- a/apps/portal/serializers/portal.py +++ b/apps/portal/serializers/portal.py @@ -114,11 +114,8 @@ def _enrich_auth_config(self, auth_config): options = [{"label": _(_type), "value": _type} for _type in all_available_auths] options.sort(key=lambda x: (0 if x["value"] == "LOCAL" else 1, x["label"])) - auth_types = [{"label": _(_type), "value": _type} for _type in auth_config["login_value"]] - auth_types.sort(key=lambda x: (0 if x["value"] == "LOCAL" else 1, x["label"])) auth_config["system_options"] = options - auth_config["auth_types"] = auth_types return auth_config def one(self): diff --git a/ui/src/api/types/portal.ts b/ui/src/api/types/portal.ts index 05200524c16..3e5b93b094f 100644 --- a/ui/src/api/types/portal.ts +++ b/ui/src/api/types/portal.ts @@ -7,7 +7,6 @@ export interface PortalAuthConfig extends Dict { failed_attempts?: number lock_time?: number system_options?: OptionItem[] - auth_types?: OptionItem[] } export interface PortalSetting { diff --git a/ui/src/api/types/system-authentication.ts b/ui/src/api/types/system-authentication.ts index 932e971e684..8b4a4c264a7 100644 --- a/ui/src/api/types/system-authentication.ts +++ b/ui/src/api/types/system-authentication.ts @@ -11,14 +11,12 @@ export interface AuthProviderSettingPayload { } export interface LoginAuthSettingPayload { - auth_types?: OptionItem[] default_value: string failed_attempts: number group_id?: string lock_time: number login_methods: string[] max_attempts: number - permission?: string role_id?: string system_options?: OptionItem[] workspace_id?: string diff --git a/ui/src/views/system/settings/authentication/components/LoginSetting.vue b/ui/src/views/system/settings/authentication/components/LoginSetting.vue index 64c70ac3be8..a9b1f836b11 100644 --- a/ui/src/views/system/settings/authentication/components/LoginSetting.vue +++ b/ui/src/views/system/settings/authentication/components/LoginSetting.vue @@ -23,7 +23,7 @@ const loginSettingFields = [ 'lock_time', 'role_id', 'workspace_id', - 'permission', + 'group_id', ] as const const form = reactive>({ login_methods: [LOGIN_METHOD.LOCAL], @@ -33,7 +33,7 @@ const form = reactive>({ lock_time: 10, role_id: ROLE_TYPE.USER, workspace_id: 'default', - permission: 'NOT_AUTH', + group_id: undefined, }) const rules: FormRules = { default_value: [{ required: true, message: '请选择默认登录方式', trigger: 'change' }], @@ -52,7 +52,7 @@ function loadSetting() { return AuthSettingApi.getLoginSetting() .then((setting) => { loginMethodOptions.value = setting.system_options ?? [] - Object.assign(form, pick(setting, [...loginSettingFields, 'group_id'])) + Object.assign(form, pick(setting, loginSettingFields)) }) .finally(() => { loading.value = false