feat: add admin accounts and image templates

This commit is contained in:
inman
2026-07-03 11:25:25 +08:00
parent d98e58adfa
commit c3ea9f0eb1
61 changed files with 7016 additions and 199 deletions

View File

@@ -4,6 +4,7 @@ import { getEvolinkImageSettings, getSelectedImageEngine, shouldMockEvolinkApi,
import { authConfigSummary, getAuthRuntimeConfig } from "@/lib/auth/config";
import { getJimengCapabilities } from "@/lib/jimeng/capabilities";
import { getSeedanceConfig, shouldMockSeedance } from "@/lib/seedance/client";
import { accountManagementConfigured } from "@/lib/server/organization-client";
import { rootDir } from "@/lib/server/runtime";
import { shouldMockVisualApi } from "@/lib/volcengine/visual-client";
import type { EnabledImageCapability } from "@/lib/types";
@@ -65,7 +66,7 @@ const settingDefinitions: Array<{
]
},
{ key: "ZHINIAN_AUTH_BASE_URL", label: "Auth Base URL" },
{ key: "ZHINIAN_AUTH_CLIENT_ID", label: "客户端 ID", defaultValue: "customPC" },
{ key: "ZHINIAN_AUTH_CLIENT_ID", label: "客户端 ID", defaultValue: "app" },
{ key: "ZHINIAN_AUTH_CLIENT_SECRET", label: "客户端密钥", secret: true, type: "password" },
{ key: "ZHINIAN_AUTH_SCOPE", label: "Scope", defaultValue: "server" },
{ key: "ZHINIAN_AUTH_ISSUER", label: "Issuer", defaultValue: "https://pig4cloud.com" },
@@ -73,6 +74,21 @@ const settingDefinitions: Array<{
{ key: "ZHINIAN_AUTH_SESSION_SECRET", label: "会话签名密钥", secret: true, type: "password" }
]
},
{
id: "organization",
title: "组织账号接口",
description: "用于后台账号管理的组织、成员、角色和部门接口;服务端代调用组织服务。",
fields: [
{ key: "ZHINIAN_ADMIN_AUTHORITIES", label: "管理员权限码", description: "逗号分隔,如 ROLE_ADMIN,sys_user_view" },
{ key: "ZHINIAN_ADMIN_USERS", label: "管理员账号", description: "逗号分隔,默认 ceshiop" },
{ key: "ZHINIAN_ORG_API_BASE_URL", label: "组织服务 Base URL", description: "如 https://gateway.example.com/hotelStaff" },
{ key: "ZHINIAN_ORG_API_TOKEN", label: "组织服务备用 Token", secret: true, type: "password" },
{ key: "ZHINIAN_STAFF_API_BASE_URL", label: "企业端用户服务 Base URL", description: "如 https://gateway.example.com/hotel-staff-server-biz" },
{ key: "ZHINIAN_STAFF_API_TOKEN", label: "企业端用户服务备用 Token", secret: true, type: "password" },
{ key: "ZHINIAN_ORG_TENANT_ID", label: "租户 ID" },
{ key: "ZHINIAN_ORG_ID", label: "默认组织 ID" }
]
},
{
id: "visual",
title: "即梦图片 API",
@@ -178,6 +194,7 @@ export async function getApiSettings() {
evolink: shouldMockEvolinkApi() ? "mock" : "real",
seedance: shouldMockSeedance() ? "mock" : "real",
auth: authConfigSummary(auth),
organization: accountManagementConfigured() ? "configured" : "missing",
data: process.env.SUPABASE_SERVICE_ROLE_KEY ? "supabase" : "local"
},
capabilities: [