bbbd91db88
Project CI / AI game creator shell Rust crates (push) Successful in 1m34s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m54s
Project CI / Backend tests (push) Successful in 4m9s
Project CI / Frontend tests (push) Successful in 2m6s
Project CI / Native shell tests (push) Successful in 6m22s
Project CI / AI game creator shell Rust lane 2/2 (push) Successful in 8m32s
Project CI / AI game creator shell Rust lane 1/2 (push) Successful in 9m31s
Project CI / AI game creator shell web tests (push) Successful in 1m37s
Project CI / Repository checks (push) Successful in 2m17s
- 新增 scripts/check-game-distribution-web-publish-e2e.mjs:网页登录、选封面、选发行包 ZIP、填资料提交,待审不可见、审核后公开、更新沿用同一 gameId 且旧版在线,共 12 项 PASS - frontendRuntimeConfigService 去掉 skipAuth:发布灰度按作者判定,匿名请求恒为 false,之前只要显式配置过灰度网页端就永远没有发布入口;单测同步更新 - 游戏分发里程碑阶段 C 第 4 条改为已勾选,第 5 条缺口收窄到上传中断/双击/登录失效/窗口关闭与换账号 - pitfalls 记录「按用户灰度配置不能走 skipAuth」的经验
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
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',
|
|
// 必须带上登录态:发布灰度按作者判定,匿名请求恒为 false,
|
|
// 否则一旦显式配置过 `game-distribution:publish`,网页端就再也拿不到发布入口。
|
|
skipRefresh: true,
|
|
notifyAuthStateChange: false,
|
|
clearAuthOnUnauthorized: false,
|
|
},
|
|
);
|
|
}
|