Showing
6 changed files
with
81 additions
and
156 deletions
| 1 | -import HashMap from '@ohos.util.HashMap'; | ||
| 2 | import { SpConstants } from 'wdConstant'; | 1 | import { SpConstants } from 'wdConstant'; |
| 3 | import { SPHelper, StringUtils } from 'wdKit'; | 2 | import { SPHelper, StringUtils } from 'wdKit'; |
| 4 | import { HostEnum, HostManager } from './HttpHostManager'; | 3 | import { HostEnum, HostManager } from './HttpHostManager'; |
| @@ -11,81 +10,73 @@ export class HttpParams { | @@ -11,81 +10,73 @@ export class HttpParams { | ||
| 11 | private static userType = '' | 10 | private static userType = '' |
| 12 | private static token = '' | 11 | private static token = '' |
| 13 | 12 | ||
| 14 | - static getCommonHeaders(): HashMap<string, string> { | ||
| 15 | - let headers: HashMap<string, string> = new HashMap<string, string>() | ||
| 16 | - headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)') | ||
| 17 | - headers.set('channel', HttpParams.getChannel()) | ||
| 18 | - //headers.set('appCode', ConfigConstants.appCode) | ||
| 19 | - headers.set('plat', HttpParams.getPlat()) | ||
| 20 | - //headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a') | ||
| 21 | - headers.set('Content-Type', 'application/json; charset=utf-8') | ||
| 22 | - headers.set('timestamp', HttpParams.getTimestamp()) | ||
| 23 | - headers.set('RMRB-X-TOKEN', HttpParams.getXToken()) | ||
| 24 | - headers.set('device_id', HttpParams.getDeviceId()) | 13 | + static buildHeaders(): Record<string, string> { |
| 14 | + let headers: Record<string, string> = {}; | ||
| 15 | + // 通用请求头 | ||
| 16 | + headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)' | ||
| 17 | + headers['channel'] = HttpParams.getChannel() | ||
| 18 | + headers['plat'] = HttpParams.getPlat() | ||
| 19 | + headers['Content-Type'] = 'application/json; charset=utf-8' | ||
| 20 | + headers['timestamp'] = HttpParams.getTimestamp() | ||
| 21 | + headers['RMRB-X-TOKEN'] = HttpParams.getXToken() | ||
| 22 | + headers['device_id'] = HttpParams.getDeviceId() | ||
| 25 | if (HttpParams.getXToken() != '') { | 23 | if (HttpParams.getXToken() != '') { |
| 26 | - headers.set('cookie', 'RMRB-X-TOKEN=' + HttpParams.getXToken()) | 24 | + headers['cookie'] = 'RMRB-X-TOKEN=' + HttpParams.getXToken() |
| 27 | } | 25 | } |
| 28 | - headers.set('build_version', HttpParams.getVersion()) | ||
| 29 | - headers.set('adcode', HttpParams.getAdCode()) | ||
| 30 | - headers.set('os_version', HttpParams.getOsVersion()) | ||
| 31 | - //headers.set('X-Ca-Stage', 'PRE') | ||
| 32 | - headers.set('versionCode', HttpParams.getVersionCode()) | ||
| 33 | - headers.set('system', HttpParams.getTerminalId()) | ||
| 34 | - headers.set('version_name', HttpParams.getVersionName()) | ||
| 35 | - headers.set('EagleEye-TraceID', 'D539562E48554A60977AF4BECB6D6C7A') | ||
| 36 | - headers.set('imei', HttpParams.getImei()) | ||
| 37 | - headers.set('Accept-Language', 'zh') | 26 | + headers['build_version'] = HttpParams.getVersion() |
| 27 | + headers['adcode'] = HttpParams.getAdCode() | ||
| 28 | + headers['os_version'] = HttpParams.getOsVersion() | ||
| 29 | + headers['versionCode'] = HttpParams.getVersionCode() | ||
| 30 | + headers['system'] = HttpParams.getTerminalId() | ||
| 31 | + headers['version_name'] = HttpParams.getVersionName() | ||
| 32 | + headers['EagleEye-TraceID'] = 'D539562E48554A60977AF4BECB6D6C7A' | ||
| 33 | + headers['imei'] = HttpParams.getImei() | ||
| 34 | + headers['Accept-Language'] = 'zh' | ||
| 38 | HttpParams.setLocationHeader(headers) | 35 | HttpParams.setLocationHeader(headers) |
| 39 | - // TODO 判断是否登录 | ||
| 40 | - headers.set('userId', HttpParams.getUserId()) | ||
| 41 | - headers.set('userType', HttpParams.getUserType()) | ||
| 42 | - | ||
| 43 | - headers.set('mpassid', 'ZbHTMeTsfaYDAHqt8ZHIzcPs') | 36 | + // // TODO 判断是否登录 |
| 37 | + headers['userId'] = HttpParams.getUserId() | ||
| 38 | + headers['userType'] = HttpParams.getUserType() | ||
| 39 | + // | ||
| 40 | + headers['mpassid'] = 'ZbHTMeTsfaYDAHqt8ZHIzcPs' | ||
| 44 | HttpParams.addSpecialHeaders(headers); | 41 | HttpParams.addSpecialHeaders(headers); |
| 45 | - // Logger.debug("TAG", '******************* commonHeaders headers start ******************************** '); | ||
| 46 | - // headers.forEach((v,k)=>{ | ||
| 47 | - // Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v); | ||
| 48 | - // }) | ||
| 49 | - // Logger.debug("TAG", '******************* commonHeaders headers end ******************************** '); | ||
| 50 | return headers; | 42 | return headers; |
| 51 | } | 43 | } |
| 52 | 44 | ||
| 53 | - static addSpecialHeaders(headers: HashMap<string, string>) { | 45 | + static addSpecialHeaders(headers: Record<string, string>) { |
| 54 | switch (HostManager.getHost()) { | 46 | switch (HostManager.getHost()) { |
| 55 | case HostEnum.HOST_UAT: | 47 | case HostEnum.HOST_UAT: |
| 56 | - // TODO 待优化到常量类里 | ||
| 57 | - headers.set('X-Ca-Stage', 'PRE'); | ||
| 58 | - headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a'); | ||
| 59 | - headers.set('appCode', '83092caa603a421aa0222308b3f6b27a'); | 48 | + headers['X-Ca-Stage'] = 'PRE' |
| 49 | + headers['Authorization'] = 'APPCODE 83092caa603a421aa0222308b3f6b27a' | ||
| 50 | + headers['appCode'] = '83092caa603a421aa0222308b3f6b27a' | ||
| 60 | break | 51 | break |
| 61 | case HostEnum.HOST_SIT: | 52 | case HostEnum.HOST_SIT: |
| 62 | - headers.set('X-Ca-Stage', 'TEST'); | ||
| 63 | - headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07'); | ||
| 64 | - headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07'); | 53 | + headers['X-Ca-Stage'] = 'TEST' |
| 54 | + headers['Authorization'] = 'APPCODE 0af1f9085e484c97b2a44704bae72c07' | ||
| 55 | + headers['appCode'] = '0af1f9085e484c97b2a44704bae72c07' | ||
| 65 | break | 56 | break |
| 66 | case HostEnum.HOST_PRODUCT: | 57 | case HostEnum.HOST_PRODUCT: |
| 67 | - headers.set('X-Ca-Stage', 'RELEASE'); | ||
| 68 | - headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6'); | ||
| 69 | - headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6'); | 58 | + headers['X-Ca-Stage'] = 'RELEASE' |
| 59 | + headers['Authorization'] = 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6' | ||
| 60 | + headers['appCode'] = '3d4181bceeb94d9780e10dbb6c67bbf6' | ||
| 70 | break | 61 | break |
| 71 | case HostEnum.HOST_DEV: | 62 | case HostEnum.HOST_DEV: |
| 72 | - headers.set('X-Ca-Stage', 'TEST'); | ||
| 73 | - headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9'); | ||
| 74 | - headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9'); | 63 | + headers['X-Ca-Stage'] = 'TEST' |
| 64 | + headers['Authorization'] = 'APPCODE ff33172859e14f9a8299e3bd769e79f9' | ||
| 65 | + headers['appCode'] = 'ff33172859e14f9a8299e3bd769e79f9' | ||
| 75 | break | 66 | break |
| 76 | default: | 67 | default: |
| 77 | break | 68 | break |
| 78 | } | 69 | } |
| 79 | } | 70 | } |
| 80 | 71 | ||
| 81 | - static setLocationHeader(headers: HashMap<string, string>) { | 72 | + static setLocationHeader(headers: Record<string, string>) { |
| 82 | let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string | 73 | let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string |
| 83 | if (StringUtils.isNotEmpty(cityName)) { | 74 | if (StringUtils.isNotEmpty(cityName)) { |
| 84 | - headers.set('city', encodeURI(cityName)) | 75 | + headers['city'] = encodeURI(cityName) |
| 85 | } | 76 | } |
| 86 | let cityCode = SPHelper.default.getSync(SpConstants.LOCATION_CITY_CODE, '') as string | 77 | let cityCode = SPHelper.default.getSync(SpConstants.LOCATION_CITY_CODE, '') as string |
| 87 | if (StringUtils.isNotEmpty(cityCode)) { | 78 | if (StringUtils.isNotEmpty(cityCode)) { |
| 88 | - headers.set('city_dode', encodeURI(cityCode)) | 79 | + headers['city_dode'] = encodeURI(cityCode) |
| 89 | } | 80 | } |
| 90 | } | 81 | } |
| 91 | 82 |
| 1 | import ArrayList from '@ohos.util.ArrayList'; | 1 | import ArrayList from '@ohos.util.ArrayList'; |
| 2 | import service from './AxiosRequest'; | 2 | import service from './AxiosRequest'; |
| 3 | -import { HttpUtils } from '../utils/HttpUtils'; | ||
| 4 | import { AxiosError, AxiosHeaders, AxiosRequestConfig, RawAxiosRequestHeaders } from '@ohos/axios'; | 3 | import { AxiosError, AxiosHeaders, AxiosRequestConfig, RawAxiosRequestHeaders } from '@ohos/axios'; |
| 5 | import { ResponseDTO } from '../bean/ResponseDTO'; | 4 | import { ResponseDTO } from '../bean/ResponseDTO'; |
| 6 | import HashMap from '@ohos.util.HashMap'; | 5 | import HashMap from '@ohos.util.HashMap'; |
| 6 | +import { HttpParams } from './HttpCommonParams'; | ||
| 7 | 7 | ||
| 8 | export class HttpRequest { | 8 | export class HttpRequest { |
| 9 | private static globalHeaderProviders: ArrayList<() => Record<string, string>> = new ArrayList(); | 9 | private static globalHeaderProviders: ArrayList<() => Record<string, string>> = new ArrayList(); |
| @@ -14,7 +14,7 @@ export class HttpRequest { | @@ -14,7 +14,7 @@ export class HttpRequest { | ||
| 14 | 14 | ||
| 15 | static initHttpHeader() { | 15 | static initHttpHeader() { |
| 16 | HttpRequest.addGlobalHeaderProvider(() => { | 16 | HttpRequest.addGlobalHeaderProvider(() => { |
| 17 | - return HttpUtils.buildHeaders(); | 17 | + return HttpParams.buildHeaders(); |
| 18 | }) | 18 | }) |
| 19 | } | 19 | } |
| 20 | 20 | ||
| @@ -34,15 +34,17 @@ export class HttpRequest { | @@ -34,15 +34,17 @@ export class HttpRequest { | ||
| 34 | 34 | ||
| 35 | static buildHeaderWithGlobalHeader(headers?: HashMap<string, string>): AxiosHeaders { | 35 | static buildHeaderWithGlobalHeader(headers?: HashMap<string, string>): AxiosHeaders { |
| 36 | let commonHeader: AxiosHeaders = new AxiosHeaders() | 36 | let commonHeader: AxiosHeaders = new AxiosHeaders() |
| 37 | - headers?.forEach((v, k) => { | ||
| 38 | - commonHeader.set(k, v); | ||
| 39 | - }); | 37 | + |
| 40 | HttpRequest.globalHeaderProviders.forEach((func) => { | 38 | HttpRequest.globalHeaderProviders.forEach((func) => { |
| 41 | let headers = func(); | 39 | let headers = func(); |
| 42 | for (const obj of Object.entries(headers)) { | 40 | for (const obj of Object.entries(headers)) { |
| 43 | commonHeader.set(obj[0], obj[1]); | 41 | commonHeader.set(obj[0], obj[1]); |
| 44 | } | 42 | } |
| 45 | }) | 43 | }) |
| 44 | + // 业务headers,覆盖common(如果有冲突的话,取业务) | ||
| 45 | + headers?.forEach((v, k) => { | ||
| 46 | + commonHeader.set(k, v); | ||
| 47 | + }); | ||
| 46 | if (!commonHeader.get('Content-Type')) { | 48 | if (!commonHeader.get('Content-Type')) { |
| 47 | commonHeader.set('Content-Type', 'application/json;charset=utf-8'); | 49 | commonHeader.set('Content-Type', 'application/json;charset=utf-8'); |
| 48 | } | 50 | } |
| @@ -56,24 +58,13 @@ export class HttpRequest { | @@ -56,24 +58,13 @@ export class HttpRequest { | ||
| 56 | return service.get(url, config) | 58 | return service.get(url, config) |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 59 | - static post0<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { | 61 | + static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { |
| 60 | let config: AxiosRequestConfig = { | 62 | let config: AxiosRequestConfig = { |
| 61 | headers: HttpRequest.buildHeaderWithGlobalHeader(headers) | 63 | headers: HttpRequest.buildHeaderWithGlobalHeader(headers) |
| 62 | } | 64 | } |
| 63 | return service.post(url, data, config) | 65 | return service.post(url, data, config) |
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | - static post<T = object>(url: string, data1?: object, headers?: HashMap<string, string>): Promise<T> { | ||
| 67 | - let requestHeaders: AxiosHeaders = new AxiosHeaders() | ||
| 68 | - headers?.forEach((v, k) => { | ||
| 69 | - requestHeaders.set(k, v); | ||
| 70 | - }); | ||
| 71 | - let config: AxiosRequestConfig = { | ||
| 72 | - headers: requestHeaders as RawAxiosRequestHeaders, | ||
| 73 | - } | ||
| 74 | - return service.post(url, data1, config) | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | static put<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { | 68 | static put<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { |
| 78 | let config: AxiosRequestConfig = { | 69 | let config: AxiosRequestConfig = { |
| 79 | headers: HttpRequest.buildHeaderWithGlobalHeader(headers) | 70 | headers: HttpRequest.buildHeaderWithGlobalHeader(headers) |
| 1 | -// import { ResponseLogin } from '../bean/account/ResponseLogin'; | ||
| 2 | -import { Logger } from 'wdKit'; | ||
| 3 | - | ||
| 4 | -// import { UserInfo } from '../bean/account/UserInfo'; | ||
| 5 | -// import { ConfigConstants } from '../constants/ConfigConstants'; | ||
| 6 | -// import { AccountManagerUtils } from './AccountManagerUtils'; | ||
| 7 | -// import { AppUtils } from './AppUtils'; | ||
| 8 | -// import { DeviceUtil } from './DeviceUtil'; | ||
| 9 | -// import { Logger } from './Logger'; | ||
| 10 | -// import { StringUtils } from './StringUtils'; | 1 | +import { HttpRequest } from '../http/HttpRequest'; |
| 11 | 2 | ||
| 12 | const TAG: string = '[HttpUtils]' | 3 | const TAG: string = '[HttpUtils]' |
| 13 | 4 | ||
| 14 | export class HttpUtils { | 5 | export class HttpUtils { |
| 15 | - static buildHeaders(): Record<string, string> { | ||
| 16 | - let timestamp: number = new Date().getTime(); // 单位毫秒 | ||
| 17 | - // let clientId = DeviceUtil.clientId() | ||
| 18 | - | ||
| 19 | - let headers: Record<string, string> = {}; | ||
| 20 | - // 通用请求头 | ||
| 21 | - headers["version"] = 'V3'; | ||
| 22 | - // headers["appId"] = ConfigConstants.appId; // 应用id | ||
| 23 | - // headers["terminalId"] = ConfigConstants.terminalId; // 终端ID | ||
| 24 | - // headers["sourceId"] = ConfigConstants.sourceId; // 咪咕视频 | ||
| 25 | - // headers["appType"] = ConfigConstants.appType; // 手机客户端App(安卓) | ||
| 26 | - // headers["clientType"] = ConfigConstants.clientType; // 客户端类型 | ||
| 27 | - // headers["appVersion"] = AppUtils.getAppVersionCode() + ''; // 客户端版本号:2600010500 | ||
| 28 | - // headers["APP-VERSION-CODE"] = AppUtils.getAppVersionCode() + ''; // APP版本号:250006577 | ||
| 29 | - // headers["appVersionName"] = AppUtils.getAppVersionName() // app对外显示版本: '6.1.5.00' | ||
| 30 | - // headers["appCode"] = ConfigConstants.appCode; // 应用编码:产品_渠道_应用的拼接串,用下划线_ 拼接而成 | ||
| 31 | - // headers["ptvCode"] = ConfigConstants.ptvCode; // 基线版本号_应用版本号 todo: | ||
| 32 | - // headers["clientProvinceCode"] = ''; // 客户端分省号 // 02 | ||
| 33 | - // headers["provinceCode"] = ''; // 客户端分省号 // 02 | ||
| 34 | - // headers["clientCityId"] = ''; // 客户端城市ID // 0210 | ||
| 35 | - // headers["carrierCode"] = ''; // 运营商信息 | ||
| 36 | - | ||
| 37 | - // 设备信息请求头 | ||
| 38 | - // headers["User-Agent"] = ''; // 终端UA,自动获取 | ||
| 39 | - headers["Content-Type"] = 'application/json;charset=UTF-8'; // 返回/响应的HTTP内容类型 | ||
| 40 | - headers["os"] = 'android'; // 操作系统类型:鸿蒙、安卓或iOS | ||
| 41 | - // headers["osInfo"] = 'AD'; // 操作系统信息 | ||
| 42 | - headers["Phone-Info"] = 'HUAWEI'; // 手机信息: todo | ||
| 43 | - // headers["oaid"] = ''; // 开放匿名设备ID,是中国移动安全联盟(MSA)发起并制定标准用户识别ID | ||
| 44 | - headers["networkInfo"] = 'WIFI'; // 网络类型: todo | ||
| 45 | - headers["cache-control"] = 'no-cache'; // 请求和响应遵循的缓存机制 | ||
| 46 | - // headers["clientId"] = clientId; // 客户端编号:客户端初始化时生成的客户端ID,保证唯一性 | ||
| 47 | - headers["imei"] = 'd1de6d3ae0db44bea1b3f0e20a14d90a'; // 终端手机序列号: todo | ||
| 48 | - headers["X-UP-CLIENT-CHANNEL-ID"] = '2600010500-99000-101700010130012'; // 客户端渠道ID: todo | ||
| 49 | - headers["channelCode"] = 'VIDEO_APPMAIL'; // 渠道编码 | ||
| 50 | - // headers["l_c"] = clientId; // 客户端id,同clientId | ||
| 51 | - // headers["l_t"] = timestamp + ''; // 本机时间戳 | ||
| 52 | - // headers["l_s"] = ''; // l_c和l_t拼接后的MD5校验 | ||
| 53 | - | ||
| 54 | - // 签名相关请求头 | ||
| 55 | - headers["timeStamp"] = timestamp + ''; // 服务端时间戳(毫秒):1701667763664 | ||
| 56 | - headers["signType"] = 'RSA'; // 签名类型,固定RSA | 6 | + /** |
| 7 | + * 添加公共参数,如登录后,添加登录信息 | ||
| 8 | + */ | ||
| 9 | + static addCommonHeader() { | ||
| 10 | + HttpRequest.addGlobalHeaderProvider(() => { | ||
| 11 | + let headers: Record<string, string> = {}; | ||
| 12 | + return headers; | ||
| 13 | + }) | ||
| 14 | + } | ||
| 57 | 15 | ||
| 58 | - // 业务请求头 | ||
| 59 | - // headers["promotionID"] = '54b0f421-a6df-41d3-9be2-92820b2c5d8c'; // 促销Id todo | ||
| 60 | - // headers["tenantId"] = ''; // 租户Id | 16 | + /** |
| 17 | + * 添加公共参数,如登出后,移除登录信息 | ||
| 18 | + */ | ||
| 19 | + static removeCommonHeader() { | ||
| 61 | 20 | ||
| 62 | - // 添加其他header | ||
| 63 | - // headers["sdkCeId"] = '27fb3129-5a54-45bc-8af1-7dc8f1155501'; // 用户中台老接口定义的ID,保持不变,现网:咪咕视频Android版,27fb3129-5a54-45bc-8af1-7dc8f1155501 todo | ||
| 64 | - headers["support-pendant"] = '1'; // 挂件标识, "1":客户端支持挂件节目结构;非"1":不支持挂件节目结构-展示通用对象 | ||
| 65 | - Logger.info(TAG, "buildHeader headers:" + JSON.stringify(headers)); | ||
| 66 | - return headers; | ||
| 67 | } | 21 | } |
| 68 | -} | ||
| 69 | - | ||
| 70 | -// export default new HttpUtils() | 22 | +} |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -5,7 +5,6 @@ import commentViewModel from '../viewmodel/CommentViewModel' | @@ -5,7 +5,6 @@ import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 5 | import { router, window } from '@kit.ArkUI' | 5 | import { router, window } from '@kit.ArkUI' |
| 6 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 6 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' | 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' |
| 8 | -import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils' | ||
| 9 | import { HttpUrlUtils } from 'wdNetwork/Index' | 8 | import { HttpUrlUtils } from 'wdNetwork/Index' |
| 10 | import PageModel from '../../../viewmodel/PageModel' | 9 | import PageModel from '../../../viewmodel/PageModel' |
| 11 | import { ErrorComponent } from '../../view/ErrorComponent' | 10 | import { ErrorComponent } from '../../view/ErrorComponent' |
| @@ -35,16 +35,8 @@ export class PageRepository { | @@ -35,16 +35,8 @@ export class PageRepository { | ||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static getPageInfoUrl(pageId: string) { | 37 | static getPageInfoUrl(pageId: string) { |
| 38 | - let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; | ||
| 39 | - // TODO 暂定只请求第一页,后续对接分页加载,参数再调整 first_load? | ||
| 40 | - url = url + "?channelStrategy=2&loadStrategy=first_load" | ||
| 41 | - + "&districtCode=" + HttpUrlUtils.getDistrictCode() | ||
| 42 | - + "&provinceCode=" + HttpUrlUtils.getProvinceCode() | ||
| 43 | - + "&cityCode=" + HttpUrlUtils.getCityCode() | ||
| 44 | - + "&refreshTime=" + DateTimeUtils.getTimeStamp() | ||
| 45 | - + "&pageId=" + pageId | ||
| 46 | - // Logger.debug("TAG", 'getCompInfoUrl url: '+url); | ||
| 47 | - Logger.info(TAG, "getPageInfoUrl url = " + url) | 38 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH + "?pageId=" + pageId; |
| 39 | + // Logger.info(TAG, "getPageInfoUrl url = " + url) | ||
| 48 | return url; | 40 | return url; |
| 49 | } | 41 | } |
| 50 | 42 | ||
| @@ -293,7 +285,7 @@ export class PageRepository { | @@ -293,7 +285,7 @@ export class PageRepository { | ||
| 293 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { | 285 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { |
| 294 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE | 286 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE |
| 295 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 287 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 296 | - return WDHttp.post0(url, params, headers) | 288 | + return WDHttp.post(url, params, headers) |
| 297 | } | 289 | } |
| 298 | 290 | ||
| 299 | /** | 291 | /** |
| @@ -304,7 +296,7 @@ export class PageRepository { | @@ -304,7 +296,7 @@ export class PageRepository { | ||
| 304 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 296 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 305 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD | 297 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD |
| 306 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 298 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 307 | - return WDHttp.post0(url, params, headers) | 299 | + return WDHttp.post(url, params, headers) |
| 308 | } | 300 | } |
| 309 | 301 | ||
| 310 | /** | 302 | /** |
| @@ -314,7 +306,7 @@ export class PageRepository { | @@ -314,7 +306,7 @@ export class PageRepository { | ||
| 314 | static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { | 306 | static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { |
| 315 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH | 307 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH |
| 316 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 308 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 317 | - return WDHttp.post0(url, params, headers) | 309 | + return WDHttp.post(url, params, headers) |
| 318 | } | 310 | } |
| 319 | 311 | ||
| 320 | // 浏览历史新增、删除接口 | 312 | // 浏览历史新增、删除接口 |
| @@ -331,7 +323,7 @@ export class PageRepository { | @@ -331,7 +323,7 @@ export class PageRepository { | ||
| 331 | static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { | 323 | static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { |
| 332 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH | 324 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH |
| 333 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 325 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 334 | - return WDHttp.post0(url, params, headers) | 326 | + return WDHttp.post(url, params, headers) |
| 335 | } | 327 | } |
| 336 | 328 | ||
| 337 | /** | 329 | /** |
| @@ -340,7 +332,7 @@ export class PageRepository { | @@ -340,7 +332,7 @@ export class PageRepository { | ||
| 340 | static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { | 332 | static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { |
| 341 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION | 333 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION |
| 342 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 334 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 343 | - return WDHttp.post0(url, params, headers) | 335 | + return WDHttp.post(url, params, headers) |
| 344 | } | 336 | } |
| 345 | 337 | ||
| 346 | static fetchNewspaperInfo(date: string) { | 338 | static fetchNewspaperInfo(date: string) { |
| @@ -245,7 +245,7 @@ export class ContentDetailRequest { | @@ -245,7 +245,7 @@ export class ContentDetailRequest { | ||
| 245 | static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { | 245 | static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { |
| 246 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH | 246 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH |
| 247 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 247 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 248 | - return WDHttp.post0(url, params, headers) | 248 | + return WDHttp.post(url, params, headers) |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | /** | 251 | /** |
| @@ -255,7 +255,7 @@ export class ContentDetailRequest { | @@ -255,7 +255,7 @@ export class ContentDetailRequest { | ||
| 255 | static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> { | 255 | static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> { |
| 256 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS | 256 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS |
| 257 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 257 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 258 | - return WDHttp.post0(url, params, headers) | 258 | + return WDHttp.post(url, params, headers) |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | /** | 261 | /** |
| @@ -265,7 +265,7 @@ export class ContentDetailRequest { | @@ -265,7 +265,7 @@ export class ContentDetailRequest { | ||
| 265 | static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { | 265 | static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { |
| 266 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH | 266 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH |
| 267 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 267 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 268 | - return WDHttp.post0(url, params, headers) | 268 | + return WDHttp.post(url, params, headers) |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | 271 | ||
| @@ -277,7 +277,7 @@ export class ContentDetailRequest { | @@ -277,7 +277,7 @@ export class ContentDetailRequest { | ||
| 277 | static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> { | 277 | static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> { |
| 278 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST | 278 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST |
| 279 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 279 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 280 | - return WDHttp.post0(url, params, headers) | 280 | + return WDHttp.post(url, params, headers) |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | /** | 283 | /** |
| @@ -288,7 +288,7 @@ export class ContentDetailRequest { | @@ -288,7 +288,7 @@ export class ContentDetailRequest { | ||
| 288 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { | 288 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { |
| 289 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE | 289 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE |
| 290 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 290 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 291 | - return WDHttp.post0(url, params, headers) | 291 | + return WDHttp.post(url, params, headers) |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | /** | 294 | /** |
| @@ -299,7 +299,7 @@ export class ContentDetailRequest { | @@ -299,7 +299,7 @@ export class ContentDetailRequest { | ||
| 299 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 299 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 300 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD | 300 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD |
| 301 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 301 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 302 | - return WDHttp.post0(url, params, headers) | 302 | + return WDHttp.post(url, params, headers) |
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | /** | 305 | /** |
| @@ -309,7 +309,7 @@ export class ContentDetailRequest { | @@ -309,7 +309,7 @@ export class ContentDetailRequest { | ||
| 309 | static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> { | 309 | static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> { |
| 310 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE | 310 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE |
| 311 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 311 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 312 | - return WDHttp.post0(url, params, headers) | 312 | + return WDHttp.post(url, params, headers) |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | /** | 315 | /** |
| @@ -318,7 +318,7 @@ export class ContentDetailRequest { | @@ -318,7 +318,7 @@ export class ContentDetailRequest { | ||
| 318 | static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> { | 318 | static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> { |
| 319 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH | 319 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH |
| 320 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 320 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 321 | - return WDHttp.post0(url, params, headers) | 321 | + return WDHttp.post(url, params, headers) |
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | 324 | ||
| @@ -328,7 +328,7 @@ export class ContentDetailRequest { | @@ -328,7 +328,7 @@ export class ContentDetailRequest { | ||
| 328 | static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> { | 328 | static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> { |
| 329 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE | 329 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE |
| 330 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 330 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 331 | - return WDHttp.post0(url, params, headers) | 331 | + return WDHttp.post(url, params, headers) |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | /** | 334 | /** |
| @@ -337,6 +337,6 @@ export class ContentDetailRequest { | @@ -337,6 +337,6 @@ export class ContentDetailRequest { | ||
| 337 | static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { | 337 | static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { |
| 338 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION | 338 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION |
| 339 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 339 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 340 | - return WDHttp.post0(url, params, headers) | 340 | + return WDHttp.post(url, params, headers) |
| 341 | } | 341 | } |
| 342 | } | 342 | } |
-
Please register or login to post a comment