e5460280ce
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
- 后端:GET /api/runtime/frontend-config 新增 gameDistributionPublishEnabled,复用 `game-distribution:publish` 判据(未配置或 enabled=false 时对已登录作者默认开放,显式收紧后只放行白名单/灰度命中用户,匿名恒为 false),前端入口与写入口共用同一事实源。 - 后端用例:新增 frontend_runtime_config_game_distribution_publish_is_scoped_to_authenticated_gate,覆盖默认开放、enabled=true 无白名单、白名单命中、deny 名单、enabled=false 回退与 rolloutPercent=100。 - 网页:平台壳按灰度隐藏「发布游戏 / 发布新版本」入口;/games/publish 直接访问时渲染「发布功能正在灰度中」并提供重新检查;读取失败按放行处理,由后端写入口把关并返回可读文案。 - AGC:新增 readGamePublishAvailability(同一运行时配置字段),只有命中才把发布回调交给 DirectProject 聊天头;字段缺失或读取失败按不开放处理。 - 文档:玩法链路、后端数据契约与实施计划记录灰度口径、入口行为与验证命令。
29 lines
860 B
TypeScript
29 lines
860 B
TypeScript
import { requestJson } from './apiClient';
|
|
|
|
const FRONTEND_RUNTIME_CONFIG_API = '/api/runtime/frontend-config';
|
|
|
|
export type FrontendRuntimeConfig = {
|
|
imageEditorAgentSidebarEnabled: boolean;
|
|
agcTemplateLibraryEnabled: boolean;
|
|
/**
|
|
* 游戏发布灰度开关:后端未配置 `game-distribution:publish` 时对已登录作者默认开放,
|
|
* 显式收紧后只有白名单/灰度命中的作者为 `true`,匿名恒为 `false`。
|
|
*/
|
|
gameDistributionPublishEnabled: boolean;
|
|
};
|
|
|
|
export async function loadFrontendRuntimeConfig() {
|
|
return requestJson<FrontendRuntimeConfig>(
|
|
FRONTEND_RUNTIME_CONFIG_API,
|
|
{ method: 'GET' },
|
|
'读取前端运行时配置失败',
|
|
{
|
|
authImpact: 'local',
|
|
skipAuth: true,
|
|
skipRefresh: true,
|
|
notifyAuthStateChange: false,
|
|
clearAuthOnUnauthorized: false,
|
|
},
|
|
);
|
|
}
|