Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-04-30 16:34:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
398f40c23c1d19fa55237627145854e982abaab8
398f40c2
1 parent
dfee89a9
ref |> 统一 OS、Channel公参字段
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/AppUtils.ets
sight_harmony/commons/wdKit/src/main/ets/utils/DeviceUtil.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
sight_harmony/commons/wdKit/src/main/ets/utils/AppUtils.ets
View file @
398f40c
...
...
@@ -53,5 +53,15 @@ export class AppUtils {
}
return '';
}
static getAppChannel() {
// TODO: 待确认,暂时写死一个
return "rmrb_china_0000"
}
static getOSName() {
// TODO: 待确认,暂时写死Android
return "Harmony"
}
}
...
...
sight_harmony/commons/wdKit/src/main/ets/utils/DeviceUtil.ets
View file @
398f40c
...
...
@@ -70,6 +70,13 @@ export class DeviceUtil {
}
/**
* 获取设备型号: HUAWEI Mate 60 Pro
*/
static getMarketName() {
return deviceInfo.marketName
}
/**
* 客户端日志链路追踪traceid生成:在每个请求头加上参数Key:EagleEye-TraceID ,value为32位生成随机值
*/
static getRandomUUIDForTraceID(): string {
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
View file @
398f40c
...
...
@@ -11,14 +11,14 @@ export class HttpParams {
let headers: Record<string, string> = {};
// 通用请求头
headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)' // TODO
headers['channel'] =
'rmrb_china_0000' // 自有渠道
headers['channel'] =
AppUtils.getAppChannel()
headers['plat'] = DeviceUtil.getPlat()
headers['Content-Type'] = 'application/json; charset=utf-8'
headers['device_id'] = DeviceUtil.clientId()
headers['build_version'] = HttpParams.getVersion()
headers['adcode'] = HttpUtils.getProvinceCode()
headers['os_version'] = DeviceUtil.getOsVersion()
headers['system'] =
'Android' // TODO 后续是否新增鸿蒙标识
headers['system'] =
AppUtils.getOSName()
headers['versionCode'] = AppUtils.getAppVersionCode()
headers['version_name'] = AppUtils.getAppVersionName()
headers['EagleEye-TraceID'] = DeviceUtil.getRandomUUIDForTraceID()
...
...
Please
register
or
login
to post a comment