diff --git a/ui/src/views/system/chat-management/authentication/components/CAS.vue b/ui/src/views/system/chat-management/authentication/components/CAS.vue index d5c1a3b02b6..a5f6e953ca7 100644 --- a/ui/src/views/system/chat-management/authentication/components/CAS.vue +++ b/ui/src/views/system/chat-management/authentication/components/CAS.vue @@ -6,10 +6,11 @@ import { LOGIN_METHOD } from '@/api/enums' import type { AuthProviderSettingPayload } from '@/api/types' import { MsgSuccess } from '@/utils/message' import perm from '@/permission' +import { CHAT_API_BASE_PATH } from '@/api/constants.ts' defineOptions({ name: 'CasAuthenticationSetting' }) -const defaultRedirectUrl = `${window.location.origin}${window.MaxKB?.prefix ?? ''}/api/cas` +const defaultRedirectUrl = `${window.location.origin}${CHAT_API_BASE_PATH}/auth/cas` const authFormRef = useTemplateRef('authFormRef') const loading = ref(false) const form = reactive({ diff --git a/ui/src/views/system/chat-management/authentication/components/OAuth2.vue b/ui/src/views/system/chat-management/authentication/components/OAuth2.vue index c8d50f38563..3fff04e1126 100644 --- a/ui/src/views/system/chat-management/authentication/components/OAuth2.vue +++ b/ui/src/views/system/chat-management/authentication/components/OAuth2.vue @@ -6,15 +6,25 @@ import { LOGIN_METHOD } from '@/api/enums' import type { AuthProviderSettingPayload } from '@/api/types' import { MsgSuccess } from '@/utils/message' import perm from '@/permission' +import { CHAT_API_BASE_PATH } from '@/api/constants.ts' defineOptions({ name: 'OidcAuthenticationSetting' }) -const defaultRedirectUrl = `${window.location.origin}${window.MaxKB?.prefix ?? ''}/api/oauth2` +const defaultRedirectUrl = `${window.location.origin}${CHAT_API_BASE_PATH}/auth/oauth2` const authFormRef = useTemplateRef('authFormRef') const loading = ref(false) const form = reactive({ auth_type: LOGIN_METHOD.OAUTH2, - config: { authEndpoint: '', tokenEndpoint: '', userInfoEndpoint: '', scope: '', clientId: '', clientSecret: '', redirectUrl: '', fieldMapping: '' }, + config: { + authEndpoint: '', + tokenEndpoint: '', + userInfoEndpoint: '', + scope: '', + clientId: '', + clientSecret: '', + redirectUrl: defaultRedirectUrl, + fieldMapping: '', + }, is_active: false, }) const rules = reactive>({ diff --git a/ui/src/views/system/chat-management/authentication/components/OIDC.vue b/ui/src/views/system/chat-management/authentication/components/OIDC.vue index 215acce0d22..9437a1b8bf3 100644 --- a/ui/src/views/system/chat-management/authentication/components/OIDC.vue +++ b/ui/src/views/system/chat-management/authentication/components/OIDC.vue @@ -6,10 +6,11 @@ import { LOGIN_METHOD } from '@/api/enums' import type { AuthProviderSettingPayload } from '@/api/types' import { MsgSuccess } from '@/utils/message' import perm from '@/permission' +import { CHAT_API_BASE_PATH } from '@/api/constants.ts' defineOptions({ name: 'OidcAuthenticationSetting' }) const defaultFieldMapping = '{"username":"preferred_username","email":"email"}' -const defaultRedirectUrl = `${window.location.origin}${window.MaxKB?.prefix ?? ''}/api/oidc` +const defaultRedirectUrl = `${window.location.origin}${CHAT_API_BASE_PATH}/auth/oidc` const authFormRef = useTemplateRef('authFormRef') const loading = ref(false)