diff --git a/src/bk-login/bklogin/component/bk_user/api.py b/src/bk-login/bklogin/component/bk_user/api.py index 616222676..76fa66a31 100644 --- a/src/bk-login/bklogin/component/bk_user/api.py +++ b/src/bk-login/bklogin/component/bk_user/api.py @@ -8,6 +8,7 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ + import logging from typing import Any, Callable, Dict, List @@ -56,7 +57,7 @@ def _call_bk_user_api_20x(http_func, url_path: str, **kwargs): def get_global_setting() -> GlobalSetting: """查询全局配置""" - data = _call_bk_user_api_20x(http_get, "/api/v1/login/global-settings/") + data = _call_bk_user_api_20x(http_get, "/api/v3/login/global-settings/") return GlobalSetting(**data) @@ -66,21 +67,21 @@ def list_tenant(tenant_ids: List[str] | None = None) -> List[TenantInfo]: if tenant_ids: params["tenant_ids"] = ",".join(tenant_ids) - data = _call_bk_user_api_20x(http_get, "/api/v1/login/tenants/", params=params) + data = _call_bk_user_api_20x(http_get, "/api/v3/login/tenants/", params=params) return [TenantInfo(**i) for i in data] def list_idp(tenant_id: str, idp_owner_tenant_id: str) -> List[IdpInfo]: """获取租户关联的认证源""" data = _call_bk_user_api_20x( - http_get, f"/api/v1/login/tenants/{tenant_id}/idp-owner-tenants/{idp_owner_tenant_id}/idps/" + http_get, f"/api/v3/login/tenants/{tenant_id}/idp-owner-tenants/{idp_owner_tenant_id}/idps/" ) return [IdpInfo(**i) for i in data] def get_idp(idp_id: str) -> IdpDetail: """获取IDP信息""" - data = _call_bk_user_api_20x(http_get, f"/api/v1/login/idps/{idp_id}/") + data = _call_bk_user_api_20x(http_get, f"/api/v3/login/idps/{idp_id}/") return IdpDetail(**data) @@ -88,7 +89,7 @@ def list_matched_tencent_user(tenant_id: str, idp_id: str, idp_users: List[Dict[ """根据IDP用户查询匹配的租户用户""" data = _call_bk_user_api_20x( http_post, - f"/api/v1/login/tenants/{tenant_id}/idps/{idp_id}/matched-tenant-users/", + f"/api/v3/login/tenants/{tenant_id}/idps/{idp_id}/matched-tenant-users/", json={"idp_users": idp_users}, ) return [TenantUserInfo(**i) for i in data] @@ -96,5 +97,5 @@ def list_matched_tencent_user(tenant_id: str, idp_id: str, idp_users: List[Dict[ def get_tenant_user(tenant_user_id: str) -> TenantUserDetailInfo: """通过租户用户ID获取租户用户信息""" - data = _call_bk_user_api_20x(http_get, f"/api/v1/login/tenant-users/{tenant_user_id}/") + data = _call_bk_user_api_20x(http_get, f"/api/v3/login/tenant-users/{tenant_user_id}/") return TenantUserDetailInfo(**data) diff --git a/src/bk-user/bkuser/urls.py b/src/bk-user/bkuser/urls.py index a0174bb89..18b06be13 100644 --- a/src/bk-user/bkuser/urls.py +++ b/src/bk-user/bkuser/urls.py @@ -21,22 +21,22 @@ urlpatterns = [ # 产品功能API - path("api/v1/web/", include("bkuser.apis.web.urls")), + path("api/v3/web/", include("bkuser.apis.web.urls")), # 提供给登录服务使用的内部 API - path("api/v1/login/", include("bkuser.apis.login.urls")), - # 兼容旧版本(v2)用户管理 OpenAPI - # Q: 这里使用 api/v2 而非 api/v2/open, + path("api/v3/login/", include("bkuser.apis.login.urls")), + # 兼容旧版本用户管理 OpenAPI + # Q: 这里使用 api/v1、api/v2 而非 api/v1/open、api/v2/open # A: 为了保证 ESB 调用的兼容,只需修改 ESB 配置 bk_user host,不需要依赖 ESB 的版本发布 + path("api/v1/", include("bkuser.apis.open_v1.urls")), path("api/v2/", include("bkuser.apis.open_v2.urls")), # 用于监控相关的,比如ping/healthz/sentry/metrics/otel等等 - path("api/v1/", include("bkuser.apis.open_v1.urls")), path("", include("bkuser.monitoring.urls")), ] # 蓝鲸通知中心 if settings.ENABLE_BK_NOTICE: urlpatterns += [ - path("api/v1/web/notices/", include(("bk_notice_sdk.urls", "notice"), namespace="notice")), + path("api/v3/web/notices/", include(("bk_notice_sdk.urls", "notice"), namespace="notice")), ] # swagger doc diff --git a/src/idp-plugins/idp_plugins/local/client.py b/src/idp-plugins/idp_plugins/local/client.py index 77deb6e7c..cca570140 100644 --- a/src/idp-plugins/idp_plugins/local/client.py +++ b/src/idp-plugins/idp_plugins/local/client.py @@ -63,7 +63,7 @@ def auth_credentials_of_local_user( """ resp_data = self._call( http_post, - "/api/v1/login/local-user-credentials/authenticate/", + "/api/v3/login/local-user-credentials/authenticate/", json={"data_source_ids": data_source_ids, "username": username, "password": password}, ) diff --git a/src/pages/src/components/import-dialog/import-dialog.vue b/src/pages/src/components/import-dialog/import-dialog.vue index 15b6453f2..9814bd1b8 100644 --- a/src/pages/src/components/import-dialog/import-dialog.vue +++ b/src/pages/src/components/import-dialog/import-dialog.vue @@ -137,7 +137,7 @@ const handleUploadRemove = (file) => { }; // 数据源导出模板 const handleExportTemplate = () => { - const url = `${window.AJAX_BASE_URL}/api/v1/web/data-sources/${props.currentDataSourceId}/operations/download_template/`; + const url = `${window.AJAX_BASE_URL}/api/v3/web/data-sources/${props.currentDataSourceId}/operations/download_template/`; window.open(url); }; // 导入用户 @@ -162,7 +162,7 @@ const confirmImportUsers = async () => { }, withCredentials: true, }; - const url = `${window.AJAX_BASE_URL}/api/v1/web/data-sources/${props.currentDataSourceId}/operations/import/`; + const url = `${window.AJAX_BASE_URL}/api/v3/web/data-sources/${props.currentDataSourceId}/operations/import/`; const res = await axios.post(url, formData, config); if (res.data.data.status === 'success') { emit('update:isShow', false); diff --git a/src/pages/src/http/api.ts b/src/pages/src/http/api.ts index 0184f8a39..7b801856c 100644 --- a/src/pages/src/http/api.ts +++ b/src/pages/src/http/api.ts @@ -1,6 +1,6 @@ import http from './fetch'; -export const currentUser = () => http.get('/api/v1/web/basic/current-user/'); +export const currentUser = () => http.get('/api/v3/web/basic/current-user/'); // 版本日志列表 -export const getVersionLogs = () => http.get('/api/v1/web/version-logs/'); +export const getVersionLogs = () => http.get('/api/v3/web/version-logs/'); diff --git a/src/pages/src/http/authSourceFiles.ts b/src/pages/src/http/authSourceFiles.ts index d8e6f2893..08fc71caa 100644 --- a/src/pages/src/http/authSourceFiles.ts +++ b/src/pages/src/http/authSourceFiles.ts @@ -9,49 +9,49 @@ import type { /** * 认证源列表 */ -export const getIdps = (keyword: string) => http.get(`/api/v1/web/idps/?keyword=${keyword}`); +export const getIdps = (keyword: string) => http.get(`/api/v3/web/idps/?keyword=${keyword}`); /** * 认证源插件列表 */ -export const getIdpsPlugins = () => http.get('/api/v1/web/idps/plugins/'); +export const getIdpsPlugins = () => http.get('/api/v3/web/idps/plugins/'); /** * 新建认证源 */ -export const postIdps = (params: NewIdpsParams) => http.post('/api/v1/web/idps/', params); +export const postIdps = (params: NewIdpsParams) => http.post('/api/v3/web/idps/', params); /** * 认证源详情 */ -export const getIdpsDetails = (id: string) => http.get(`/api/v1/web/idps/${id}/`); +export const getIdpsDetails = (id: string) => http.get(`/api/v3/web/idps/${id}/`); /** * 更新认证源部分字段(local) */ -export const patchIdps = (params: PatchIdpsParams) => http.patch(`/api/v1/web/idps/${params.id}/`, params); +export const patchIdps = (params: PatchIdpsParams) => http.patch(`/api/v3/web/idps/${params.id}/`, params); /** * 更新认证源 */ -export const putIdps = (params: PutIdpsParams) => http.put(`/api/v1/web/idps/${params.id}/`, params); +export const putIdps = (params: PutIdpsParams) => http.put(`/api/v3/web/idps/${params.id}/`, params); /** * 认证源插件默认配置 */ -export const getIdpsPluginsConfig = (id: string) => http.get(`/api/v1/web/idps/plugins/${id}/config-meta/`); +export const getIdpsPluginsConfig = (id: string) => http.get(`/api/v3/web/idps/plugins/${id}/config-meta/`); /** * 新建本地账密认证源 */ -export const postLocalIdps = (params: NewLocalIdpsParams) => http.post('/api/v1/web/idps/local/', params); +export const postLocalIdps = (params: NewLocalIdpsParams) => http.post('/api/v3/web/idps/local/', params); /** * 本地认证源详情 */ -export const getLocalIdps = (id: string) => http.get(`/api/v1/web/idps/local/${id}/`); +export const getLocalIdps = (id: string) => http.get(`/api/v3/web/idps/local/${id}/`); /** * 更新本地认证源 */ -export const putLocalIdps = (params: NewLocalIdpsParams) => http.put(`/api/v1/web/idps/local/${params.id}/`, params); +export const putLocalIdps = (params: NewLocalIdpsParams) => http.put(`/api/v3/web/idps/local/${params.id}/`, params); diff --git a/src/pages/src/http/dataSourceFiles.ts b/src/pages/src/http/dataSourceFiles.ts index 1984c958f..7649fb485 100644 --- a/src/pages/src/http/dataSourceFiles.ts +++ b/src/pages/src/http/dataSourceFiles.ts @@ -20,20 +20,20 @@ import type { */ export const getDataSourceUsers = (params: DataSourceUsersParams): Promise => { const { id, username, page, pageSize } = params; - return http.get(`/api/v1/web/data-sources/${id}/users/?username=${username}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/data-sources/${id}/users/?username=${username}&page=${page}&page_size=${pageSize}`); }; /** * 新建数据源用户 */ -export const newDataSourceUser = (params: NewDataSourceUserParams) => http.post(`/api/v1/web/data-sources/${params.id}/users/`, params); +export const newDataSourceUser = (params: NewDataSourceUserParams) => http.post(`/api/v3/web/data-sources/${params.id}/users/`, params); /** * 数据源创建用户-下拉部门列表 */ export const getDataSourceDepartments = (params: DepartmentsParams) => { const { id, name, page, pageSize } = params; - return http.get(`/api/v1/web/data-sources/${id}/departments/?name=${name}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/data-sources/${id}/departments/?name=${name}&page=${page}&page_size=${pageSize}`); }; /** @@ -41,90 +41,90 @@ export const getDataSourceDepartments = (params: DepartmentsParams) => { */ export const getDataSourceLeaders = (params: LeadersParams) => { const { id, keyword, page, pageSize } = params; - return http.get(`/api/v1/web/data-sources/${id}/leaders/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/data-sources/${id}/leaders/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); }; /** * 数据源用户详情 */ -export const getDataSourceUserDetails = (id: string) => http.get(`/api/v1/web/data-sources/users/${id}/`); +export const getDataSourceUserDetails = (id: string) => http.get(`/api/v3/web/data-sources/users/${id}/`); /** * 更新数据源用户 */ -export const putDataSourceUserDetails = (params: PutDataSourceUserParams) => http.put(`/api/v1/web/data-sources/users/${params.id}/`, params); +export const putDataSourceUserDetails = (params: PutDataSourceUserParams) => http.put(`/api/v3/web/data-sources/users/${params.id}/`, params); /** * 数据源列表 */ -export const getDataSourceList = (params: { type: string }) => http.get('/api/v1/web/data-sources/', params); +export const getDataSourceList = (params: { type: string }) => http.get('/api/v3/web/data-sources/', params); /** * 数据源插件列表 */ -export const getDataSourcePlugins = () => http.get('/api/v1/web/data-sources/plugins/'); +export const getDataSourcePlugins = () => http.get('/api/v3/web/data-sources/plugins/'); /** * 新建数据源 */ -export const newDataSource = (params: NewDataSourceParams) => http.post('/api/v1/web/data-sources/', params); +export const newDataSource = (params: NewDataSourceParams) => http.post('/api/v3/web/data-sources/', params); /** * 数据源详情 */ -export const getDataSourceDetails = (id: string) => http.get(`/api/v1/web/data-sources/${id}/`); +export const getDataSourceDetails = (id: string) => http.get(`/api/v3/web/data-sources/${id}/`); /** * 新建数据源默认配置 */ -export const getDefaultConfig = (id: string) => http.get(`/api/v1/web/data-sources/plugins/${id}/default-config/`); +export const getDefaultConfig = (id: string) => http.get(`/api/v3/web/data-sources/plugins/${id}/default-config/`); /** * 更新数据源 */ -export const putDataSourceDetails = (params: PutDataSourceParams) => http.put(`/api/v1/web/data-sources/${params.id}/`, params); +export const putDataSourceDetails = (params: PutDataSourceParams) => http.put(`/api/v3/web/data-sources/${params.id}/`, params); /** * 变更数据源状态 */ -export const changeSwitchStatus = (id: string) => http.patch(`/api/v1/web/data-sources/${id}/operations/switch_status/`); +export const changeSwitchStatus = (id: string) => http.patch(`/api/v3/web/data-sources/${id}/operations/switch_status/`); /** * 数据源连通性测试 */ -export const postTestConnection = (params: TestConnectionParams) => http.post('/api/v1/web/data-sources/test-connection/', params); +export const postTestConnection = (params: TestConnectionParams) => http.post('/api/v3/web/data-sources/test-connection/', params); /** * 数据源同步 */ -export const postOperationsSync = (id: string) => http.post(`/api/v1/web/data-sources/${id}/operations/sync/`); +export const postOperationsSync = (id: string) => http.post(`/api/v3/web/data-sources/${id}/operations/sync/`); /** * 生成数据源用户随机密码 */ -export const randomPasswords = (params: GeneratePasswordParams) => http.post('/api/v1/web/data-sources/random-passwords/', params); +export const randomPasswords = (params: GeneratePasswordParams) => http.post('/api/v3/web/data-sources/random-passwords/', params); /** * 数据源更新记录 */ -export const getSyncRecords = (params: SyncRecordsParams) => http.get(`/api/v1/web/data-sources/${params.id}/sync-records/`, params); +export const getSyncRecords = (params: SyncRecordsParams) => http.get(`/api/v3/web/data-sources/${params.id}/sync-records/`, params); /** * 数据源更新日志 */ -export const getSyncLogs = (id: string) => http.get(`/api/v1/web/data-sources/sync-records/${id}/`); +export const getSyncLogs = (id: string) => http.get(`/api/v3/web/data-sources/sync-records/${id}/`); /** * 重置数据源用户密码 */ -export const putUsersPassword = (params: ResetPasswordParams) => http.put(`/api/v1/web/data-sources/users/${params.id}/password/`, params); +export const putUsersPassword = (params: ResetPasswordParams) => http.put(`/api/v3/web/data-sources/users/${params.id}/password/`, params); /** * 重置数据源 */ -export const deleteDataSources = (params: DeleteDataSourcesParams) => http.delete(`/api/v1/web/data-sources/${params.id}/`, params); +export const deleteDataSources = (params: DeleteDataSourcesParams) => http.delete(`/api/v3/web/data-sources/${params.id}/`, params); /** * 数据源关联资源信息 */ -export const getRelatedResource = (id: string) => http.get(`/api/v1/web/data-sources/${id}/related-resource-statistics/`); +export const getRelatedResource = (id: string) => http.get(`/api/v3/web/data-sources/${id}/related-resource-statistics/`); diff --git a/src/pages/src/http/fetch/index.ts b/src/pages/src/http/fetch/index.ts index fa86242a1..ee6e0f124 100644 --- a/src/pages/src/http/fetch/index.ts +++ b/src/pages/src/http/fetch/index.ts @@ -89,7 +89,7 @@ const handleReject = (error: AxiosError, config: Record) => { const { message = '', data = {}, code = '', details = [] } = error.response.data.error; if (status === 401) { - if (error.config.url === '/api/v1/web/basic/current-user/') { + if (error.config.url === '/api/v3/web/basic/current-user/') { return window.location.href = getLoginUrl(false); } // 登录弹窗 diff --git a/src/pages/src/http/organizationFiles.ts b/src/pages/src/http/organizationFiles.ts index 51312c046..06fc56891 100644 --- a/src/pages/src/http/organizationFiles.ts +++ b/src/pages/src/http/organizationFiles.ts @@ -5,30 +5,30 @@ import type { UpdateTenantParams, } from './types/organizationFiles'; -const prefix = 'api/v1/web/organization'; +const prefix = 'api/v3/web/organization'; /** * 组织架构-租户列表 */ -export const getTenantOrganizationList = () => http.get('/api/v1/web/tenant-organization/tenants/'); +export const getTenantOrganizationList = () => http.get('/api/v3/web/tenant-organization/tenants/'); /** * 单个租户详情 */ -export const getTenantOrganizationDetails = (id: string) => http.get(`/api/v1/web/tenant-organization/tenants/${id}/`); +export const getTenantOrganizationDetails = (id: string) => http.get(`/api/v3/web/tenant-organization/tenants/${id}/`); /** * 更新租户 */ export const putTenantOrganizationDetails = (id: string, params: UpdateTenantParams) => { - const url = http.put(`/api/v1/web/tenant-organization/tenants/${id}/`, params); + const url = http.put(`/api/v3/web/tenant-organization/tenants/${id}/`, params); return url; }; /** * 租户下的二级子部门列表 */ -export const getTenantDepartments = (id: string) => http.get(`/api/v1/web/tenant-organization/departments/${id}/children/`); +export const getTenantDepartments = (id: string) => http.get(`/api/v3/web/tenant-organization/departments/${id}/children/`); /** @@ -36,7 +36,7 @@ export const getTenantDepartments = (id: string) => http.get(`/api/v1/web/tenant */ export const getTenantDepartmentsList = (params: DepartmentsListParams) => { const { id, keyword, page, pageSize, recursive } = params; - return http.get(`/api/v1/web/tenant-organization/departments/${id}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}&recursive=${recursive}`); + return http.get(`/api/v3/web/tenant-organization/departments/${id}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}&recursive=${recursive}`); }; /** @@ -44,7 +44,7 @@ export const getTenantDepartmentsList = (params: DepartmentsListParams) => { */ export const getTenantOrganizationUsersList = (params: TenantListParams) => { const { id, keyword, page, pageSize } = params; - return http.get(`/api/v1/web/tenant-organization/tenants/${id}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/tenant-organization/tenants/${id}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); }; /** diff --git a/src/pages/src/http/personalCenterFiles.ts b/src/pages/src/http/personalCenterFiles.ts index 617150b4a..e9d3a4e83 100644 --- a/src/pages/src/http/personalCenterFiles.ts +++ b/src/pages/src/http/personalCenterFiles.ts @@ -9,54 +9,54 @@ import type { /** *个人中心-关联账户列表 */ -export const getCurrentNaturalUser = () => http.get('/api/v1/web/personal-center/current-natural-user/'); +export const getCurrentNaturalUser = () => http.get('/api/v3/web/personal-center/current-natural-user/'); /** * 个人中心-关联账户详情 */ -export const getPersonalCenterUsers = (id: string) => http.get(`/api/v1/web/personal-center/tenant-users/${id}/`); +export const getPersonalCenterUsers = (id: string) => http.get(`/api/v3/web/personal-center/tenant-users/${id}/`); /** * 租户用户更新邮箱 */ -export const patchUsersEmail = (params: PatchUserEmailParams) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/email/`, params); +export const patchUsersEmail = (params: PatchUserEmailParams) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/email/`, params); /** * 租户用户更新手机号 */ -export const patchUsersPhone = (params: PatchUserPhoneParams) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/phone/`, params); +export const patchUsersPhone = (params: PatchUserPhoneParams) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/phone/`, params); /** * 租户用户更新头像 */ -export const patchTenantUsersLogo = (params: PatchUserLogoParams) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/logo/`, params); +export const patchTenantUsersLogo = (params: PatchUserLogoParams) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/logo/`, params); /** * 个人中心-用户可见字段列表 */ -export const getPersonalCenterUserVisibleFields = (id: string) => http.get(`/api/v1/web/personal-center/tenant-users/${id}/fields/`); +export const getPersonalCenterUserVisibleFields = (id: string) => http.get(`/api/v3/web/personal-center/tenant-users/${id}/fields/`); /** * 修改用户自定义字段 */ -export const putPersonalCenterUserExtrasFields = (params: any) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/extras/`, params); +export const putPersonalCenterUserExtrasFields = (params: any) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/extras/`, params); /** * 租户用户更新语言 */ -export const putUserLanguage = (params: any) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/language/`, params); +export const putUserLanguage = (params: any) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/language/`, params); /** * 租户用户更新时区 */ -export const putUserTimeZone = (params: any) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/time-zone/`, params); +export const putUserTimeZone = (params: any) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/time-zone/`, params); /** * 个人中心修改密码 */ -export const putPersonalCenterUserPassword = (params: PutUserPasswordParams) => http.put(`/api/v1/web/personal-center/tenant-users/${params.id}/password/`, params); +export const putPersonalCenterUserPassword = (params: PutUserPasswordParams) => http.put(`/api/v3/web/personal-center/tenant-users/${params.id}/password/`, params); /** * 个人中心-用户功能特性-当前用户是否支持修改密码 */ -export const getPersonalCenterUserFeature = (id: string) => http.get(`/api/v1/web/personal-center/tenant-users/${id}/feature-flags/`); +export const getPersonalCenterUserFeature = (id: string) => http.get(`/api/v3/web/personal-center/tenant-users/${id}/feature-flags/`); diff --git a/src/pages/src/http/resetPasswordFiles.ts b/src/pages/src/http/resetPasswordFiles.ts index f3070a9a1..3ed52eef7 100644 --- a/src/pages/src/http/resetPasswordFiles.ts +++ b/src/pages/src/http/resetPasswordFiles.ts @@ -3,24 +3,24 @@ import http from './fetch'; /** * 发送短信验证码 */ -export const verificationCodes = (params: any) => http.post('/api/v1/web/passwords/operations/reset/methods/phone/verification-codes/', params); +export const verificationCodes = (params: any) => http.post('/api/v3/web/passwords/operations/reset/methods/phone/verification-codes/', params); /** * 发送重置密码链接到用户邮箱 */ -export const tokenUrls = (params: any) => http.post('/api/v1/web/passwords/operations/reset/methods/email/token-urls/', params); +export const tokenUrls = (params: any) => http.post('/api/v3/web/passwords/operations/reset/methods/email/token-urls/', params); /** * 通过短信验证码获取重置密码链接 */ -export const resetPasswordUrl = (params: any) => http.post('/api/v1/web/passwords/operations/reset/methods/verification-code/token-urls/', params); +export const resetPasswordUrl = (params: any) => http.post('/api/v3/web/passwords/operations/reset/methods/verification-code/token-urls/', params); /** * 根据 Token 获取可重置密码的租户用户列表 */ -export const getUsers = (params: any) => http.get('/api/v1/web/passwords/operations/reset/methods/token/users/', params); +export const getUsers = (params: any) => http.get('/api/v3/web/passwords/operations/reset/methods/token/users/', params); /** * 根据 Token 重置密码 */ -export const resetPassword = (params: any) => http.post('/api/v1/web/passwords/operations/reset/methods/token/passwords/', params); +export const resetPassword = (params: any) => http.post('/api/v3/web/passwords/operations/reset/methods/token/passwords/', params); diff --git a/src/pages/src/http/settingFiles.ts b/src/pages/src/http/settingFiles.ts index 4aff8642b..3b4131074 100644 --- a/src/pages/src/http/settingFiles.ts +++ b/src/pages/src/http/settingFiles.ts @@ -17,138 +17,138 @@ import type { /** * 用户字段列表 */ -export const getFields = () => http.get('/api/v1/web/tenant-setting/fields/'); +export const getFields = () => http.get('/api/v3/web/tenant-setting/fields/'); /** * 新建用户自定义字段 */ -export const newCustomFields = (params: NewCustomFieldsParams) => http.post('/api/v1/web/tenant-setting/custom-fields/', params); +export const newCustomFields = (params: NewCustomFieldsParams) => http.post('/api/v3/web/tenant-setting/custom-fields/', params); /** * 修改用户自定义字段 */ -export const putCustomFields = (params: PutCustomFieldsParams) => http.put(`/api/v1/web/tenant-setting/custom-fields/${params.id}/`, params); +export const putCustomFields = (params: PutCustomFieldsParams) => http.put(`/api/v3/web/tenant-setting/custom-fields/${params.id}/`, params); /** * 删除用户自定义字段 */ -export const deleteCustomFields = (id: string) => http.delete(`/api/v1/web/tenant-setting/custom-fields/${id}/`); +export const deleteCustomFields = (id: string) => http.delete(`/api/v3/web/tenant-setting/custom-fields/${id}/`); /** * 获取当前租户的账户有效期设置 */ -export const getTenantUserValidityPeriod = () => http.get('/api/v1/web/tenant-setting/settings/tenant-user-validity-period/'); +export const getTenantUserValidityPeriod = () => http.get('/api/v3/web/tenant-setting/settings/tenant-user-validity-period/'); /** * 更新当前租户的账户有效期设置 */ -export const putTenantUserValidityPeriod = (params: PutUserValidityParams) => http.put('/api/v1/web/tenant-setting/settings/tenant-user-validity-period/', params); +export const putTenantUserValidityPeriod = (params: PutUserValidityParams) => http.put('/api/v3/web/tenant-setting/settings/tenant-user-validity-period/', params); /** * 管理员配置-租户内置管理账号信息 */ -export const getBuiltinManager = () => http.get('/api/v1/web/tenant-info/builtin-manager/'); +export const getBuiltinManager = () => http.get('/api/v3/web/tenant-info/builtin-manager/'); /** * 管理员配置-变更内置管理账号密码相关信息 */ -export const patchBuiltinManager = (params: PatchBuiltinManagerParams) => http.patch('/api/v1/web/tenant-info/builtin-manager/', params); +export const patchBuiltinManager = (params: PatchBuiltinManagerParams) => http.patch('/api/v3/web/tenant-info/builtin-manager/', params); /** * 管理员配置-重置内置管理账号密码 */ -export const putBuiltinManagerPassword = (params: PutPasswordParams) => http.put('/api/v1/web/tenant-info/builtin-manager/password/', params); +export const putBuiltinManagerPassword = (params: PutPasswordParams) => http.put('/api/v3/web/tenant-info/builtin-manager/password/', params); /** * 管理员配置-租户实名管理员列表 */ -export const getRealManagers = () => http.get('/api/v1/web/tenant-info/real-managers/'); +export const getRealManagers = () => http.get('/api/v3/web/tenant-info/real-managers/'); /** * 管理员配置-租户实名用户列表 */ -export const getRealUsers = (params: RealUsersParams) => http.get('/api/v1/web/tenant-info/real-users/', params); +export const getRealUsers = (params: RealUsersParams) => http.get('/api/v3/web/tenant-info/real-users/', params); /** * 管理员配置-批量添加租户实名管理员 */ -export const postRealManagers = (params: PutRealManagersParams) => http.post('/api/v1/web/tenant-info/real-managers/', params); +export const postRealManagers = (params: PutRealManagersParams) => http.post('/api/v3/web/tenant-info/real-managers/', params); /** * 管理员配置-批量移除租户实名管理员 */ -export const deleteRealManagers = (ids: string) => http.delete(`/api/v1/web/tenant-info/real-managers/?ids=${ids}`); +export const deleteRealManagers = (ids: string) => http.delete(`/api/v3/web/tenant-info/real-managers/?ids=${ids}`); /** * 基础设置-租户详情 */ -export const getTenantInfo = () => http.get('/api/v1/web/tenant-info/'); +export const getTenantInfo = () => http.get('/api/v3/web/tenant-info/'); /** * 基础设置-更新租户 */ -export const PutTenantInfo = (params: PutTenantInfoParams) => http.put('/api/v1/web/tenant-info/', params); +export const PutTenantInfo = (params: PutTenantInfoParams) => http.put('/api/v3/web/tenant-info/', params); /** * 跨租户协同-我分享的协同策略 */ -export const getToStrategies = () => http.get('/api/v1/web/collaboration/to-strategies/'); +export const getToStrategies = () => http.get('/api/v3/web/collaboration/to-strategies/'); /** * 跨租户协同-我分享的协同策略切换状态 */ -export const putToStrategiesStatus = (id: number) => http.put(`/api/v1/web/collaboration/to-strategies/${id}/source-status/`); +export const putToStrategiesStatus = (id: number) => http.put(`/api/v3/web/collaboration/to-strategies/${id}/source-status/`); /** * 跨租户协同-新建协同策略 */ -export const postToStrategies = (params: NewToStrategiesParams) => http.post('/api/v1/web/collaboration/to-strategies/', params); +export const postToStrategies = (params: NewToStrategiesParams) => http.post('/api/v3/web/collaboration/to-strategies/', params); /** * 跨租户协同-更新协同策略 */ -export const putToStrategies = (id: number, params: NewToStrategiesParams) => http.put(`/api/v1/web/collaboration/to-strategies/${id}/`, params); +export const putToStrategies = (id: number, params: NewToStrategiesParams) => http.put(`/api/v3/web/collaboration/to-strategies/${id}/`, params); /** * 跨租户协同-删除协同策略 */ -export const deleteToStrategies = (id: number) => http.delete(`/api/v1/web/collaboration/to-strategies/${id}/`); +export const deleteToStrategies = (id: number) => http.delete(`/api/v3/web/collaboration/to-strategies/${id}/`); /** * 跨租户协同-我接受的协同策略 */ -export const getFromStrategies = () => http.get('/api/v1/web/collaboration/from-strategies/'); +export const getFromStrategies = () => http.get('/api/v3/web/collaboration/from-strategies/'); /** * 跨租户协同-我接受的协同策略切换状态 */ -export const putFromStrategiesStatus = (id: number) => http.put(`/api/v1/web/collaboration/from-strategies/${id}/target-status/`); +export const putFromStrategiesStatus = (id: number) => http.put(`/api/v3/web/collaboration/from-strategies/${id}/target-status/`); /** * 跨租户协同-源租户自定义字段 */ -export const getSourceTenantCustomFields = (id: number) => http.get(`/api/v1/web/collaboration/from-strategies/${id}/source-tenant-custom-fields/`); +export const getSourceTenantCustomFields = (id: number) => http.get(`/api/v3/web/collaboration/from-strategies/${id}/source-tenant-custom-fields/`); /** * 跨租户协同-确认协同策略 */ -export const putFromStrategiesConfirm = (params: FromStrategiesConfirmParams) => http.put(`/api/v1/web/collaboration/from-strategies/${params.id}/operations/confirm/`, params); +export const putFromStrategiesConfirm = (params: FromStrategiesConfirmParams) => http.put(`/api/v3/web/collaboration/from-strategies/${params.id}/operations/confirm/`, params); /** * 跨租户协同-编辑协同策略 */ -export const putFromStrategies = (params: FromStrategiesConfirmParams) => http.put(`/api/v1/web/collaboration/from-strategies/${params.id}/`, params); +export const putFromStrategies = (params: FromStrategiesConfirmParams) => http.put(`/api/v3/web/collaboration/from-strategies/${params.id}/`, params); /** * 跨租户协同-数据更新记录 */ -export const getCollaborationSyncRecords = (params: CollaborationSyncRecordsParams) => http.get('/api/v1/web/collaboration/sync-records/', params); +export const getCollaborationSyncRecords = (params: CollaborationSyncRecordsParams) => http.get('/api/v3/web/collaboration/sync-records/', params); /** * 跨租户协同-数据更新记录-日志详情 */ -export const getCollaborationSyncRecordsLogs = (id: number) => http.get(`/api/v1/web/collaboration/sync-records/${id}/`); +export const getCollaborationSyncRecordsLogs = (id: number) => http.get(`/api/v3/web/collaboration/sync-records/${id}/`); /** * 跨租户协同-新建协同策略-目标租户 */ -export const getTenantList = (params: TenantItem) => http.get('/api/v1/web/collaboration/target-tenants/', params); +export const getTenantList = (params: TenantItem) => http.get('/api/v3/web/collaboration/target-tenants/', params); diff --git a/src/pages/src/http/tenantsFiles.ts b/src/pages/src/http/tenantsFiles.ts index a1e840fa1..71d482a2d 100644 --- a/src/pages/src/http/tenantsFiles.ts +++ b/src/pages/src/http/tenantsFiles.ts @@ -13,72 +13,72 @@ import type { /** * 获取租户列表 */ -export const getTenants = (): Promise => http.get('/api/v1/web/platform-management/tenants/'); +export const getTenants = (): Promise => http.get('/api/v3/web/platform-management/tenants/'); /** * 搜索租户列表 */ -export const searchTenants = (name: string): Promise => http.get(`/api/v1/web/tenants/?name=${name}`); +export const searchTenants = (name: string): Promise => http.get(`/api/v3/web/tenants/?name=${name}`); /** * 新建租户 */ -export const createTenants = (params: NewTenantParams) => http.post('/api/v1/web/platform-management/tenants/', params); +export const createTenants = (params: NewTenantParams) => http.post('/api/v3/web/platform-management/tenants/', params); /** * 租户详情查询 */ -export const getTenantDetails = (id: string): Promise => http.get(`/api/v1/web/platform-management/tenants/${id}/`); +export const getTenantDetails = (id: string): Promise => http.get(`/api/v3/web/platform-management/tenants/${id}/`); /** * 更新租户 */ -export const putTenants = (id: string, params: TenantUpdateParams) => http.put(`/api/v1/web/platform-management/tenants/${id}/`, params); +export const putTenants = (id: string, params: TenantUpdateParams) => http.put(`/api/v3/web/platform-management/tenants/${id}/`, params); /** * 获取租户管理员 */ -export const getTenantUsers = (id: string) => http.get(`/api/v1/web/tenants/${id}/users/`); +export const getTenantUsers = (id: string) => http.get(`/api/v3/web/tenants/${id}/users/`); /** * 获取租户下的用户列表 */ export const getTenantUsersList = (params: TenantUsersListParams): Promise => { const { tenantId, keyword, page, pageSize } = params; - return http.get(`/api/v1/web/tenants/${tenantId}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/tenants/${tenantId}/users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); }; /** * 全局配置-租户可见性 */ -export const getGlobalSetting = (id: string) => http.get(`/api/v1/web/global-settings/${id}/`); +export const getGlobalSetting = (id: string) => http.get(`/api/v3/web/global-settings/${id}/`); /** * 更新全局配置 */ -export const putGlobalSetting = (params: GlobalSettingUpdateParams) => http.put(`/api/v1/web/global-settings/${params.id}/`, params); +export const putGlobalSetting = (params: GlobalSettingUpdateParams) => http.put(`/api/v3/web/global-settings/${params.id}/`, params); /** * 获取内置管理账号详情 */ -export const getTenantsBuiltinManager = (id: string) => http.get(`/api/v1/web/platform-management/tenants/${id}/builtin-manager/`); +export const getTenantsBuiltinManager = (id: string) => http.get(`/api/v3/web/platform-management/tenants/${id}/builtin-manager/`); /** * 变更内置管理账号密码相关信息 */ -export const putBuiltinManager = (id: string, params: BuiltinManagerParams) => http.put(`/api/v1/web/platform-management/tenants/${id}/builtin-manager/`, params); +export const putBuiltinManager = (id: string, params: BuiltinManagerParams) => http.put(`/api/v3/web/platform-management/tenants/${id}/builtin-manager/`, params); /** * 删除租户 */ -export const deleteTenants = (id: string) => http.delete(`/api/v1/web/platform-management/tenants/${id}/`); +export const deleteTenants = (id: string) => http.delete(`/api/v3/web/platform-management/tenants/${id}/`); /** * 变更租户状态 */ -export const putTenantsStatus = (id: string) => http.put(`/api/v1/web/platform-management/tenants/${id}/status/`); +export const putTenantsStatus = (id: string) => http.put(`/api/v3/web/platform-management/tenants/${id}/status/`); /** * 租户关联资源信息 */ -export const getTenantsRelatedResource = (id: string) => http.get(`/api/v1/web/platform-management/tenants/${id}/related-resource-statistics/`); +export const getTenantsRelatedResource = (id: string) => http.get(`/api/v3/web/platform-management/tenants/${id}/related-resource-statistics/`); diff --git a/src/pages/src/http/virtualAccount.ts b/src/pages/src/http/virtualAccount.ts index fec20d17b..23476dbe2 100644 --- a/src/pages/src/http/virtualAccount.ts +++ b/src/pages/src/http/virtualAccount.ts @@ -10,25 +10,25 @@ import type { */ export const getVirtualUsers = (params: VirtualUsersParams) => { const { keyword, page, pageSize } = params; - return http.get(`/api/v1/web/virtual-users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); + return http.get(`/api/v3/web/virtual-users/?keyword=${keyword}&page=${page}&page_size=${pageSize}`); }; /** * 新建虚拟用户 */ -export const newVirtualUsers = (params: NewVirtualUsersParams) => http.post('/api/v1/web/virtual-users/', params); +export const newVirtualUsers = (params: NewVirtualUsersParams) => http.post('/api/v3/web/virtual-users/', params); /** * 虚拟用户详情 */ -export const getVirtualUsersDetail = (id: string) => http.get(`/api/v1/web/virtual-users/${id}/`); +export const getVirtualUsersDetail = (id: string) => http.get(`/api/v3/web/virtual-users/${id}/`); /** * 更新虚拟用户 */ -export const putVirtualUsers = (id: string, params: PutVirtualUsersParams) => http.put(`/api/v1/web/virtual-users/${id}/`, params); +export const putVirtualUsers = (id: string, params: PutVirtualUsersParams) => http.put(`/api/v3/web/virtual-users/${id}/`, params); /** * 删除虚拟用户 */ -export const deleteVirtualUsers = (id: string) => http.delete(`/api/v1/web/virtual-users/${id}/`); +export const deleteVirtualUsers = (id: string) => http.delete(`/api/v3/web/virtual-users/${id}/`); diff --git a/src/pages/src/views/MainHeader.vue b/src/pages/src/views/MainHeader.vue index 6a78e1971..435aad954 100644 --- a/src/pages/src/views/MainHeader.vue +++ b/src/pages/src/views/MainHeader.vue @@ -235,7 +235,7 @@ const docUrl = window.BK_USER_DOC_URL; const feedbackUrl = window.BK_USER_FEEDBACK_URL; // 消息通知配置信息 -const apiUrl = `${window.AJAX_BASE_URL}/api/v1/web/notices/announcements/`; +const apiUrl = `${window.AJAX_BASE_URL}/api/v3/web/notices/announcements/`; const isNoticeEnabled = window.ENABLE_BK_NOTICE !== 'False'; // 公告列表change事件回调 const showAlertChange = (isShow: boolean) => { diff --git a/src/pages/src/views/setting/data-source/ConfigList.vue b/src/pages/src/views/setting/data-source/ConfigList.vue index 67eebc066..07a0d6c26 100644 --- a/src/pages/src/views/setting/data-source/ConfigList.vue +++ b/src/pages/src/views/setting/data-source/ConfigList.vue @@ -296,7 +296,7 @@ const handleUploadRemove = (file) => { // 数据源导出模板 const handleExportTemplate = () => { - const url = `${window.AJAX_BASE_URL}/api/v1/web/data-sources/${currentDataSourceId.value}/operations/download_template/`; + const url = `${window.AJAX_BASE_URL}/api/v3/web/data-sources/${currentDataSourceId.value}/operations/download_template/`; window.open(url); }; @@ -322,7 +322,7 @@ const confirmImportUsers = async () => { }, withCredentials: true, }; - const url = `${window.AJAX_BASE_URL}/api/v1/web/data-sources/${currentDataSourceId.value}/operations/import/`; + const url = `${window.AJAX_BASE_URL}/api/v3/web/data-sources/${currentDataSourceId.value}/operations/import/`; const res = await axios.post(url, formData, config); if (res.data.data.status === 'success') { importDialog.isShow = false;