更新
This commit is contained in:
@@ -139,11 +139,41 @@ class McpConfig
|
||||
return self::int('console_ttl_minutes', 120, 10, 480);
|
||||
}
|
||||
|
||||
/** 允许用甄养堂账号登录行知(SsoController;还需要 ENABLED 和下面三项) */
|
||||
public static function ssoEnabled(): bool
|
||||
{
|
||||
return self::bool('sso_enabled', false);
|
||||
}
|
||||
|
||||
/** 行知的客户端标识,与行知管理端里填写的一致 */
|
||||
public static function ssoClientId(): string
|
||||
{
|
||||
return self::str('sso_client_id');
|
||||
}
|
||||
|
||||
/** 行知服务器换取登录结果时出示的密钥(行知管理端生成,至少 32 位) */
|
||||
public static function ssoClientSecret(): string
|
||||
{
|
||||
return self::str('sso_client_secret');
|
||||
}
|
||||
|
||||
/** 登录后允许回到的行知地址(逗号分隔,必须完全一致),例如 http://xz.zhenyangtang.cn:8787/api/auth/sso/zyt/callback */
|
||||
public static function ssoRedirectUris(): array
|
||||
{
|
||||
return self::list('sso_redirect_uris');
|
||||
}
|
||||
|
||||
private static function raw(string $key)
|
||||
{
|
||||
return env('ai_mcp.' . $key);
|
||||
}
|
||||
|
||||
private static function str(string $key): string
|
||||
{
|
||||
$value = self::raw($key);
|
||||
return is_string($value) || is_int($value) || is_float($value) ? trim((string) $value) : '';
|
||||
}
|
||||
|
||||
private static function bool(string $key, bool $default): bool
|
||||
{
|
||||
$value = self::raw($key);
|
||||
|
||||
Reference in New Issue
Block a user