@liujitcn/kratos-admin-core 0.0.87 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,6 +59,18 @@ const AUTH_EXPIRED_EXCLUDED_URL_SET = new Set([
|
|
|
59
59
|
MFA_ENROLLMENT_CONFIRM_URL
|
|
60
60
|
]);
|
|
61
61
|
|
|
62
|
+
/** 删除查询参数中表示“未选择”的租户项目零值。 */
|
|
63
|
+
function compactTenantProjectQueryParams(value: unknown): unknown {
|
|
64
|
+
if (Array.isArray(value)) return value.map(item => compactTenantProjectQueryParams(item));
|
|
65
|
+
if (!value || typeof value !== "object") return value;
|
|
66
|
+
const result: Record<string, unknown> = {};
|
|
67
|
+
for (const [key, nested] of Object.entries(value as Record<string, unknown>)) {
|
|
68
|
+
if ((key === "tenant_id" || key === "project_id" || key.endsWith(".tenant_id") || key.endsWith(".project_id")) && nested === 0) continue;
|
|
69
|
+
result[key] = compactTenantProjectQueryParams(nested);
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
|
|
62
74
|
/** 支持自动重试的 Axios 请求配置。 */
|
|
63
75
|
type RetryableRequestConfig = InternalAxiosRequestConfig & {
|
|
64
76
|
/** 标记当前请求已经因认证失败重试过,避免刷新失败时递归重放。 */
|
|
@@ -109,7 +121,7 @@ const service = axios.create({
|
|
|
109
121
|
baseURL: requestBaseURL,
|
|
110
122
|
timeout: 50000,
|
|
111
123
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
112
|
-
paramsSerializer: params => qs.stringify(params),
|
|
124
|
+
paramsSerializer: params => qs.stringify(compactTenantProjectQueryParams(params)),
|
|
113
125
|
withCredentials: true
|
|
114
126
|
});
|
|
115
127
|
|