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
shishuangxi
2024-04-23 14:56:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f8d021439603aecdf2621b5d0ed0b0a46e1da4d3
f8d02143
1 parent
60a05b36
接口添加定位信息
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
f8d0214
...
...
@@ -324,8 +324,9 @@ export class HttpUrlUtils {
headers.set('EagleEye-TraceID', 'D539562E48554A60977AF4BECB6D6C7A')
headers.set('imei', HttpUrlUtils.getImei())
headers.set('Accept-Language', 'zh')
headers.set('city', HttpUrlUtils.getCity())
headers.set('city_dode', HttpUrlUtils.getCityCode())
// headers.set('city', HttpUrlUtils.getCity())
// headers.set('city_dode', HttpUrlUtils.getCityCode())
HttpUrlUtils.setLocationHeader(headers)
// TODO 判断是否登录
headers.set('userId', HttpUrlUtils.getUserId())
headers.set('userType', HttpUrlUtils.getUserType())
...
...
@@ -368,6 +369,17 @@ export class HttpUrlUtils {
}
}
static setLocationHeader(headers: HashMap<string, string>){
let cityName= SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME,'') as string
if(StringUtils.isNotEmpty(cityName)){
headers.set('city', encodeURI(cityName))
}
let cityCode= SPHelper.default.getSync(SpConstants.LOCATION_CITY_CODE,'') as string
if(StringUtils.isNotEmpty(cityCode)){
headers.set('city_dode', encodeURI(cityCode))
}
}
static getHost() {
return HttpUrlUtils._hostUrl;
}
...
...
Please
register
or
login
to post a comment