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
zhenghy
2024-04-26 19:32:22 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
67e09de1e61b4796a5e5b1f9c4dd91c0d7ea6cb8
67e09de1
2 parents
edb65e9b
277f546d
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
62 deletions
sight_harmony/AppScope/app.json5
sight_harmony/commons/wdJsBridge/BuildProfile.ets
sight_harmony/commons/wdKit/src/main/ets/utils/DeviceUtil.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
sight_harmony/AppScope/app.json5
View file @
67e09de
...
...
@@ -2,7 +2,7 @@
"app"
:
{
"bundleName"
:
"com.peopledailychina.hosactivity"
,
"vendor"
:
"$string:app_vendor"
,
"versionCode"
:
10000
00
,
"versionCode"
:
10000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
...
...
sight_harmony/commons/wdJsBridge/BuildProfile.ets
deleted
100644 → 0
View file @
edb65e9
export default class BuildProfile {
static readonly HAR_VERSION = '1.0.0';
static readonly BUILD_MODE_NAME = 'debug';
static readonly DEBUG = true;
}
\ No newline at end of file
sight_harmony/commons/wdKit/src/main/ets/utils/DeviceUtil.ets
View file @
67e09de
...
...
@@ -50,6 +50,30 @@ export class DeviceUtil {
* @returns
*/
static getDisplayVersion(): string {
return deviceInfo.productModel;
return deviceInfo.displayVersion;
}
/**
* 返回设备sdk版本
* 12
* @returns
*/
static getOsVersion(): string {
return deviceInfo.sdkApiVersion + '';
}
/**
* 获取平台标识,暂手机,后续适配tv、笔记本、pad,再扩展
*/
static getPlat() {
return 'Phone';
}
/**
* 客户端日志链路追踪traceid生成:在每个请求头加上参数Key:EagleEye-TraceID ,value为32位生成随机值
*/
static getRandomUUIDForTraceID(): string {
deviceInfo.productModel
return util.generateRandomUUID().toUpperCase().replace('-', '')
}
}
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
View file @
67e09de
import { SpConstants } from 'wdConstant';
import { SPHelper, StringUtils } from 'wdKit';
import {
DateTimeUtils, DeviceUtil,
SPHelper, StringUtils } from 'wdKit';
import { HostEnum, HostManager } from './HttpHostManager';
/**
...
...
@@ -13,27 +13,27 @@ export class HttpParams {
static buildHeaders(): Record<string, string> {
let headers: Record<string, string> = {};
// 通用请求头
headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)'
headers['channel'] = HttpParams.getChannel()
headers['plat'] = HttpParams.getPlat()
headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)' // TODO
headers['channel'] = 'rmrb_china_0000' // 自有渠道
headers['plat'] = DeviceUtil.getPlat()
headers['Content-Type'] = 'application/json; charset=utf-8'
headers['timestamp'] = HttpParams.getTimestamp()
headers['RMRB-X-TOKEN'] = HttpParams.getXToken()
headers['device_id'] = HttpParams.getDeviceId()
if (HttpParams.getXToken() != '') {
headers['cookie'] = 'RMRB-X-TOKEN=' + HttpParams.getXToken()
}
headers['device_id'] = DeviceUtil.clientId()
headers['build_version'] = HttpParams.getVersion()
headers['adcode'] = HttpParams.getAdCode()
headers['os_version'] = HttpParams.getOsVersion()
headers['os_version'] = DeviceUtil.getOsVersion()
headers['system'] = 'Android' // TODO 后续是否新增鸿蒙标识
headers['versionCode'] = HttpParams.getVersionCode()
headers['system'] = HttpParams.getTerminalId()
headers['version_name'] = HttpParams.getVersionName()
headers['EagleEye-TraceID'] = 'D539562E48554A60977AF4BECB6D6C7A'
headers['imei'] = HttpParams.getImei()
headers['EagleEye-TraceID'] = DeviceUtil.getRandomUUIDForTraceID()
headers['imei'] = DeviceUtil.clientId()
headers['Accept-Language'] = 'zh'
headers['timestamp'] = DateTimeUtils.getTimeStamp() + ''
HttpParams.setLocationHeader(headers)
// // TODO 判断是否登录
headers['RMRB-X-TOKEN'] = HttpParams.getXToken()
if (HttpParams.getXToken() != '') {
headers['cookie'] = 'RMRB-X-TOKEN=' + HttpParams.getXToken()
}
headers['userId'] = HttpParams.getUserId()
headers['userType'] = HttpParams.getUserType()
//
...
...
@@ -80,26 +80,6 @@ export class HttpParams {
}
}
private static getCity() {
// TODO 对接定位
return '%E5%90%88%E8%82%A5%E5%B8%82';
}
private static getChannel() {
// TODO 对接配置
return 'rmrb_china_0000';
}
private static getPlat() {
return 'Phone';
}
private static getTimestamp() {
// return DateTimeUtils.getCurrentTime() + '';
// TODO 暂时写死,有些page 真实时间戳 返回数据为空
return '155203523';
}
private static getXToken() {
if (StringUtils.isNotEmpty(HttpParams.token)) {
return HttpParams.token
...
...
@@ -120,11 +100,6 @@ export class HttpParams {
return '';
}
public static getDeviceId() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
private static getVersion() {
// TODO
return '202401242103';
...
...
@@ -132,25 +107,22 @@ export class HttpParams {
private static getVersionCode() {
// TODO
return '
7301
';
return '
10000
';
}
private static getVersionName() {
// TODO
return '
7.3.0.1
';
return '
1.0.0
';
}
private static getAdCode() {
// 省份编码
return '340000';
}
private static getOsVersion() {
// TODO
return '12';
}
public static getCityCode() {
// TODO
// 城市编码
return '340100';
}
...
...
@@ -167,15 +139,6 @@ export class HttpParams {
return '340103';
}
private static getTerminalId() {
return 'Android';
}
public static getImei() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
public static getUserId(): string {
// TODO 对接登录
if (StringUtils.isNotEmpty(HttpParams.userId)) {
...
...
Please
register
or
login
to post a comment