refactor(core): 平台上报收敛为单个请求头
去掉 device_info_plus 依赖与机型/系统版本,只保留 X-Client-Platform。
This commit is contained in:
1 parent
01a3b0101e
commit
935de13343
6 files changed
+19
-113
No files matched your search
+2
-5
@@ -117,17 +117,14 @@ class LumaDramaApp extends StatefulWidget {
|
||||
class _LumaDramaAppState extends State<LumaDramaApp> {
|
||||
late final AuthSessionStore _sessionStore = AuthSessionStore();
|
||||
|
||||
/// 设备画像只读一次:供拦截器在每次请求头里带上系统与机型。
|
||||
late final DeviceProfileReader _deviceProfile = DeviceProfileReader();
|
||||
|
||||
/// 全 App 共用一个 ApiClient:这样目录、账号、后续的互动/进度请求
|
||||
/// 都自动带 `Authorization` 与 `X-Device-Id`,401 的刷新重试也只有一处实现。
|
||||
/// 都自动带 `Authorization`、`X-Device-Id` 与平台头,401 的刷新重试也只有一处实现。
|
||||
late final ApiClient _apiClient = ApiClient(
|
||||
accessTokenReader: () => _auth.accessToken,
|
||||
tokenRefresher: () => _auth.refresh(),
|
||||
onUnauthorized: () => _auth.clear(),
|
||||
deviceIdReader: _sessionStore.deviceId,
|
||||
deviceProfileReader: _deviceProfile.read,
|
||||
platformReader: clientPlatform,
|
||||
);
|
||||
|
||||
late final AuthController _auth = AuthController(
|
||||
|
||||
Reference in new issue
Block a user