zhangbo1_wd

接口请求,拆出公共header

Showing 22 changed files with 130 additions and 306 deletions
@@ -95,11 +95,10 @@ export class HttpBizUtil { @@ -95,11 +95,10 @@ export class HttpBizUtil {
95 let params: HashMap<string, string> = new HashMap<string, string>() 95 let params: HashMap<string, string> = new HashMap<string, string>()
96 params.set('refreshToken', HttpUrlUtils.getRefreshToken()) 96 params.set('refreshToken', HttpUrlUtils.getRefreshToken())
97 params.set('deviceId', HttpUrlUtils.getDeviceId()) 97 params.set('deviceId', HttpUrlUtils.getDeviceId())
98 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
99 // Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken()) 98 // Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken())
100 // 请求刷新token接口 99 // 请求刷新token接口
101 return new Promise<string>((success, error) => { 100 return new Promise<string>((success, error) => {
102 - WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params, headers).then((resDTO: ResponseDTO<RefreshTokenRes>) => { 101 + WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params).then((resDTO: ResponseDTO<RefreshTokenRes>) => {
103 let newToken = '' 102 let newToken = ''
104 if (resDTO) { 103 if (resDTO) {
105 Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.message) 104 Logger.debug(TAG, 'refreshToken getRefreshToken: ' + resDTO.message)
@@ -36,7 +36,6 @@ export class HttpParams { @@ -36,7 +36,6 @@ export class HttpParams {
36 } 36 }
37 headers['userId'] = HttpParams.getUserId() 37 headers['userId'] = HttpParams.getUserId()
38 headers['userType'] = HttpParams.getUserType() 38 headers['userType'] = HttpParams.getUserType()
39 - //  
40 headers['mpassid'] = 'ZbHTMeTsfaYDAHqt8ZHIzcPs' 39 headers['mpassid'] = 'ZbHTMeTsfaYDAHqt8ZHIzcPs'
41 HttpParams.addSpecialHeaders(headers); 40 HttpParams.addSpecialHeaders(headers);
42 return headers; 41 return headers;
@@ -36,8 +36,8 @@ export class HttpRequest { @@ -36,8 +36,8 @@ export class HttpRequest {
36 let commonHeader: AxiosHeaders = new AxiosHeaders() 36 let commonHeader: AxiosHeaders = new AxiosHeaders()
37 37
38 HttpRequest.globalHeaderProviders.forEach((func) => { 38 HttpRequest.globalHeaderProviders.forEach((func) => {
39 - let headers = func();  
40 - for (const obj of Object.entries(headers)) { 39 + let getHeaders = func();
  40 + for (const obj of Object.entries(getHeaders)) {
41 commonHeader.set(obj[0], obj[1]); 41 commonHeader.set(obj[0], obj[1]);
42 } 42 }
43 }) 43 })
@@ -290,7 +290,11 @@ export class HttpUrlUtils { @@ -290,7 +290,11 @@ export class HttpUrlUtils {
290 private static userType = '' 290 private static userType = ''
291 private static token = '' 291 private static token = ''
292 292
293 - static getCommonHeaders(): HashMap<string, string> { 293 + /**
  294 + * @deprecated
  295 + * @returns
  296 + */
  297 + private static getCommonHeaders(): HashMap<string, string> {
294 let headers: HashMap<string, string> = new HashMap<string, string>() 298 let headers: HashMap<string, string> = new HashMap<string, string>()
295 headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)') 299 headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)')
296 headers.set('channel', HttpUrlUtils.getChannel()) 300 headers.set('channel', HttpUrlUtils.getChannel())
@@ -331,7 +335,7 @@ export class HttpUrlUtils { @@ -331,7 +335,7 @@ export class HttpUrlUtils {
331 return headers; 335 return headers;
332 } 336 }
333 337
334 - static addSpecialHeaders(headers: HashMap<string, string>) { 338 + private static addSpecialHeaders(headers: HashMap<string, string>) {
335 switch (HostManager.getHost()) { 339 switch (HostManager.getHost()) {
336 case HostEnum.HOST_UAT: 340 case HostEnum.HOST_UAT:
337 // TODO 待优化到常量类里 341 // TODO 待优化到常量类里
@@ -359,7 +363,7 @@ export class HttpUrlUtils { @@ -359,7 +363,7 @@ export class HttpUrlUtils {
359 } 363 }
360 } 364 }
361 365
362 - static setLocationHeader(headers: HashMap<string, string>) { 366 + private static setLocationHeader(headers: HashMap<string, string>) {
363 let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string 367 let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
364 if (StringUtils.isNotEmpty(cityName)) { 368 if (StringUtils.isNotEmpty(cityName)) {
365 headers.set('city', encodeURI(cityName)) 369 headers.set('city', encodeURI(cityName))
@@ -851,44 +855,6 @@ export class HttpUrlUtils { @@ -851,44 +855,6 @@ export class HttpUrlUtils {
851 return url; 855 return url;
852 } 856 }
853 857
854 - // static getYcgCommonHeaders(): HashMap<string, string> {  
855 - // let headers: HashMap<string, string> = new HashMap<string, string>()  
856 - //  
857 - // headers.set('mpassid', 'XGt6jfGUx8ADAKruTyAMdhHj')  
858 - // headers.set('city', "%E5%90%88%E8%82%A5%E5%B8%82")  
859 - // headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 10; PCT-AL10 Build/HUAWEIPCT-AL10)')  
860 - // headers.set('channel', "rmrb_china_0000")  
861 - // headers.set('appCode', "0af1f9085e484c97b2a44704bae72c07")  
862 - // headers.set('Authorization', "APPCODE 0af1f9085e484c97b2a44704bae72c07")  
863 - // headers.set('X-Ca-Stage', "TEST")  
864 - // headers.set('plat', "Phone")  
865 - // headers.set('Content-Type', 'application/json; charset=utf-8')  
866 - // headers.set('timestamp', "740977741")  
867 - // headers.set('RMRB-X-TOKEN', "eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDc1NjM3NywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ.KBkF0Yki-JWlq0ZIOCzgKwQc1ycBnFHa6CF-rMPRgHU")  
868 - // headers.set('device_id', "5156098c-6c44-3514-af70-04a0139a9327")  
869 - // // headers.set('cookie', 'RMRB-X-TOKEN=eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDU4Mzk0MywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ._LTKrUxQozpCj1XMhx1TWOIxn5gjDveoPuMFGpI0g_8')  
870 - // headers.set('build_version', "202403112023")  
871 - // headers.set('adcode', "340000")  
872 - // headers.set('os_version', "10")  
873 - // headers.set('city_dode', "340100")  
874 - // headers.set('userId', "567387477063621")  
875 - // headers.set('versionCode', "7302")  
876 - // headers.set('system', "Android")  
877 - // headers.set('version_name', "7.3.0.2")  
878 - // headers.set('EagleEye-TraceID', '101118E4D006453DA549A82AA8CAFBFE')  
879 - // headers.set('imei', "5156098c-6c44-3514-af70-04a0139a9327")  
880 - // headers.set('userType', "1")  
881 - // headers.set('Accept-Language', 'zh')  
882 - //  
883 - // // HttpUrlUtils.addSpecialHeaders(headers);  
884 - // // Logger.debug("TAG", '******************* commonHeaders headers start ******************************** ');  
885 - // // headers.forEach((v,k)=>{  
886 - // // Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v);  
887 - // // })  
888 - // // Logger.debug("TAG", '******************* commonHeaders headers end ******************************** ');  
889 - // return headers;  
890 - // }  
891 -  
892 public static setUserId(userId: string) { 858 public static setUserId(userId: string) {
893 HttpUrlUtils.userId = userId; 859 HttpUrlUtils.userId = userId;
894 } 860 }
1 -import HashMap from '@ohos.util.HashMap';  
2 import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; 1 import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
3 import { H5ReceiveDataJsonBean, postBatchAttentionStatusResult } from 'wdBean'; 2 import { H5ReceiveDataJsonBean, postBatchAttentionStatusResult } from 'wdBean';
4 import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork'; 3 import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork';
@@ -7,7 +6,6 @@ const TAG = 'JsCallAppService' @@ -7,7 +6,6 @@ const TAG = 'JsCallAppService'
7 6
8 7
9 export function handleJsCallAppService(data: Message, callback: (res: string) => void) { 8 export function handleJsCallAppService(data: Message, callback: (res: string) => void) {
10 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
11 let url: string = HttpUrlUtils.getHost() + data?.data?.url 9 let url: string = HttpUrlUtils.getHost() + data?.data?.url
12 10
13 let responseMap: ResponseDTO<postBatchAttentionStatusResult> = {} as ResponseDTO<postBatchAttentionStatusResult> 11 let responseMap: ResponseDTO<postBatchAttentionStatusResult> = {} as ResponseDTO<postBatchAttentionStatusResult>
@@ -23,7 +21,7 @@ export function handleJsCallAppService(data: Message, callback: (res: string) => @@ -23,7 +21,7 @@ export function handleJsCallAppService(data: Message, callback: (res: string) =>
23 // }) 21 // })
24 // } 22 // }
25 if (data?.data?.method === 'post' && data?.data?.url === '/api/rmrb-interact/interact/zh/c/batchAttention/status') { 23 if (data?.data?.method === 'post' && data?.data?.url === '/api/rmrb-interact/interact/zh/c/batchAttention/status') {
26 - WDHttp.post<ResponseDTO<postBatchAttentionStatusResult>>(url, data?.data?.parameters, headers).then((res: ResponseDTO<postBatchAttentionStatusResult>) => { 24 + WDHttp.post<ResponseDTO<postBatchAttentionStatusResult>>(url, data?.data?.parameters).then((res: ResponseDTO<postBatchAttentionStatusResult>) => {
27 h5ReceiveDataJson.responseMap = res 25 h5ReceiveDataJson.responseMap = res
28 callback(JSON.stringify(h5ReceiveDataJson)) 26 callback(JSON.stringify(h5ReceiveDataJson))
29 }) 27 })
1 -import { DateTimeUtils, Logger, ResourcesUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; 1 +import { DateTimeUtils, Logger, ToastUtils, UserDataLocal } from 'wdKit/Index';
2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
3 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 3 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
4 import { 4 import {
@@ -8,8 +8,6 @@ import { @@ -8,8 +8,6 @@ import {
8 commentStatusModel, 8 commentStatusModel,
9 WDPublicUserType 9 WDPublicUserType
10 } from '../model/CommentModel'; 10 } from '../model/CommentModel';
11 -import HashMap from '@ohos.util.HashMap';  
12 -import { ifaa } from '@kit.OnlineAuthenticationKit';  
13 import { publishCommentModel } from '../model/PublishCommentModel'; 11 import { publishCommentModel } from '../model/PublishCommentModel';
14 12
15 const TAG = "CommentViewModel" 13 const TAG = "CommentViewModel"
@@ -34,9 +32,8 @@ class CommentViewModel { @@ -34,9 +32,8 @@ class CommentViewModel {
34 let url = HttpUrlUtils.getContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUrlUtils.getDeviceId()}&userId=${HttpUrlUtils.getUserId()}&userType=${HttpUrlUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}` 32 let url = HttpUrlUtils.getContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUrlUtils.getDeviceId()}&userId=${HttpUrlUtils.getUserId()}&userType=${HttpUrlUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}`
35 url = url.replace(' ', '%20') 33 url = url.replace(' ', '%20')
36 34
37 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
38 return new Promise<commentListModel>((success, fail) => { 35 return new Promise<commentListModel>((success, fail) => {
39 - HttpRequest.get<ResponseDTO<commentListModel>>(url, headers).then((data: ResponseDTO<commentListModel>) => { 36 + HttpRequest.get<ResponseDTO<commentListModel>>(url).then((data: ResponseDTO<commentListModel>) => {
40 if (!data || !data.data) { 37 if (!data || !data.data) {
41 fail("数据为空") 38 fail("数据为空")
42 return 39 return
@@ -65,9 +62,8 @@ class CommentViewModel { @@ -65,9 +62,8 @@ class CommentViewModel {
65 let url = HttpUrlUtils.getChildContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&commentId=${commentId}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUrlUtils.getDeviceId()}&userId=${HttpUrlUtils.getUserId()}&userType=${HttpUrlUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}` 62 let url = HttpUrlUtils.getChildContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&commentId=${commentId}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUrlUtils.getDeviceId()}&userId=${HttpUrlUtils.getUserId()}&userType=${HttpUrlUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}`
66 url = url.replace(' ', '%20') 63 url = url.replace(' ', '%20')
67 64
68 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
69 return new Promise<commentListModel>((success, fail) => { 65 return new Promise<commentListModel>((success, fail) => {
70 - HttpRequest.get<ResponseDTO<commentListModel>>(url, headers).then((data: ResponseDTO<commentListModel>) => { 66 + HttpRequest.get<ResponseDTO<commentListModel>>(url).then((data: ResponseDTO<commentListModel>) => {
71 if (!data || !data.data) { 67 if (!data || !data.data) {
72 fail("数据为空") 68 fail("数据为空")
73 return 69 return
@@ -95,9 +91,8 @@ class CommentViewModel { @@ -95,9 +91,8 @@ class CommentViewModel {
95 /*获取热门评论*/ 91 /*获取热门评论*/
96 fetchQualityCommentList(pageNum: string): Promise<commentListModel> { 92 fetchQualityCommentList(pageNum: string): Promise<commentListModel> {
97 let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}` 93 let url = HttpUrlUtils.getQualityCommentUrl() + `?&pageSize=${10}&pageNum=${pageNum}`
98 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
99 return new Promise<commentListModel>((success, fail) => { 94 return new Promise<commentListModel>((success, fail) => {
100 - HttpRequest.get<ResponseDTO<commentListModel>>(url, headers).then((data: ResponseDTO<commentListModel>) => { 95 + HttpRequest.get<ResponseDTO<commentListModel>>(url).then((data: ResponseDTO<commentListModel>) => {
101 if (!data || !data.data) { 96 if (!data || !data.data) {
102 fail("数据为空") 97 fail("数据为空")
103 return 98 return
@@ -125,7 +120,6 @@ class CommentViewModel { @@ -125,7 +120,6 @@ class CommentViewModel {
125 120
126 return new Promise<void>((success, fail) => { 121 return new Promise<void>((success, fail) => {
127 let url = HttpUrlUtils.getCommentLikeUrl() 122 let url = HttpUrlUtils.getCommentLikeUrl()
128 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
129 let bean: Record<string, string> = {}; 123 let bean: Record<string, string> = {};
130 124
131 // commentId number 125 // commentId number
@@ -148,7 +142,7 @@ class CommentViewModel { @@ -148,7 +142,7 @@ class CommentViewModel {
148 bean['userName'] = UserDataLocal.getUserId(); 142 bean['userName'] = UserDataLocal.getUserId();
149 bean['userHeaderUrl'] = UserDataLocal.getUserHeaderUrl(); 143 bean['userHeaderUrl'] = UserDataLocal.getUserHeaderUrl();
150 144
151 - HttpBizUtil.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => { 145 + HttpBizUtil.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => {
152 if (data.code != 0) { 146 if (data.code != 0) {
153 fail() 147 fail()
154 return 148 return
@@ -166,7 +160,6 @@ class CommentViewModel { @@ -166,7 +160,6 @@ class CommentViewModel {
166 160
167 return new Promise<commentItemModel>((success, fail) => { 161 return new Promise<commentItemModel>((success, fail) => {
168 let url = HttpUrlUtils.getPublishCommentUrl() 162 let url = HttpUrlUtils.getPublishCommentUrl()
169 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
170 let bean: Record<string, string> = {}; 163 let bean: Record<string, string> = {};
171 164
172 bean['targetId'] = model.targetId; 165 bean['targetId'] = model.targetId;
@@ -182,7 +175,7 @@ class CommentViewModel { @@ -182,7 +175,7 @@ class CommentViewModel {
182 bean['targetType'] = model.targetType 175 bean['targetType'] = model.targetType
183 bean['parentId'] = model.parentId 176 bean['parentId'] = model.parentId
184 177
185 - HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean, headers).then((data: ResponseDTO<commentItemModel>) => { 178 + HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
186 if (data.code != 0) { 179 if (data.code != 0) {
187 ToastUtils.showToast(data.message, 1000); 180 ToastUtils.showToast(data.message, 1000);
188 fail() 181 fail()
@@ -246,10 +239,9 @@ class CommentViewModel { @@ -246,10 +239,9 @@ class CommentViewModel {
246 let promise1 = new Promise<void>((success) => { 239 let promise1 = new Promise<void>((success) => {
247 // HttpRequest HttpBizUtil 240 // HttpRequest HttpBizUtil
248 let url = HttpUrlUtils.getBatchCommentStatusUrl(); 241 let url = HttpUrlUtils.getBatchCommentStatusUrl();
249 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
250 let bean: Record<string, string[]> = {}; 242 let bean: Record<string, string[]> = {};
251 bean['commentIdList'] = commentIDs; 243 bean['commentIdList'] = commentIDs;
252 - HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => { 244 + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => {
253 if (!data || !data.data) { 245 if (!data || !data.data) {
254 success() 246 success()
255 return 247 return
@@ -290,9 +282,8 @@ class CommentViewModel { @@ -290,9 +282,8 @@ class CommentViewModel {
290 if (fromUserIDs.length > 0) { 282 if (fromUserIDs.length > 0) {
291 let promise2 = new Promise<void>((success) => { 283 let promise2 = new Promise<void>((success) => {
292 let url = HttpUrlUtils.getBatchUserUrl(); 284 let url = HttpUrlUtils.getBatchUserUrl();
293 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
294 // HttpRequest HttpBizUtil 285 // HttpRequest HttpBizUtil
295 - HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, fromUserIDs, headers).then((data: ResponseDTO<commentStatusModel[]>) => { 286 + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, fromUserIDs).then((data: ResponseDTO<commentStatusModel[]>) => {
296 if (!data || !data.data) { 287 if (!data || !data.data) {
297 success() 288 success()
298 return 289 return
@@ -334,11 +325,10 @@ class CommentViewModel { @@ -334,11 +325,10 @@ class CommentViewModel {
334 if (creatorIDs.length > 0) { 325 if (creatorIDs.length > 0) {
335 let promise3 = new Promise<void>((success) => { 326 let promise3 = new Promise<void>((success) => {
336 let url = HttpUrlUtils.getDetailListUrl(); 327 let url = HttpUrlUtils.getDetailListUrl();
337 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
338 let bean: Record<string, string[]> = {}; 328 let bean: Record<string, string[]> = {};
339 bean['creatorIdList'] = creatorIDs; 329 bean['creatorIdList'] = creatorIDs;
340 // HttpRequest HttpBizUtil 330 // HttpRequest HttpBizUtil
341 - HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean, headers).then((data: ResponseDTO<commentStatusModel[]>) => { 331 + HttpRequest.post<ResponseDTO<commentStatusModel[]>>(url, bean).then((data: ResponseDTO<commentStatusModel[]>) => {
342 if (!data || !data.data) { 332 if (!data || !data.data) {
343 success() 333 success()
344 return 334 return
1 -import { HashMap } from '@kit.ArkTS';  
2 import { Logger } from 'wdKit/Index'; 1 import { Logger } from 'wdKit/Index';
3 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
4 -import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';  
5 3
6 export class LikeModel { 4 export class LikeModel {
7 executeLike(data: Record<string, string>) { 5 executeLike(data: Record<string, string>) {
8 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
9 -  
10 return new Promise<object>((success, fail) => { 6 return new Promise<object>((success, fail) => {
11 - HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data, headers).then((data: ResponseDTO<object>) => { 7 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data).then((data: ResponseDTO<object>) => {
12 if (data.code != 0) { 8 if (data.code != 0) {
13 fail(data.message) 9 fail(data.message)
14 return 10 return
@@ -23,12 +19,11 @@ export class LikeModel { @@ -23,12 +19,11 @@ export class LikeModel {
23 19
24 20
25 getLikeStatus(data: Record<string, string>) { 21 getLikeStatus(data: Record<string, string>) {
26 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
27 let model : Record<string,Record<string,string>[]> = {} 22 let model : Record<string,Record<string,string>[]> = {}
28 model['contentList'] = [data] 23 model['contentList'] = [data]
29 24
30 return new Promise<object>((success, fail) => { 25 return new Promise<object>((success, fail) => {
31 - HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getLikeStatus(), model, headers).then((data: ResponseDTO<object>) => { 26 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getLikeStatus(), model).then((data: ResponseDTO<object>) => {
32 if (data.code != 0) { 27 if (data.code != 0) {
33 fail(data.message) 28 fail(data.message)
34 return 29 return
@@ -44,14 +39,13 @@ export class LikeModel { @@ -44,14 +39,13 @@ export class LikeModel {
44 39
45 40
46 getLikeCount(data: Record<string, string>) { 41 getLikeCount(data: Record<string, string>) {
47 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
48 let channelId : string = data['channelId'] 42 let channelId : string = data['channelId']
49 let contentId : string = data['contentId'] 43 let contentId : string = data['contentId']
50 let contentType : string = data['contentType'] 44 let contentType : string = data['contentType']
51 let detail : string = '1' 45 let detail : string = '1'
52 let url = HttpUrlUtils.getLikeCount() + `?channelId=${channelId}&contentId=${contentId}&contentType=${contentType}&detail=${detail}` 46 let url = HttpUrlUtils.getLikeCount() + `?channelId=${channelId}&contentId=${contentId}&contentType=${contentType}&detail=${detail}`
53 return new Promise<object>((success, fail) => { 47 return new Promise<object>((success, fail) => {
54 - HttpBizUtil.get<ResponseDTO<object>>(url, headers).then((data: ResponseDTO<object>) => { 48 + HttpBizUtil.get<ResponseDTO<object>>(url).then((data: ResponseDTO<object>) => {
55 if (data.code != 0) { 49 if (data.code != 0) {
56 fail(data.message) 50 fail(data.message)
57 return 51 return
1 -import HashMap from '@ohos.util.HashMap';  
2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork';
3 2
4 export class LogoutModel{ 3 export class LogoutModel{
@@ -6,9 +5,8 @@ export class LogoutModel{ @@ -6,9 +5,8 @@ export class LogoutModel{
6 requestLogout(){ 5 requestLogout(){
7 let bean: Record<string, string> = {}; 6 let bean: Record<string, string> = {};
8 bean['refreshToken'] = HttpUrlUtils.getRefreshToken() 7 bean['refreshToken'] = HttpUrlUtils.getRefreshToken()
9 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
10 return new Promise<string>((success, fail) => { 8 return new Promise<string>((success, fail) => {
11 - HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => { 9 + HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean).then((data: ResponseDTO<string>) => {
12 if (!data) { 10 if (!data) {
13 fail("数据为空") 11 fail("数据为空")
14 return 12 return
@@ -2,10 +2,9 @@ @@ -2,10 +2,9 @@
2 import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem' 2 import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem'
3 import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' 3 import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem'
4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; 4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
5 -import HashMap from '@ohos.util.HashMap';  
6 import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 5 import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
7 import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; 6 import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
8 -import { Logger, ResourcesUtils, StringUtils } from 'wdKit'; 7 +import { Logger, StringUtils } from 'wdKit';
9 import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; 8 import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
10 import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; 9 import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem';
11 import { FollowListItem } from '../viewmodel/FollowListItem'; 10 import { FollowListItem } from '../viewmodel/FollowListItem';
@@ -109,8 +108,7 @@ class MinePageDatasModel{ @@ -109,8 +108,7 @@ class MinePageDatasModel{
109 */ 108 */
110 fetchAppointmentListData(pageSize:string,pageNum:string) { 109 fetchAppointmentListData(pageSize:string,pageNum:string) {
111 let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}` 110 let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}`
112 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
113 - return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers) 111 + return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url)
114 }; 112 };
115 113
116 getAppointmentListData(pageSize:string,pageNum:string,context: Context): Promise<MineAppointmentListItem> { 114 getAppointmentListData(pageSize:string,pageNum:string,context: Context): Promise<MineAppointmentListItem> {
@@ -158,8 +156,7 @@ class MinePageDatasModel{ @@ -158,8 +156,7 @@ class MinePageDatasModel{
158 156
159 fetchFollowListDetailData(object:FollowListDetailRequestItem) { 157 fetchFollowListDetailData(object:FollowListDetailRequestItem) {
160 let url = HttpUrlUtils.getFollowListDetailDataUrl() 158 let url = HttpUrlUtils.getFollowListDetailDataUrl()
161 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
162 - return WDHttp.post<ResponseDTO<MineFollowListDetailItem>>(url, object,headers) 159 + return WDHttp.post<ResponseDTO<MineFollowListDetailItem>>(url, object)
163 }; 160 };
164 161
165 /** 162 /**
@@ -168,8 +165,7 @@ class MinePageDatasModel{ @@ -168,8 +165,7 @@ class MinePageDatasModel{
168 */ 165 */
169 fetchFollowListData() { 166 fetchFollowListData() {
170 let url = HttpUrlUtils.getFollowListDataUrl() 167 let url = HttpUrlUtils.getFollowListDataUrl()
171 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
172 - return WDHttp.get<ResponseDTO<FollowListItem[]>>(url, headers) 168 + return WDHttp.get<ResponseDTO<FollowListItem[]>>(url)
173 }; 169 };
174 170
175 getFollowListData(context: Context): Promise<FollowListItem[]> { 171 getFollowListData(context: Context): Promise<FollowListItem[]> {
@@ -217,8 +213,7 @@ class MinePageDatasModel{ @@ -217,8 +213,7 @@ class MinePageDatasModel{
217 213
218 fetchMineDetailFollowListData(object:FollowListDetailRequestItem) { 214 fetchMineDetailFollowListData(object:FollowListDetailRequestItem) {
219 let url = HttpUrlUtils.getMineFollowListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}` 215 let url = HttpUrlUtils.getMineFollowListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}`
220 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
221 - return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers) 216 + return WDHttp.get<ResponseDTO<MineFollowListItem>>(url)
222 }; 217 };
223 218
224 /** 219 /**
@@ -247,8 +242,7 @@ class MinePageDatasModel{ @@ -247,8 +242,7 @@ class MinePageDatasModel{
247 242
248 fetchFollowListStatusData(object:FollowListStatusRequestItem) { 243 fetchFollowListStatusData(object:FollowListStatusRequestItem) {
249 let url = HttpUrlUtils.getFollowListStatusDataUrl() 244 let url = HttpUrlUtils.getFollowListStatusDataUrl()
250 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
251 - return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object, headers) 245 + return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object)
252 }; 246 };
253 247
254 /** 248 /**
@@ -277,8 +271,7 @@ class MinePageDatasModel{ @@ -277,8 +271,7 @@ class MinePageDatasModel{
277 271
278 fetchMineCommentListData(time:string,object:FollowListDetailRequestItem) { 272 fetchMineCommentListData(time:string,object:FollowListDetailRequestItem) {
279 let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&time=${time}` 273 let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&time=${time}`
280 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
281 - return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) 274 + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url)
282 }; 275 };
283 276
284 277
@@ -305,9 +298,8 @@ class MinePageDatasModel{ @@ -305,9 +298,8 @@ class MinePageDatasModel{
305 298
306 fetchMineUserLevelData() { 299 fetchMineUserLevelData() {
307 let url = HttpUrlUtils.getMineUserLevelDataUrl() 300 let url = HttpUrlUtils.getMineUserLevelDataUrl()
308 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
309 // return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers) 301 // return WDHttp.get<ResponseDTO<MineUserLevelItem>>(url, headers)
310 - return HttpBizUtil.get<ResponseDTO<MineUserLevelItem>>(url, headers) 302 + return HttpBizUtil.get<ResponseDTO<MineUserLevelItem>>(url)
311 }; 303 };
312 304
313 /** 305 /**
@@ -333,9 +325,8 @@ class MinePageDatasModel{ @@ -333,9 +325,8 @@ class MinePageDatasModel{
333 325
334 fetchMineUserDetailData() { 326 fetchMineUserDetailData() {
335 let url = HttpUrlUtils.getMineUserDetailDataUrl() 327 let url = HttpUrlUtils.getMineUserDetailDataUrl()
336 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
337 // return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers) 328 // return WDHttp.get<ResponseDTO<MineUserDetailItem>>(url, headers)
338 - return HttpBizUtil.get<ResponseDTO<MineUserDetailItem>>(url, headers) 329 + return HttpBizUtil.get<ResponseDTO<MineUserDetailItem>>(url)
339 }; 330 };
340 331
341 332
@@ -362,8 +353,7 @@ class MinePageDatasModel{ @@ -362,8 +353,7 @@ class MinePageDatasModel{
362 353
363 fetchOtherUserDetailData(item:OtherUserDetailRequestItem) { 354 fetchOtherUserDetailData(item:OtherUserDetailRequestItem) {
364 let url = HttpUrlUtils.getOtherUserDetailDataUrl() 355 let url = HttpUrlUtils.getOtherUserDetailDataUrl()
365 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
366 - return WDHttp.post<ResponseDTO<MineUserDetailItem>>(url, item,headers) 356 + return WDHttp.post<ResponseDTO<MineUserDetailItem>>(url, item)
367 }; 357 };
368 358
369 /** 359 /**
@@ -393,8 +383,7 @@ class MinePageDatasModel{ @@ -393,8 +383,7 @@ class MinePageDatasModel{
393 383
394 fetchOtherUserLevelData(item:string[]) { 384 fetchOtherUserLevelData(item:string[]) {
395 let url = HttpUrlUtils.getOtherUserLevelDataUrl() 385 let url = HttpUrlUtils.getOtherUserLevelDataUrl()
396 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
397 - return WDHttp.post<ResponseDTO<MineUserLevelItem[]>>(url,item, headers) 386 + return WDHttp.post<ResponseDTO<MineUserLevelItem[]>>(url,item)
398 }; 387 };
399 388
400 /** 389 /**
@@ -423,8 +412,7 @@ class MinePageDatasModel{ @@ -423,8 +412,7 @@ class MinePageDatasModel{
423 412
424 fetchOtherCommentListData(object:OtherUserCommentListRequestItem) { 413 fetchOtherCommentListData(object:OtherUserCommentListRequestItem) {
425 let url = HttpUrlUtils.getOtherCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&creatorId=${object.creatorId}&time=${object.time}&userType=${object.userType}&userId=${object.userId}` 414 let url = HttpUrlUtils.getOtherCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&creatorId=${object.creatorId}&time=${object.time}&userType=${object.userType}&userId=${object.userId}`
426 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
427 - return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) 415 + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url)
428 }; 416 };
429 417
430 418
@@ -454,8 +442,7 @@ class MinePageDatasModel{ @@ -454,8 +442,7 @@ class MinePageDatasModel{
454 442
455 fetchOtherUserCommentLikeStatusData(object:OtherUserCommentLikeStatusRequestItem) { 443 fetchOtherUserCommentLikeStatusData(object:OtherUserCommentLikeStatusRequestItem) {
456 let url = HttpUrlUtils.getCommentListStatusDataUrl() 444 let url = HttpUrlUtils.getCommentListStatusDataUrl()
457 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
458 - return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers) 445 + return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object)
459 }; 446 };
460 447
461 /** 448 /**
@@ -484,8 +471,7 @@ class MinePageDatasModel{ @@ -484,8 +471,7 @@ class MinePageDatasModel{
484 471
485 fetchOtherUserFollowListData(object:UserFollowListRequestItem) { 472 fetchOtherUserFollowListData(object:UserFollowListRequestItem) {
486 let url = HttpUrlUtils.getOtherUserFollowListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&queryUserId=${object.queryUserId}&userType=${object.userType}&userId=${HttpUrlUtils.getUserId()}` 473 let url = HttpUrlUtils.getOtherUserFollowListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&queryUserId=${object.queryUserId}&userType=${object.userType}&userId=${HttpUrlUtils.getUserId()}`
487 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
488 - return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers) 474 + return WDHttp.get<ResponseDTO<MineFollowListItem>>(url)
489 }; 475 };
490 476
491 /** 477 /**
@@ -513,8 +499,7 @@ class MinePageDatasModel{ @@ -513,8 +499,7 @@ class MinePageDatasModel{
513 499
514 fetchAppointmentOperation(object:AppointmentOperationRequestItem) { 500 fetchAppointmentOperation(object:AppointmentOperationRequestItem) {
515 let url = HttpUrlUtils.getAppointmentOperationUrl() 501 let url = HttpUrlUtils.getAppointmentOperationUrl()
516 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
517 - return WDHttp.post<ResponseDTO>(url,object, headers) 502 + return WDHttp.post<ResponseDTO>(url,object)
518 }; 503 };
519 504
520 /** 505 /**
@@ -542,8 +527,7 @@ class MinePageDatasModel{ @@ -542,8 +527,7 @@ class MinePageDatasModel{
542 527
543 fetchCommentLikeOperation(object:CommentLikeOperationRequestItem) { 528 fetchCommentLikeOperation(object:CommentLikeOperationRequestItem) {
544 let url = HttpUrlUtils.getCommentLikeOperationUrl() 529 let url = HttpUrlUtils.getCommentLikeOperationUrl()
545 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
546 - return WDHttp.post<ResponseDTO>(url,object, headers) 530 + return WDHttp.post<ResponseDTO>(url,object)
547 }; 531 };
548 532
549 /** 533 /**
@@ -571,8 +555,7 @@ class MinePageDatasModel{ @@ -571,8 +555,7 @@ class MinePageDatasModel{
571 555
572 fetchFollowOperation(object:FollowOperationRequestItem) { 556 fetchFollowOperation(object:FollowOperationRequestItem) {
573 let url = HttpUrlUtils.getFollowOperationUrl() 557 let url = HttpUrlUtils.getFollowOperationUrl()
574 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
575 - return WDHttp.post<ResponseDTO>(url,object, headers) 558 + return WDHttp.post<ResponseDTO>(url,object)
576 }; 559 };
577 560
578 561
1 -import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';  
2 -import HashMap from '@ohos.util.HashMap'; 1 +import { Permissions } from '@ohos.abilityAccessCtrl';
3 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
4 import { Logger } from 'wdKit'; 3 import { Logger } from 'wdKit';
5 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
6 -import EditInfoViewModel from '../viewmodel/EditInfoViewModel';  
7 import { editModel } from './EditInfoModel'; 5 import { editModel } from './EditInfoModel';
8 6
9 7
@@ -25,9 +23,8 @@ export class PrivacySettingModel{ @@ -25,9 +23,8 @@ export class PrivacySettingModel{
25 // EditInfoViewModel 23 // EditInfoViewModel
26 24
27 let bean: Record<string, string> = {}; 25 let bean: Record<string, string> = {};
28 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
29 return new Promise<editModel>((success, fail) => { 26 return new Promise<editModel>((success, fail) => {
30 - HttpRequest.get<ResponseDTO<editModel>>(HttpUrlUtils.queryUserDetail(), headers).then((data: ResponseDTO<editModel>) => { 27 + HttpRequest.get<ResponseDTO<editModel>>(HttpUrlUtils.queryUserDetail()).then((data: ResponseDTO<editModel>) => {
31 if (!data || !data.data) { 28 if (!data || !data.data) {
32 fail("数据为空") 29 fail("数据为空")
33 return 30 return
@@ -50,9 +47,8 @@ export class PrivacySettingModel{ @@ -50,9 +47,8 @@ export class PrivacySettingModel{
50 editUserDetail(airec:string) { 47 editUserDetail(airec:string) {
51 let bean: Record<string, string> = {}; 48 let bean: Record<string, string> = {};
52 bean['airec'] = airec; 49 bean['airec'] = airec;
53 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
54 return new Promise<string>((success, fail) => { 50 return new Promise<string>((success, fail) => {
55 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.editUserDetail(), bean, headers).then((data: ResponseDTO<string>) => { 51 + HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.editUserDetail(), bean).then((data: ResponseDTO<string>) => {
56 if (!data || !data.data) { 52 if (!data || !data.data) {
57 fail("数据为空") 53 fail("数据为空")
58 return 54 return
1 1
2 -import { Logger, ResourcesUtils, SPHelper, UserDataLocal } from 'wdKit'; 2 +import { Logger, SPHelper, UserDataLocal } from 'wdKit';
3 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 3 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
4 -import HashMap from '@ohos.util.HashMap';  
5 import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; 4 import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem';
6 import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; 5 import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem';
7 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem'; 6 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem';
@@ -115,8 +114,7 @@ class SearcherAboutDataModel{ @@ -115,8 +114,7 @@ class SearcherAboutDataModel{
115 114
116 fetchSearchHintData() { 115 fetchSearchHintData() {
117 let url = HttpUrlUtils.getSearchHintDataUrl() 116 let url = HttpUrlUtils.getSearchHintDataUrl()
118 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
119 - return WDHttp.get<ResponseDTO<string[]>>(url, headers) 117 + return WDHttp.get<ResponseDTO<string[]>>(url)
120 }; 118 };
121 119
122 120
@@ -143,8 +141,7 @@ class SearcherAboutDataModel{ @@ -143,8 +141,7 @@ class SearcherAboutDataModel{
143 141
144 fetchSearchHotsData() { 142 fetchSearchHotsData() {
145 let url = HttpUrlUtils.getSearchHotsDataUrl() 143 let url = HttpUrlUtils.getSearchHotsDataUrl()
146 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
147 - return WDHttp.get<ResponseDTO<SearchHotContentItem[]>>(url, headers) 144 + return WDHttp.get<ResponseDTO<SearchHotContentItem[]>>(url)
148 }; 145 };
149 146
150 /** 147 /**
@@ -170,8 +167,7 @@ class SearcherAboutDataModel{ @@ -170,8 +167,7 @@ class SearcherAboutDataModel{
170 167
171 fetchRelatedSearchContentData(keyword:string) { 168 fetchRelatedSearchContentData(keyword:string) {
172 let url = HttpUrlUtils.getRelatedSearchContentDataUrl()+ keyword 169 let url = HttpUrlUtils.getRelatedSearchContentDataUrl()+ keyword
173 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
174 - return WDHttp.get<ResponseDTO<string[]>>(url, headers) 170 + return WDHttp.get<ResponseDTO<string[]>>(url)
175 }; 171 };
176 172
177 /** 173 /**
@@ -197,8 +193,7 @@ class SearcherAboutDataModel{ @@ -197,8 +193,7 @@ class SearcherAboutDataModel{
197 193
198 fetchSearchResultCountData(keyword:string) { 194 fetchSearchResultCountData(keyword:string) {
199 let url = HttpUrlUtils.getSearchResultCountDataUrl() + keyword 195 let url = HttpUrlUtils.getSearchResultCountDataUrl() + keyword
200 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
201 - return WDHttp.get<ResponseDTO<SearchResultCountItem>>(url, headers) 196 + return WDHttp.get<ResponseDTO<SearchResultCountItem>>(url)
202 }; 197 };
203 198
204 /** 199 /**
@@ -224,8 +219,7 @@ class SearcherAboutDataModel{ @@ -224,8 +219,7 @@ class SearcherAboutDataModel{
224 219
225 fetchSearchResultListData(pageSize:string,pageNum:string,searchType:string,keyword:string) { 220 fetchSearchResultListData(pageSize:string,pageNum:string,searchType:string,keyword:string) {
226 let url = HttpUrlUtils.getSearchResultListDataUrl() + `?pageSize=${pageSize}&pageNum=${pageNum}&searchType=${searchType}&keyword=${keyword}` 221 let url = HttpUrlUtils.getSearchResultListDataUrl() + `?pageSize=${pageSize}&pageNum=${pageNum}&searchType=${searchType}&keyword=${keyword}`
227 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
228 - return WDHttp.get<ResponseDTO<SearchResultContentData>>(url, headers) 222 + return WDHttp.get<ResponseDTO<SearchResultContentData>>(url)
229 }; 223 };
230 224
231 /** 225 /**
@@ -251,8 +245,7 @@ class SearcherAboutDataModel{ @@ -251,8 +245,7 @@ class SearcherAboutDataModel{
251 245
252 fetchInteractListData(data : contentListParams) { 246 fetchInteractListData(data : contentListParams) {
253 let url = HttpUrlUtils.getInteractListDataUrl() 247 let url = HttpUrlUtils.getInteractListDataUrl()
254 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
255 - return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url,data, headers) 248 + return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url,data)
256 }; 249 };
257 250
258 /** 251 /**
@@ -278,8 +271,7 @@ class SearcherAboutDataModel{ @@ -278,8 +271,7 @@ class SearcherAboutDataModel{
278 271
279 fetchCreatorDetailListData(object:CreatorDetailRequestItem) { 272 fetchCreatorDetailListData(object:CreatorDetailRequestItem) {
280 let url = HttpUrlUtils.getCreatorDetailListDataUrl() 273 let url = HttpUrlUtils.getCreatorDetailListDataUrl()
281 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
282 - return WDHttp.post<ResponseDTO<CreatorDetailResponseItem[]>>(url,object, headers) 274 + return WDHttp.post<ResponseDTO<CreatorDetailResponseItem[]>>(url,object)
283 }; 275 };
284 276
285 /** 277 /**
@@ -305,8 +297,7 @@ class SearcherAboutDataModel{ @@ -305,8 +297,7 @@ class SearcherAboutDataModel{
305 297
306 fetchSearchSuggestData(object:SearchSuggestRequestItem) { 298 fetchSearchSuggestData(object:SearchSuggestRequestItem) {
307 let url = HttpUrlUtils.getSearchSuggestDataUrl() 299 let url = HttpUrlUtils.getSearchSuggestDataUrl()
308 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
309 - return WDHttp.post<ResponseDTO<ContentDTO[]>>(url,object, headers) 300 + return WDHttp.post<ResponseDTO<ContentDTO[]>>(url,object)
310 }; 301 };
311 302
312 } 303 }
1 -import HashMap from '@ohos.util.HashMap';  
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 1 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { DateTimeUtils, Logger, StringUtils } from 'wdKit'; 2 import { DateTimeUtils, Logger, StringUtils } from 'wdKit';
4 import { 3 import {
@@ -209,8 +208,7 @@ export class PageRepository { @@ -209,8 +208,7 @@ export class PageRepository {
209 208
210 static fetchNavigationDataApi() { 209 static fetchNavigationDataApi() {
211 let url = PageRepository.getBottomNavGroupUrl(); 210 let url = PageRepository.getBottomNavGroupUrl();
212 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
213 - return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url, headers) 211 + return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url)
214 }; 212 };
215 213
216 /** 214 /**
@@ -224,57 +222,48 @@ export class PageRepository { @@ -224,57 +222,48 @@ export class PageRepository {
224 */ 222 */
225 static fetchMorningEveningPaperData(pageId: string) { 223 static fetchMorningEveningPaperData(pageId: string) {
226 let url = PageRepository.getPageInfoUrl(pageId) 224 let url = PageRepository.getPageInfoUrl(pageId)
227 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
228 - return WDHttp.get<ResponseDTO<MorningEveningPaperDTO>>(url, headers) 225 + return WDHttp.get<ResponseDTO<MorningEveningPaperDTO>>(url)
229 }; 226 };
230 227
231 static fetchPageUrlData(pageId: string) { 228 static fetchPageUrlData(pageId: string) {
232 let url = PageRepository.getPageUrl(pageId) 229 let url = PageRepository.getPageUrl(pageId)
233 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
234 - return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers) 230 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
235 } 231 }
236 232
237 static fetchPageData(pageId: string) { 233 static fetchPageData(pageId: string) {
238 let url = PageRepository.getPageInfoUrl(pageId) 234 let url = PageRepository.getPageInfoUrl(pageId)
239 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
240 - return WDHttp.get<ResponseDTO<PageInfoDTO>>(url, headers) 235 + return WDHttp.get<ResponseDTO<PageInfoDTO>>(url)
241 }; 236 };
242 237
243 static fetchCompData(pageBean: PageUIReqBean) { 238 static fetchCompData(pageBean: PageUIReqBean) {
244 let url = PageRepository.getCompInfoUrl(pageBean) 239 let url = PageRepository.getCompInfoUrl(pageBean)
245 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
246 - return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) 240 + return WDHttp.get<ResponseDTO<PageDTO>>(url)
247 }; 241 };
248 242
249 static fetchRecCompData(pageBean: PageUIReqBean) { 243 static fetchRecCompData(pageBean: PageUIReqBean) {
250 let url = PageRepository.getRecCompInfoUrl(pageBean) 244 let url = PageRepository.getRecCompInfoUrl(pageBean)
251 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
252 - return WDHttp.get<ResponseDTO<PageDTO>>(url, headers) 245 + return WDHttp.get<ResponseDTO<PageDTO>>(url)
253 }; 246 };
254 247
255 static fetchDetailData(relId: string, contentId: string, relType: string) { 248 static fetchDetailData(relId: string, contentId: string, relType: string) {
256 let url = PageRepository.getDetailInfoUrl(relId, contentId, relType) 249 let url = PageRepository.getDetailInfoUrl(relId, contentId, relType)
257 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
258 - return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url, headers) 250 + return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url)
259 }; 251 };
260 252
261 static fetchInteractDataV2(contentId: string, contentType: string, contentRelId: string,rmhPlatform:number) { 253 static fetchInteractDataV2(contentId: string, contentType: string, contentRelId: string,rmhPlatform:number) {
262 let url = PageRepository.getInteractDataV2Url(contentId, contentType, contentRelId,rmhPlatform) 254 let url = PageRepository.getInteractDataV2Url(contentId, contentType, contentRelId,rmhPlatform)
263 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
264 - return WDHttp.get<ResponseDTO<InteractDataDTO>>(url, headers) 255 + return WDHttp.get<ResponseDTO<InteractDataDTO>>(url)
265 }; 256 };
266 257
267 static fetchInteractData(param: object) { 258 static fetchInteractData(param: object) {
268 let url = PageRepository.getInteractDataUrl() 259 let url = PageRepository.getInteractDataUrl()
269 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
270 - return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) 260 + return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param)
271 }; 261 };
272 262
273 // 批量查询内容当前用户点赞、收藏状态 263 // 批量查询内容当前用户点赞、收藏状态
274 static fetchInteractDataStatus(param: object) { 264 static fetchInteractDataStatus(param: object) {
275 let url = PageRepository.getInteractDataStatusUrl() 265 let url = PageRepository.getInteractDataStatusUrl()
276 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
277 - return WDHttp.post<ResponseDTO<batchLikeAndCollectResult[]>>(url, param, headers) 266 + return WDHttp.post<ResponseDTO<batchLikeAndCollectResult[]>>(url, param)
278 }; 267 };
279 268
280 /** 269 /**
@@ -284,8 +273,7 @@ export class PageRepository { @@ -284,8 +273,7 @@ export class PageRepository {
284 */ 273 */
285 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { 274 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
286 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE 275 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
287 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
288 - return WDHttp.post(url, params, headers) 276 + return WDHttp.post(url, params)
289 } 277 }
290 278
291 /** 279 /**
@@ -295,8 +283,7 @@ export class PageRepository { @@ -295,8 +283,7 @@ export class PageRepository {
295 */ 283 */
296 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { 284 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
297 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD 285 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
298 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
299 - return WDHttp.post(url, params, headers) 286 + return WDHttp.post(url, params)
300 } 287 }
301 288
302 /** 289 /**
@@ -305,15 +292,13 @@ export class PageRepository { @@ -305,15 +292,13 @@ export class PageRepository {
305 */ 292 */
306 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { 293 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
307 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH 294 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
308 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
309 - return WDHttp.post(url, params, headers) 295 + return WDHttp.post(url, params)
310 } 296 }
311 297
312 // 浏览历史新增、删除接口 298 // 浏览历史新增、删除接口
313 static fetchInteractBrowsOperate(param: object) { 299 static fetchInteractBrowsOperate(param: object) {
314 let url = PageRepository.getInteractBrowsOperateUrl() 300 let url = PageRepository.getInteractBrowsOperateUrl()
315 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
316 - return WDHttp.post<ResponseDTO<null>>(url, param, headers) 301 + return WDHttp.post<ResponseDTO<null>>(url, param)
317 }; 302 };
318 303
319 /** 304 /**
@@ -322,8 +307,7 @@ export class PageRepository { @@ -322,8 +307,7 @@ export class PageRepository {
322 */ 307 */
323 static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { 308 static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
324 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 309 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
325 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
326 - return WDHttp.post(url, params, headers) 310 + return WDHttp.post(url, params)
327 } 311 }
328 312
329 /** 313 /**
@@ -331,20 +315,17 @@ export class PageRepository { @@ -331,20 +315,17 @@ export class PageRepository {
331 */ 315 */
332 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { 316 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
333 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION 317 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
334 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
335 - return WDHttp.post(url, params, headers) 318 + return WDHttp.post(url, params)
336 } 319 }
337 320
338 static fetchNewspaperInfo(date: string) { 321 static fetchNewspaperInfo(date: string) {
339 let url = PageRepository.getNewspaperInfoUrl(date) 322 let url = PageRepository.getNewspaperInfoUrl(date)
340 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
341 - return WDHttp.get<ResponseDTO<NewspaperTimeInfoBean[]>>(url, headers) 323 + return WDHttp.get<ResponseDTO<NewspaperTimeInfoBean[]>>(url)
342 }; 324 };
343 325
344 static fetchNewspaperList(date: string, pageSize: string) { 326 static fetchNewspaperList(date: string, pageSize: string) {
345 let url = PageRepository.getNewspaperListUrl(date, pageSize) 327 let url = PageRepository.getNewspaperListUrl(date, pageSize)
346 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
347 - return WDHttp.get<ResponseDTO<NewspaperListBean>>(url, headers) 328 + return WDHttp.get<ResponseDTO<NewspaperListBean>>(url)
348 }; 329 };
349 330
350 /** 331 /**
@@ -352,8 +333,7 @@ export class PageRepository { @@ -352,8 +333,7 @@ export class PageRepository {
352 * */ 333 * */
353 static fetchMorningEveningPageInfo(pageId: string) { 334 static fetchMorningEveningPageInfo(pageId: string) {
354 let url = PageRepository.getMorningEveningPageInfoUrl(pageId) 335 let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
355 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
356 - return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers) 336 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
357 }; 337 };
358 338
359 /** 339 /**
@@ -361,8 +341,7 @@ export class PageRepository { @@ -361,8 +341,7 @@ export class PageRepository {
361 * */ 341 * */
362 static fetchMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { 342 static fetchMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
363 let url = PageRepository.getMorningEveningCompInfoUrl(pageId, groupId, refreshTime, topicId, pageNum, pageSize) 343 let url = PageRepository.getMorningEveningCompInfoUrl(pageId, groupId, refreshTime, topicId, pageNum, pageSize)
364 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
365 - return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) 344 + return WDHttp.get<ResponseDTO<CompInfoBean>>(url)
366 }; 345 };
367 346
368 /** 347 /**
@@ -370,8 +349,7 @@ export class PageRepository { @@ -370,8 +349,7 @@ export class PageRepository {
370 * */ 349 * */
371 static fetchDailyPaperTopic() { 350 static fetchDailyPaperTopic() {
372 let url = PageRepository.getDailyPaperTopic() 351 let url = PageRepository.getDailyPaperTopic()
373 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
374 - return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers) 352 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
375 }; 353 };
376 354
377 /** 355 /**
@@ -379,8 +357,7 @@ export class PageRepository { @@ -379,8 +357,7 @@ export class PageRepository {
379 * */ 357 * */
380 static fetchBroadcastPageInfo(pageId: string) { 358 static fetchBroadcastPageInfo(pageId: string) {
381 let url = PageRepository.getMorningEveningPageInfoUrl(pageId) 359 let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
382 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
383 - return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers) 360 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
384 }; 361 };
385 362
386 /** 363 /**
@@ -394,8 +371,7 @@ export class PageRepository { @@ -394,8 +371,7 @@ export class PageRepository {
394 let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; 371 let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
395 url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}` 372 url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
396 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url) 373 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
397 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
398 - return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) 374 + return WDHttp.get<ResponseDTO<CompInfoBean>>(url)
399 }; 375 };
400 376
401 /** 377 /**
@@ -403,8 +379,7 @@ export class PageRepository { @@ -403,8 +379,7 @@ export class PageRepository {
403 * */ 379 * */
404 static fetchLiveReviewUrl(pageNum: number, pageSize: number) { 380 static fetchLiveReviewUrl(pageNum: number, pageSize: number) {
405 let url = PageRepository.getLiveReviewUrl(pageNum, pageSize) 381 let url = PageRepository.getLiveReviewUrl(pageNum, pageSize)
406 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
407 - return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url, headers) 382 + return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url)
408 }; 383 };
409 384
410 /** 385 /**
@@ -412,8 +387,7 @@ export class PageRepository { @@ -412,8 +387,7 @@ export class PageRepository {
412 * */ 387 * */
413 static fetchLiveMoreUrl(type: number,pageNum: number, pageSize: number) { 388 static fetchLiveMoreUrl(type: number,pageNum: number, pageSize: number) {
414 let url = PageRepository.getLiveMoreUrl(type,pageNum, pageSize) 389 let url = PageRepository.getLiveMoreUrl(type,pageNum, pageSize)
415 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
416 - return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url, headers) 390 + return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url)
417 }; 391 };
418 392
419 /** 393 /**
@@ -424,9 +398,8 @@ export class PageRepository { @@ -424,9 +398,8 @@ export class PageRepository {
424 * */ 398 * */
425 static postRecommendList(params: postRecommendListParams) { 399 static postRecommendList(params: postRecommendListParams) {
426 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_LIST 400 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_LIST
427 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
428 Logger.info(TAG, "postRecommendList url = " + url + JSON.stringify(params)) 401 Logger.info(TAG, "postRecommendList url = " + url + JSON.stringify(params))
429 - return WDHttp.post<ResponseDTO<ContentDTO[]>>(url, params, headers) 402 + return WDHttp.post<ResponseDTO<ContentDTO[]>>(url, params)
430 }; 403 };
431 404
432 static getPageUrl(pageId: string) { 405 static getPageUrl(pageId: string) {
@@ -443,8 +416,7 @@ export class PageRepository { @@ -443,8 +416,7 @@ export class PageRepository {
443 * */ 416 * */
444 static postThemeList(params: postThemeListParams) { 417 static postThemeList(params: postThemeListParams) {
445 let url = HttpUrlUtils.getThemeListUrl() 418 let url = HttpUrlUtils.getThemeListUrl()
446 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
447 Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params)) 419 Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params))
448 - return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params, headers) 420 + return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params)
449 }; 421 };
450 } 422 }
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 import { 2 import {
3 editItem, 3 editItem,
4 EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../model/EditInfoModel'; 4 EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../model/EditInfoModel';
5 -import HashMap from '@ohos.util.HashMap';  
6 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 5 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
7 import { Logger, ResourcesUtils } from 'wdKit'; 6 import { Logger, ResourcesUtils } from 'wdKit';
8 import { AreaListManageModel, AreaListModel } from '../model/AreaListModel'; 7 import { AreaListManageModel, AreaListModel } from '../model/AreaListModel';
@@ -26,15 +25,13 @@ class EditInfoViewModel { @@ -26,15 +25,13 @@ class EditInfoViewModel {
26 } 25 }
27 26
28 BaseGetRequest(requestUrl:string){ 27 BaseGetRequest(requestUrl:string){
29 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()  
30 requestUrl = HttpUrlUtils.getHost() + requestUrl 28 requestUrl = HttpUrlUtils.getHost() + requestUrl
31 - return WDHttp.get<editItem>(requestUrl,headers) 29 + return WDHttp.get<editItem>(requestUrl)
32 } 30 }
33 31
34 BasePostRequest(requestUrl:string,params: object){ 32 BasePostRequest(requestUrl:string,params: object){
35 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()  
36 requestUrl = HttpUrlUtils.getHost() + requestUrl 33 requestUrl = HttpUrlUtils.getHost() + requestUrl
37 - return WDHttp.post<ResponseDTO>(requestUrl,params,headers) 34 + return WDHttp.post<ResponseDTO>(requestUrl,params)
38 } 35 }
39 36
40 37
1 -import HashMap from '@ohos.util.HashMap';  
2 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
3 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
4 import { Logger, ToastUtils } from 'wdKit'; 3 import { Logger, ToastUtils } from 'wdKit';
@@ -15,11 +14,10 @@ export class LiveModel { @@ -15,11 +14,10 @@ export class LiveModel {
15 * @returns 14 * @returns
16 */ 15 */
17 static getLiveDetails(contentId: string, relId: string, relType: string) { 16 static getLiveDetails(contentId: string, relId: string, relType: string) {
18 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
19 return new Promise<Array<LiveDetailsBean>>((success, fail) => { 17 return new Promise<Array<LiveDetailsBean>>((success, fail) => {
20 HttpRequest.get<ResponseDTO<Array<LiveDetailsBean>>>( 18 HttpRequest.get<ResponseDTO<Array<LiveDetailsBean>>>(
21 HttpUrlUtils.getLiveDetailsUrl() + `?relId=${relId}&relType=${relType}&contentId=${contentId}`, 19 HttpUrlUtils.getLiveDetailsUrl() + `?relId=${relId}&relType=${relType}&contentId=${contentId}`,
22 - headers).then((data: ResponseDTO<Array<LiveDetailsBean>>) => { 20 + ).then((data: ResponseDTO<Array<LiveDetailsBean>>) => {
23 if (!data || !data.data) { 21 if (!data || !data.data) {
24 fail("数据为空") 22 fail("数据为空")
25 return 23 return
@@ -48,12 +46,11 @@ export class LiveModel { @@ -48,12 +46,11 @@ export class LiveModel {
48 params['relationId'] = relationId 46 params['relationId'] = relationId
49 params['liveId'] = liveId 47 params['liveId'] = liveId
50 params['isSubscribe'] = `${isSubscribe}` 48 params['isSubscribe'] = `${isSubscribe}`
51 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
52 return new Promise<ResponseDTO<string>>((success, fail) => { 49 return new Promise<ResponseDTO<string>>((success, fail) => {
53 HttpRequest.post<ResponseDTO<string>>( 50 HttpRequest.post<ResponseDTO<string>>(
54 HttpUrlUtils.getLiveAppointmentUrl(), 51 HttpUrlUtils.getLiveAppointmentUrl(),
55 params, 52 params,
56 - headers).then((data: ResponseDTO<string>) => { 53 + ).then((data: ResponseDTO<string>) => {
57 if (data.code != 0) { 54 if (data.code != 0) {
58 fail(data.message) 55 fail(data.message)
59 ToastUtils.shortToast(data.message) 56 ToastUtils.shortToast(data.message)
@@ -77,12 +74,11 @@ export class LiveModel { @@ -77,12 +74,11 @@ export class LiveModel {
77 static getAppointmentStatus(reserveBean: ReserveBean[]) { 74 static getAppointmentStatus(reserveBean: ReserveBean[]) {
78 // let params: Record<string, ArrayList<ReserveBean>> = {}; 75 // let params: Record<string, ArrayList<ReserveBean>> = {};
79 // params = reserveBean 76 // params = reserveBean
80 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
81 return new Promise<ResponseDTO<string>>((success, fail) => { 77 return new Promise<ResponseDTO<string>>((success, fail) => {
82 HttpRequest.post<ResponseDTO<string>>( 78 HttpRequest.post<ResponseDTO<string>>(
83 HttpUrlUtils.getAppointmentStatusUrl(), 79 HttpUrlUtils.getAppointmentStatusUrl(),
84 reserveBean, 80 reserveBean,
85 - headers).then((data: ResponseDTO<string>) => { 81 + ).then((data: ResponseDTO<string>) => {
86 if (data.code != 0) { 82 if (data.code != 0) {
87 fail(data.message) 83 fail(data.message)
88 ToastUtils.shortToast(data.message) 84 ToastUtils.shortToast(data.message)
1 import { collcetRecordParams, MyCollectionItem, MyCollectionListModel } from '../model/MyCollectionModel'; 1 import { collcetRecordParams, MyCollectionItem, MyCollectionListModel } from '../model/MyCollectionModel';
2 -import HashMap from '@ohos.util.HashMap';  
3 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
4 -import { Logger, ResourcesUtils } from 'wdKit';  
5 -import { PageDTO } from 'wdBean'; 3 +import { Logger } from 'wdKit';
6 import promptAction from '@ohos.promptAction'; 4 import promptAction from '@ohos.promptAction';
7 5
8 const TAG = "MyCollectionViewModel" 6 const TAG = "MyCollectionViewModel"
@@ -27,8 +25,7 @@ class MyCollectionViewModel { @@ -27,8 +25,7 @@ class MyCollectionViewModel {
27 // if (tagId.length > 0) { 25 // if (tagId.length > 0) {
28 // url = url + `&tagId=${tagId}` 26 // url = url + `&tagId=${tagId}`
29 // } 27 // }
30 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()  
31 - return WDHttp.get<MyCollectionListModel>(url, headers) 28 + return WDHttp.get<MyCollectionListModel>(url)
32 } 29 }
33 30
34 31
@@ -50,8 +47,7 @@ class MyCollectionViewModel { @@ -50,8 +47,7 @@ class MyCollectionViewModel {
50 //收藏/取消收藏 status :收藏状态 1添加收藏 0取消收藏 47 //收藏/取消收藏 status :收藏状态 1添加收藏 0取消收藏
51 executeCollcet(params: collcetRecordParams):Promise<ResponseDTO>{ 48 executeCollcet(params: collcetRecordParams):Promise<ResponseDTO>{
52 return new Promise(() => { 49 return new Promise(() => {
53 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()  
54 - WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => { 50 + WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params).then((navResDTO: ResponseDTO) => {
55 if (navResDTO.code == 0) { 51 if (navResDTO.code == 0) {
56 if(params.status === 1){ 52 if(params.status === 1){
57 promptAction.showToast({ message: '收藏成功' }) 53 promptAction.showToast({ message: '收藏成功' })
1 import { OtherUserDetailRequestItem } from './OtherUserDetailRequestItem'; 1 import { OtherUserDetailRequestItem } from './OtherUserDetailRequestItem';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { PeopleShipUserDetailData, ArticleCountData, ArticleListData, InfluenceData } from 'wdBean'; 3 import { PeopleShipUserDetailData, ArticleCountData, ArticleListData, InfluenceData } from 'wdBean';
4 -import HashMap from '@ohos.util.HashMap';  
5 import { Logger } from 'wdKit'; 4 import { Logger } from 'wdKit';
6 import { FollowListStatusRequestItem } from './FollowListStatusRequestItem'; 5 import { FollowListStatusRequestItem } from './FollowListStatusRequestItem';
7 import { QueryListIsFollowedItem } from './QueryListIsFollowedItem'; 6 import { QueryListIsFollowedItem } from './QueryListIsFollowedItem';
@@ -12,8 +11,7 @@ export class PeopleShipHomePageDataModel { @@ -12,8 +11,7 @@ export class PeopleShipHomePageDataModel {
12 /*获取人民号主页详情*/ 11 /*获取人民号主页详情*/
13 static fetchPeopleUserDetailData(item: OtherUserDetailRequestItem) { 12 static fetchPeopleUserDetailData(item: OtherUserDetailRequestItem) {
14 let url = HttpUrlUtils.getOtherUserDetailDataUrl() 13 let url = HttpUrlUtils.getOtherUserDetailDataUrl()
15 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
16 - return WDHttp.post<ResponseDTO<PeopleShipUserDetailData>>(url, item, headers) 14 + return WDHttp.post<ResponseDTO<PeopleShipUserDetailData>>(url, item)
17 } 15 }
18 16
19 static async getPeopleShipHomePageDetailInfo(creatorId: string, userType: string, userId: string): Promise<PeopleShipUserDetailData> { 17 static async getPeopleShipHomePageDetailInfo(creatorId: string, userType: string, userId: string): Promise<PeopleShipUserDetailData> {
@@ -48,8 +46,7 @@ export class PeopleShipHomePageDataModel { @@ -48,8 +46,7 @@ export class PeopleShipHomePageDataModel {
48 let url = HttpUrlUtils.getArticleCountHotsDataUrl() + `?includeLive=${includeLive}&creatorId=${creatorId}` 46 let url = HttpUrlUtils.getArticleCountHotsDataUrl() + `?includeLive=${includeLive}&creatorId=${creatorId}`
49 // let url = 'https://pdapis.pdnews.cn/api/rmrb-content-search/zh/c/article/count' + `?includeLive=${includeLive}&creatorId=${creatorId}` 47 // let url = 'https://pdapis.pdnews.cn/api/rmrb-content-search/zh/c/article/count' + `?includeLive=${includeLive}&creatorId=${creatorId}`
50 Logger.debug(TAG, `${url}`); 48 Logger.debug(TAG, `${url}`);
51 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
52 - return WDHttp.get<ResponseDTO<ArticleCountData>>(url, headers) 49 + return WDHttp.get<ResponseDTO<ArticleCountData>>(url)
53 } 50 }
54 51
55 static async getPeopleShipHomePageArticleCountData(includeLive: number, creatorId: string): Promise<ArticleCountData> { 52 static async getPeopleShipHomePageArticleCountData(includeLive: number, creatorId: string): Promise<ArticleCountData> {
@@ -85,8 +82,7 @@ export class PeopleShipHomePageDataModel { @@ -85,8 +82,7 @@ export class PeopleShipHomePageDataModel {
85 url += `&type=${type}` 82 url += `&type=${type}`
86 } 83 }
87 Logger.debug(TAG, `${url}`); 84 Logger.debug(TAG, `${url}`);
88 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
89 - return WDHttp.get<ResponseDTO<ArticleListData>>(url, headers) 85 + return WDHttp.get<ResponseDTO<ArticleListData>>(url)
90 } 86 }
91 87
92 static async getPeopleShipHomePageArticleListData(creatorId: string, pageNum: number, pageSize: number, type?: number): Promise<ArticleListData> { 88 static async getPeopleShipHomePageArticleListData(creatorId: string, pageNum: number, pageSize: number, type?: number): Promise<ArticleListData> {
@@ -119,8 +115,7 @@ export class PeopleShipHomePageDataModel { @@ -119,8 +115,7 @@ export class PeopleShipHomePageDataModel {
119 static fetchCreatorInfluenceInfoHotsData(creatorId: string) { 115 static fetchCreatorInfluenceInfoHotsData(creatorId: string) {
120 let url = HttpUrlUtils.getCreatorInfluenceInfoHotsDataUrl() + `?creatorId=${creatorId}` 116 let url = HttpUrlUtils.getCreatorInfluenceInfoHotsDataUrl() + `?creatorId=${creatorId}`
121 Logger.debug(TAG, `${url}`); 117 Logger.debug(TAG, `${url}`);
122 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
123 - return WDHttp.get<ResponseDTO<InfluenceData>>(url, headers) 118 + return WDHttp.get<ResponseDTO<InfluenceData>>(url)
124 } 119 }
125 120
126 static async getCreatorInfluenceInfoData(creatorId: string): Promise<InfluenceData> { 121 static async getCreatorInfluenceInfoData(creatorId: string): Promise<InfluenceData> {
@@ -155,8 +150,7 @@ export class PeopleShipHomePageDataModel { @@ -155,8 +150,7 @@ export class PeopleShipHomePageDataModel {
155 let model = new QueryListIsFollowedItem(creatorId) 150 let model = new QueryListIsFollowedItem(creatorId)
156 let object = new FollowListStatusRequestItem() 151 let object = new FollowListStatusRequestItem()
157 object.creatorIds = [model] 152 object.creatorIds = [model]
158 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
159 - return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object, headers) 153 + return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object)
160 }; 154 };
161 155
162 static async getHomePageFollowListStatusData(creatorId: string): Promise<QueryListIsFollowedItem[]> { 156 static async getHomePageFollowListStatusData(creatorId: string): Promise<QueryListIsFollowedItem[]> {
1 import { Logger, ResourcesUtils } from 'wdKit'; 1 import { Logger, ResourcesUtils } from 'wdKit';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; 3 import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
4 -import HashMap from '@ohos.util.HashMap';  
5 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
6 5
7 const TAG = 'ContentDetailRequest'; 6 const TAG = 'ContentDetailRequest';
@@ -208,8 +207,7 @@ export class ContentDetailRequest { @@ -208,8 +207,7 @@ export class ContentDetailRequest {
208 return ContentDetailRequest.getContentDetailDataMock(getContext()); 207 return ContentDetailRequest.getContentDetailDataMock(getContext());
209 } 208 }
210 let url = ContentDetailRequest.getContentDetailUrl(params.contentId, params.relId, params.relType) 209 let url = ContentDetailRequest.getContentDetailUrl(params.contentId, params.relId, params.relType)
211 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
212 - return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url, headers) 210 + return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url)
213 } 211 }
214 212
215 /** 213 /**
@@ -218,8 +216,7 @@ export class ContentDetailRequest { @@ -218,8 +216,7 @@ export class ContentDetailRequest {
218 */ 216 */
219 static getRecCompInfo(params: getRecCompInfoParams): Promise<ResponseDTO<getRecCompInfoResult>> { 217 static getRecCompInfo(params: getRecCompInfoParams): Promise<ResponseDTO<getRecCompInfoResult>> {
220 let url = HttpUrlUtils.getHost() + HttpUrlUtils.DISPLAY_REC_COMPINFO 218 let url = HttpUrlUtils.getHost() + HttpUrlUtils.DISPLAY_REC_COMPINFO
221 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
222 - return WDHttp.request({ url, method: 'GET', params, headers: HttpRequest.buildHeaderWithGlobalHeader(headers) }) 219 + return WDHttp.request({ url, method: 'GET', params, headers: HttpRequest.buildHeaderWithGlobalHeader() })
223 } 220 }
224 221
225 /** 222 /**
@@ -228,12 +225,11 @@ export class ContentDetailRequest { @@ -228,12 +225,11 @@ export class ContentDetailRequest {
228 */ 225 */
229 static batchContentDetail(params: batchContentDetailParams): Promise<ResponseDTO<ContentDetailDTO[]>> { 226 static batchContentDetail(params: batchContentDetailParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
230 let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH 227 let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH
231 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
232 return WDHttp.request({ 228 return WDHttp.request({
233 url, 229 url,
234 method: 'POST', 230 method: 'POST',
235 data: params, 231 data: params,
236 - headers: HttpRequest.buildHeaderWithGlobalHeader(headers) 232 + headers: HttpRequest.buildHeaderWithGlobalHeader()
237 }) 233 })
238 } 234 }
239 235
@@ -244,8 +240,7 @@ export class ContentDetailRequest { @@ -244,8 +240,7 @@ export class ContentDetailRequest {
244 */ 240 */
245 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { 241 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
246 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH 242 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
247 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
248 - return WDHttp.post(url, params, headers) 243 + return WDHttp.post(url, params)
249 } 244 }
250 245
251 /** 246 /**
@@ -254,8 +249,7 @@ export class ContentDetailRequest { @@ -254,8 +249,7 @@ export class ContentDetailRequest {
254 */ 249 */
255 static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> { 250 static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
256 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS 251 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
257 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
258 - return WDHttp.post(url, params, headers) 252 + return WDHttp.post(url, params)
259 } 253 }
260 254
261 /** 255 /**
@@ -264,8 +258,7 @@ export class ContentDetailRequest { @@ -264,8 +258,7 @@ export class ContentDetailRequest {
264 */ 258 */
265 static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { 259 static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
266 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 260 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
267 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
268 - return WDHttp.post(url, params, headers) 261 + return WDHttp.post(url, params)
269 } 262 }
270 263
271 264
@@ -276,8 +269,7 @@ export class ContentDetailRequest { @@ -276,8 +269,7 @@ export class ContentDetailRequest {
276 269
277 static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> { 270 static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
278 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST 271 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
279 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
280 - return WDHttp.post(url, params, headers) 272 + return WDHttp.post(url, params)
281 } 273 }
282 274
283 /** 275 /**
@@ -287,8 +279,7 @@ export class ContentDetailRequest { @@ -287,8 +279,7 @@ export class ContentDetailRequest {
287 */ 279 */
288 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { 280 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
289 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE 281 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
290 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
291 - return WDHttp.post(url, params, headers) 282 + return WDHttp.post(url, params)
292 } 283 }
293 284
294 /** 285 /**
@@ -298,8 +289,7 @@ export class ContentDetailRequest { @@ -298,8 +289,7 @@ export class ContentDetailRequest {
298 */ 289 */
299 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { 290 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
300 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD 291 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
301 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
302 - return WDHttp.post(url, params, headers) 292 + return WDHttp.post(url, params)
303 } 293 }
304 294
305 /** 295 /**
@@ -308,8 +298,7 @@ export class ContentDetailRequest { @@ -308,8 +298,7 @@ export class ContentDetailRequest {
308 */ 298 */
309 static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> { 299 static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
310 let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE 300 let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
311 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
312 - return WDHttp.post(url, params, headers) 301 + return WDHttp.post(url, params)
313 } 302 }
314 303
315 /** 304 /**
@@ -317,8 +306,7 @@ export class ContentDetailRequest { @@ -317,8 +306,7 @@ export class ContentDetailRequest {
317 */ 306 */
318 static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> { 307 static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
319 let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH 308 let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
320 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
321 - return WDHttp.post(url, params, headers) 309 + return WDHttp.post(url, params)
322 } 310 }
323 311
324 312
@@ -327,8 +315,7 @@ export class ContentDetailRequest { @@ -327,8 +315,7 @@ export class ContentDetailRequest {
327 */ 315 */
328 static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> { 316 static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
329 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE 317 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
330 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
331 - return WDHttp.post(url, params, headers) 318 + return WDHttp.post(url, params)
332 } 319 }
333 320
334 /** 321 /**
@@ -336,7 +323,6 @@ export class ContentDetailRequest { @@ -336,7 +323,6 @@ export class ContentDetailRequest {
336 */ 323 */
337 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { 324 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
338 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION 325 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
339 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
340 - return WDHttp.post(url, params, headers) 326 + return WDHttp.post(url, params)
341 } 327 }
342 } 328 }
1 -import HashMap from '@ohos.util.HashMap';  
2 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
3 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
4 import { Logger, ToastUtils } from 'wdKit'; 3 import { Logger, ToastUtils } from 'wdKit';
@@ -15,11 +14,10 @@ export class LiveModel { @@ -15,11 +14,10 @@ export class LiveModel {
15 * @returns 14 * @returns
16 */ 15 */
17 getLiveDetails(contentId: string, relId: string, relType: string) { 16 getLiveDetails(contentId: string, relId: string, relType: string) {
18 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
19 return new Promise<Array<LiveDetailsBean>>((success, fail) => { 17 return new Promise<Array<LiveDetailsBean>>((success, fail) => {
20 HttpRequest.get<ResponseDTO<Array<LiveDetailsBean>>>( 18 HttpRequest.get<ResponseDTO<Array<LiveDetailsBean>>>(
21 HttpUrlUtils.getLiveDetailsUrl() + `?relId=${relId}&relType=${relType}&contentId=${contentId}`, 19 HttpUrlUtils.getLiveDetailsUrl() + `?relId=${relId}&relType=${relType}&contentId=${contentId}`,
22 - headers).then((data: ResponseDTO<Array<LiveDetailsBean>>) => { 20 + ).then((data: ResponseDTO<Array<LiveDetailsBean>>) => {
23 if (!data || !data.data) { 21 if (!data || !data.data) {
24 fail("数据为空") 22 fail("数据为空")
25 return 23 return
@@ -50,12 +48,11 @@ export class LiveModel { @@ -50,12 +48,11 @@ export class LiveModel {
50 params['mLiveId'] = mLiveId 48 params['mLiveId'] = mLiveId
51 params['liveId'] = liveId 49 params['liveId'] = liveId
52 params['pageSize'] = pageSize + '' 50 params['pageSize'] = pageSize + ''
53 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
54 return new Promise<LiveRoomBean>((success, fail) => { 51 return new Promise<LiveRoomBean>((success, fail) => {
55 HttpRequest.post<ResponseDTO<LiveRoomBean>>( 52 HttpRequest.post<ResponseDTO<LiveRoomBean>>(
56 HttpUrlUtils.getLiveListUrl(), 53 HttpUrlUtils.getLiveListUrl(),
57 params, 54 params,
58 - headers).then((data: ResponseDTO<LiveRoomBean>) => { 55 + ).then((data: ResponseDTO<LiveRoomBean>) => {
59 if (!data || !data.data) { 56 if (!data || !data.data) {
60 fail("数据为空") 57 fail("数据为空")
61 return 58 return
@@ -86,12 +83,11 @@ export class LiveModel { @@ -86,12 +83,11 @@ export class LiveModel {
86 params['mLiveId'] = mLiveId 83 params['mLiveId'] = mLiveId
87 params['liveId'] = liveId 84 params['liveId'] = liveId
88 params['pageSize'] = pageSize + '' 85 params['pageSize'] = pageSize + ''
89 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
90 return new Promise<LiveRoomBean>((success, fail) => { 86 return new Promise<LiveRoomBean>((success, fail) => {
91 HttpRequest.post<ResponseDTO<LiveRoomBean>>( 87 HttpRequest.post<ResponseDTO<LiveRoomBean>>(
92 HttpUrlUtils.getLiveChatListUrl(), 88 HttpUrlUtils.getLiveChatListUrl(),
93 params, 89 params,
94 - headers).then((data: ResponseDTO<LiveRoomBean>) => { 90 + ).then((data: ResponseDTO<LiveRoomBean>) => {
95 if (!data || !data.data) { 91 if (!data || !data.data) {
96 fail("数据为空") 92 fail("数据为空")
97 return 93 return
@@ -114,11 +110,10 @@ export class LiveModel { @@ -114,11 +110,10 @@ export class LiveModel {
114 * @returns 110 * @returns
115 */ 111 */
116 getLiveRoomData(liveId: string) { 112 getLiveRoomData(liveId: string) {
117 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
118 return new Promise<LiveRoomDataBean>((success, fail) => { 113 return new Promise<LiveRoomDataBean>((success, fail) => {
119 HttpRequest.get<ResponseDTO<LiveRoomDataBean>>( 114 HttpRequest.get<ResponseDTO<LiveRoomDataBean>>(
120 HttpUrlUtils.getLiveRoomDataUrl() + `?liveId=${liveId}`, 115 HttpUrlUtils.getLiveRoomDataUrl() + `?liveId=${liveId}`,
121 - headers).then((data: ResponseDTO<LiveRoomDataBean>) => { 116 + ).then((data: ResponseDTO<LiveRoomDataBean>) => {
122 if (!data || !data.data) { 117 if (!data || !data.data) {
123 fail("数据为空") 118 fail("数据为空")
124 return 119 return
@@ -142,11 +137,10 @@ export class LiveModel { @@ -142,11 +137,10 @@ export class LiveModel {
142 * @returns 137 * @returns
143 */ 138 */
144 getLiveAppointmentStatus(relationId: string, liveId: string) { 139 getLiveAppointmentStatus(relationId: string, liveId: string) {
145 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
146 return new Promise<boolean>((success, fail) => { 140 return new Promise<boolean>((success, fail) => {
147 HttpRequest.get<ResponseDTO<boolean>>( 141 HttpRequest.get<ResponseDTO<boolean>>(
148 HttpUrlUtils.getLiveAppointmentStatusUrl() + `?relationId=${relationId}&liveId=${liveId}`, 142 HttpUrlUtils.getLiveAppointmentStatusUrl() + `?relationId=${relationId}&liveId=${liveId}`,
149 - headers).then((data: ResponseDTO<boolean>) => { 143 + ).then((data: ResponseDTO<boolean>) => {
150 if (!data || !data.data) { 144 if (!data || !data.data) {
151 fail("数据为空") 145 fail("数据为空")
152 return 146 return
@@ -175,12 +169,11 @@ export class LiveModel { @@ -175,12 +169,11 @@ export class LiveModel {
175 params['relationId'] = relationId 169 params['relationId'] = relationId
176 params['liveId'] = liveId 170 params['liveId'] = liveId
177 params['isSubscribe'] = `${isSubscribe}` 171 params['isSubscribe'] = `${isSubscribe}`
178 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
179 return new Promise<ResponseDTO<string>>((success, fail) => { 172 return new Promise<ResponseDTO<string>>((success, fail) => {
180 HttpRequest.post<ResponseDTO<string>>( 173 HttpRequest.post<ResponseDTO<string>>(
181 HttpUrlUtils.getLiveAppointmentUrl(), 174 HttpUrlUtils.getLiveAppointmentUrl(),
182 params, 175 params,
183 - headers).then((data: ResponseDTO<string>) => { 176 + ).then((data: ResponseDTO<string>) => {
184 if (data.code != 0) { 177 if (data.code != 0) {
185 fail(data.message) 178 fail(data.message)
186 ToastUtils.shortToast(data.message) 179 ToastUtils.shortToast(data.message)
1 import HashMap from '@ohos.util.HashMap'; 1 import HashMap from '@ohos.util.HashMap';
2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 2 import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork';
3 -import { Logger, SPHelper, StringUtils } from 'wdKit'; 3 +import { Logger } from 'wdKit';
4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
5 import { LoginBean } from './LoginBean'; 5 import { LoginBean } from './LoginBean';
6 import { CheckVerifyBean } from './CheckVerifyBean'; 6 import { CheckVerifyBean } from './CheckVerifyBean';
@@ -17,9 +17,8 @@ export class LoginModel { @@ -17,9 +17,8 @@ export class LoginModel {
17 sendVerifyCode(number: string) { 17 sendVerifyCode(number: string) {
18 let bean: Record<string, string> = {}; 18 let bean: Record<string, string> = {};
19 bean['phoneNum'] = number 19 bean['phoneNum'] = number
20 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
21 return new Promise<string>((success, fail) => { 20 return new Promise<string>((success, fail) => {
22 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeUrl(), bean, headers).then((data: ResponseDTO<string>) => { 21 + HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeUrl(), bean).then((data: ResponseDTO<string>) => {
23 if (!data || !data.data) { 22 if (!data || !data.data) {
24 fail("数据为空") 23 fail("数据为空")
25 return 24 return
@@ -40,9 +39,8 @@ export class LoginModel { @@ -40,9 +39,8 @@ export class LoginModel {
40 sendVerifyCodeByToken() { 39 sendVerifyCodeByToken() {
41 let bean: Record<string, string> = {}; 40 let bean: Record<string, string> = {};
42 // bean['phoneNum'] = number 41 // bean['phoneNum'] = number
43 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
44 return new Promise<object>((success, fail) => { 42 return new Promise<object>((success, fail) => {
45 - HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeByTokenUrl(),bean, headers).then((data: ResponseDTO<object>) => { 43 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeByTokenUrl(),bean).then((data: ResponseDTO<object>) => {
46 if (!data) { 44 if (!data) {
47 fail("数据为空") 45 fail("数据为空")
48 return 46 return
@@ -63,14 +61,13 @@ export class LoginModel { @@ -63,14 +61,13 @@ export class LoginModel {
63 61
64 //{"phone":"13625644528","loginType":2,"deviceId":"60da5af6-9c59-3566-8622-8c6c00710994","verificationCode":"644528"} 62 //{"phone":"13625644528","loginType":2,"deviceId":"60da5af6-9c59-3566-8622-8c6c00710994","verificationCode":"644528"}
65 appLogin(phone: string, loginType: number, verificationCode: string) { 63 appLogin(phone: string, loginType: number, verificationCode: string) {
66 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
67 let bean: Record<string, Object> = {}; 64 let bean: Record<string, Object> = {};
68 bean['phone'] = phone 65 bean['phone'] = phone
69 bean['loginType'] = loginType 66 bean['loginType'] = loginType
70 bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994' 67 bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994'
71 bean['verificationCode'] = verificationCode 68 bean['verificationCode'] = verificationCode
72 return new Promise<LoginBean>((success, fail) => { 69 return new Promise<LoginBean>((success, fail) => {
73 - HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { 70 + HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => {
74 Logger.debug("LoginViewModel:success2 ", data.message) 71 Logger.debug("LoginViewModel:success2 ", data.message)
75 if (!data) { 72 if (!data) {
76 fail("数据为空") 73 fail("数据为空")
@@ -90,7 +87,6 @@ export class LoginModel { @@ -90,7 +87,6 @@ export class LoginModel {
90 87
91 // {"password":"523acd319228efde34e8a30268ee8ca5e4fc421d72affa531676e1765940d22c","phone":"13625644528","loginType":0,"oldPassword":"BA5FD74F827AF9B271FE17CADC489C36","deviceId":"60da5af6-9c59-3566-8622-8c6c00710994"} 88 // {"password":"523acd319228efde34e8a30268ee8ca5e4fc421d72affa531676e1765940d22c","phone":"13625644528","loginType":0,"oldPassword":"BA5FD74F827AF9B271FE17CADC489C36","deviceId":"60da5af6-9c59-3566-8622-8c6c00710994"}
92 appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { 89 appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) {
93 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
94 let bean: Record<string, string | number> = {}; 90 let bean: Record<string, string | number> = {};
95 bean['phone'] = phone 91 bean['phone'] = phone
96 bean['loginType'] = loginType 92 bean['loginType'] = loginType
@@ -98,7 +94,7 @@ export class LoginModel { @@ -98,7 +94,7 @@ export class LoginModel {
98 bean['password'] = password 94 bean['password'] = password
99 bean['oldPassword'] = oldPassword 95 bean['oldPassword'] = oldPassword
100 return new Promise<LoginBean>((success, fail) => { 96 return new Promise<LoginBean>((success, fail) => {
101 - HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean, headers).then((data: ResponseDTO<LoginBean>) => { 97 + HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => {
102 Logger.debug("LoginViewModel:success2 ", data.message) 98 Logger.debug("LoginViewModel:success2 ", data.message)
103 if (!data) { 99 if (!data) {
104 fail("数据为空") 100 fail("数据为空")
@@ -121,10 +117,10 @@ export class LoginModel { @@ -121,10 +117,10 @@ export class LoginModel {
121 let bean: Record<string, Object> = {}; 117 let bean: Record<string, Object> = {};
122 bean['verifyCode'] = verifyCode 118 bean['verifyCode'] = verifyCode
123 bean['phone'] = phone 119 bean['phone'] = phone
124 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 120 + let headers: HashMap<string, string> = new HashMap<string, string>();
125 headers.set('cookie', ''); 121 headers.set('cookie', '');
126 return new Promise<CheckVerifyBean>((success, fail) => { 122 return new Promise<CheckVerifyBean>((success, fail) => {
127 - HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeUrl(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => { 123 + HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeUrl(), bean).then((data: ResponseDTO<CheckVerifyBean>) => {
128 Logger.debug("LoginViewModel:success2 ", data.message) 124 Logger.debug("LoginViewModel:success2 ", data.message)
129 if (!data || !data.data) { 125 if (!data || !data.data) {
130 fail("数据为空") 126 fail("数据为空")
@@ -146,9 +142,8 @@ export class LoginModel { @@ -146,9 +142,8 @@ export class LoginModel {
146 let bean: Record<string, Object> = {}; 142 let bean: Record<string, Object> = {};
147 bean['verifyCode'] = verifyCode 143 bean['verifyCode'] = verifyCode
148 // bean['phone'] = phone 144 // bean['phone'] = phone
149 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
150 return new Promise<CheckVerifyBean>((success, fail) => { 145 return new Promise<CheckVerifyBean>((success, fail) => {
151 - HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeByToken(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => { 146 + HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeByToken(), bean).then((data: ResponseDTO<CheckVerifyBean>) => {
152 Logger.debug("LoginViewModel:success2 ", data.message) 147 Logger.debug("LoginViewModel:success2 ", data.message)
153 if (!data) { 148 if (!data) {
154 fail("数据为空") 149 fail("数据为空")
@@ -174,10 +169,8 @@ export class LoginModel { @@ -174,10 +169,8 @@ export class LoginModel {
174 // bean['password'] = password; 169 // bean['password'] = password;
175 // bean['tempToken'] = tempToken; 170 // bean['tempToken'] = tempToken;
176 171
177 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
178 -  
179 return new Promise<string>((success, fail) => { 172 return new Promise<string>((success, fail) => {
180 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getForgetPasswordUrl(), bean, headers).then((data: ResponseDTO<string>) => { 173 + HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getForgetPasswordUrl(), bean).then((data: ResponseDTO<string>) => {
181 if (!data || !data.data) { 174 if (!data || !data.data) {
182 fail("数据为空") 175 fail("数据为空")
183 return 176 return
@@ -202,10 +195,8 @@ export class LoginModel { @@ -202,10 +195,8 @@ export class LoginModel {
202 bean['password'] = password; 195 bean['password'] = password;
203 bean['tempToken'] = tempToken; 196 bean['tempToken'] = tempToken;
204 197
205 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
206 -  
207 return new Promise<object>((success, fail) => { 198 return new Promise<object>((success, fail) => {
208 - HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.getForgetPasswordUrl(), bean, headers).then((data: ResponseDTO<object>) => { 199 + HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.getForgetPasswordUrl(), bean).then((data: ResponseDTO<object>) => {
209 200
210 if (data.code != 0) { 201 if (data.code != 0) {
211 fail(data.message) 202 fail(data.message)
@@ -224,10 +215,8 @@ export class LoginModel { @@ -224,10 +215,8 @@ export class LoginModel {
224 let bean: Record<string, string> = {}; 215 let bean: Record<string, string> = {};
225 bean['refreshToken'] = HttpUrlUtils.getRefreshToken(); 216 bean['refreshToken'] = HttpUrlUtils.getRefreshToken();
226 217
227 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
228 -  
229 return new Promise<string>((success, fail) => { 218 return new Promise<string>((success, fail) => {
230 - HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>)=>{ 219 + HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.getLogoutUrl(), bean).then((data: ResponseDTO<string>)=>{
231 if (!data) { 220 if (!data) {
232 fail("数据为空") 221 fail("数据为空")
233 return 222 return
@@ -260,12 +249,11 @@ export class LoginModel { @@ -260,12 +249,11 @@ export class LoginModel {
260 249
261 //更换绑定手机号 250 //更换绑定手机号
262 changeBindPhone(phone: string, verificationCode: string){ 251 changeBindPhone(phone: string, verificationCode: string){
263 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
264 let bean: Record<string, Object> = {}; 252 let bean: Record<string, Object> = {};
265 bean['phone'] = phone 253 bean['phone'] = phone
266 bean['verifyCode'] = verificationCode 254 bean['verifyCode'] = verificationCode
267 return new Promise<object>((success, fail) => { 255 return new Promise<object>((success, fail) => {
268 - HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.changeBindPhone(), bean, headers).then((data: ResponseDTO<object>) => { 256 + HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.changeBindPhone(), bean).then((data: ResponseDTO<object>) => {
269 Logger.debug("LoginViewModel:success2 ", data.message) 257 Logger.debug("LoginViewModel:success2 ", data.message)
270 if (!data) { 258 if (!data) {
271 fail("数据为空") 259 fail("数据为空")
@@ -285,9 +273,8 @@ export class LoginModel { @@ -285,9 +273,8 @@ export class LoginModel {
285 273
286 /**获取用户安全页信息*/ 274 /**获取用户安全页信息*/
287 querySecurity(){ 275 querySecurity(){
288 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
289 return new Promise<object>((success, fail) => { 276 return new Promise<object>((success, fail) => {
290 - HttpRequest.get<ResponseDTO<object>>(HttpUrlUtils.querySecurity(), headers).then((data: ResponseDTO<object>) => { 277 + HttpRequest.get<ResponseDTO<object>>(HttpUrlUtils.querySecurity()).then((data: ResponseDTO<object>) => {
291 Logger.debug("LoginViewModel:success2 ", data.message) 278 Logger.debug("LoginViewModel:success2 ", data.message)
292 if (!data) { 279 if (!data) {
293 fail("数据为空") 280 fail("数据为空")
@@ -307,9 +294,8 @@ export class LoginModel { @@ -307,9 +294,8 @@ export class LoginModel {
307 294
308 queryUserDetail() { 295 queryUserDetail() {
309 let bean: Record<string, string> = {}; 296 let bean: Record<string, string> = {};
310 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
311 return new Promise<UserDetail>((success, fail) => { 297 return new Promise<UserDetail>((success, fail) => {
312 - HttpBizUtil.get<ResponseDTO<UserDetail>>(HttpUrlUtils.queryUserDetail(), headers).then((data: ResponseDTO<UserDetail>) => { 298 + HttpBizUtil.get<ResponseDTO<UserDetail>>(HttpUrlUtils.queryUserDetail()).then((data: ResponseDTO<UserDetail>) => {
313 if (!data || !data.data) { 299 if (!data || !data.data) {
314 fail("数据为空") 300 fail("数据为空")
315 return 301 return
1 -import HashMap from '@ohos.util.HashMap';  
2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 1 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
3 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 2 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
4 import { Logger, SPHelper } from 'wdKit/Index'; 3 import { Logger, SPHelper } from 'wdKit/Index';
5 -import data from '@ohos.telephony.data';  
6 import { SpConstants } from 'wdConstant/Index'; 4 import { SpConstants } from 'wdConstant/Index';
7 5
8 6
@@ -32,9 +30,8 @@ export class InterestsHobbiesModel { @@ -32,9 +30,8 @@ export class InterestsHobbiesModel {
32 30
33 31
34 getInterestsHobbiesData() { 32 getInterestsHobbiesData() {
35 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
36 return new Promise<InterestsList[]>((success, fail) => { 33 return new Promise<InterestsList[]>((success, fail) => {
37 - HttpRequest.get<ResponseDTO<InterestsList[]>>(HttpUrlUtils.getInterestsUrl(), headers).then((data: ResponseDTO<InterestsList[]>) => { 34 + HttpRequest.get<ResponseDTO<InterestsList[]>>(HttpUrlUtils.getInterestsUrl()).then((data: ResponseDTO<InterestsList[]>) => {
38 if (!data || !data.data) { 35 if (!data || !data.data) {
39 fail("数据为空") 36 fail("数据为空")
40 return 37 return
@@ -58,9 +55,8 @@ export class InterestsHobbiesModel { @@ -58,9 +55,8 @@ export class InterestsHobbiesModel {
58 if (tags.length === 0) return 55 if (tags.length === 0) return
59 let bean: Record<string, string> = {}; 56 let bean: Record<string, string> = {};
60 bean['tagIds'] = tags 57 bean['tagIds'] = tags
61 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
62 return new Promise<ResponseDTO>((success, fail) => { 58 return new Promise<ResponseDTO>((success, fail) => {
63 - HttpRequest.post<ResponseDTO>(HttpUrlUtils.getUpdateInterestsUrl(),bean,headers).then((data: ResponseDTO) => { 59 + HttpRequest.post<ResponseDTO>(HttpUrlUtils.getUpdateInterestsUrl(),bean).then((data: ResponseDTO) => {
64 if (data.code == 0) { 60 if (data.code == 0) {
65 Logger.info('InterestsHobbiesModel','updateInterests','更新兴趣成功') 61 Logger.info('InterestsHobbiesModel','updateInterests','更新兴趣成功')
66 SPHelper.default.deleteSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS) 62 SPHelper.default.deleteSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS)
1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
2 -// import { HashMap } from '@kit.ArkTS';  
3 -import HashMap from '@ohos.util.HashMap';  
4 import { AgreementBean } from '../launchPage/AgreementBean'; 2 import { AgreementBean } from '../launchPage/AgreementBean';
5 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 3 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
6 import { Logger, SPHelper } from 'wdKit/Index'; 4 import { Logger, SPHelper } from 'wdKit/Index';
@@ -8,9 +6,8 @@ import { SpConstants } from 'wdConstant/Index'; @@ -8,9 +6,8 @@ import { SpConstants } from 'wdConstant/Index';
8 6
9 export class LaunchModel { 7 export class LaunchModel {
10 getAgreement() { 8 getAgreement() {
11 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
12 return new Promise<AgreementBean>((success, fail) => { 9 return new Promise<AgreementBean>((success, fail) => {
13 - HttpRequest.get<ResponseDTO<Array<AgreementBean>>>(HttpUrlUtils.getAgreement(), headers).then((data: ResponseDTO<Array<AgreementBean>>) => { 10 + HttpRequest.get<ResponseDTO<Array<AgreementBean>>>(HttpUrlUtils.getAgreement()).then((data: ResponseDTO<Array<AgreementBean>>) => {
14 if (!data || !data.data) { 11 if (!data || !data.data) {
15 fail("数据为空") 12 fail("数据为空")
16 return 13 return
1 1
2 import LaunchDataModel from '../viewModel/LaunchDataModel' 2 import LaunchDataModel from '../viewModel/LaunchDataModel'
3 3
4 -import HashMap from '@ohos.util.HashMap';  
5 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
6 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 5 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
7 import { Logger, SPHelper } from 'wdKit/Index'; 6 import { Logger, SPHelper } from 'wdKit/Index';
8 -import data from '@ohos.telephony.data';  
9 import { SpConstants } from 'wdConstant/Index'; 7 import { SpConstants } from 'wdConstant/Index';
10 8
11 9
12 export class LaunchPageModel { 10 export class LaunchPageModel {
13 11
14 getLaunchPageData(): Promise<LaunchDataModel> { 12 getLaunchPageData(): Promise<LaunchDataModel> {
15 - let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();  
16 return new Promise<LaunchDataModel>((success, fail) => { 13 return new Promise<LaunchDataModel>((success, fail) => {
17 - HttpRequest.get<ResponseDTO<LaunchDataModel>>(HttpUrlUtils.getLaunchPageDataUrl(), headers).then((data: ResponseDTO<LaunchDataModel>) => { 14 + HttpRequest.get<ResponseDTO<LaunchDataModel>>(HttpUrlUtils.getLaunchPageDataUrl()).then((data: ResponseDTO<LaunchDataModel>) => {
18 if (!data || !data.data) { 15 if (!data || !data.data) {
19 fail("数据为空") 16 fail("数据为空")
20 return 17 return