diff --git a/src/services/gameDistributionClient.ts b/src/services/gameDistributionClient.ts index ebbbcc10e..36e902ce3 100644 --- a/src/services/gameDistributionClient.ts +++ b/src/services/gameDistributionClient.ts @@ -16,6 +16,7 @@ import type { } from '../../packages/shared/src/contracts/gameDistribution'; import { type ApiRequestOptions, + BACKGROUND_AUTH_REQUEST_OPTIONS, requestJson as requestApiJson, } from './apiClient'; import { getGamePlayClientId } from './gamePlayClientId'; @@ -70,14 +71,8 @@ const PUBLIC_GAME_REQUEST_OPTIONS: ApiRequestOptions = { /** * 游玩上报是后台尽力而为的请求:带上已登录 bearer(后端据此按 userId 去重),但即使遇到 401 - * 也不刷新会话、不改动全局登录态,避免一次计数把整站登录态带进刷新或登出流程。 + * 也不刷新会话、不改动全局登录态——直接复用后台请求已有的同一份鉴权降级策略。 */ -const PLAY_REPORT_REQUEST_OPTIONS: ApiRequestOptions = { - authImpact: 'local', - skipRefresh: true, - notifyAuthStateChange: false, - clearAuthOnUnauthorized: false, -}; async function requestJson( path: string, @@ -197,7 +192,7 @@ export function recordGamePlay(gameId: string) { body: JSON.stringify({ clientId: getGamePlayClientId() }), }, '游玩上报失败', - PLAY_REPORT_REQUEST_OPTIONS, + BACKGROUND_AUTH_REQUEST_OPTIONS, ); }