PageSourceSearch

https://www.wenweipo.com/static/wenweipo/request/index.js?v=20260603

js wenweipo.com collected 2026-09-24 17:13:46 UTC 9,442 bytes, 320 lines download raw bytes

1import { request_api } from "./request-api.js?v=20260910"
2import { Fetch_Request, fetch_request } from "./request-fetch.js"
3import { getCurrentDate } from "../commons/js/tools.js"
4
5class UserinfosService {
6  async getProfile() {
7    return await fetch_request.get(request_api.userInfos.profile, { withAuth: true });
8  }
9
10  async updateProfile(data) {
11    return await fetch_request.put(request_api.userInfos.profile, data, { withAuth: true })
12  }
13
14  async getListThirdAccount() {
15    return await fetch_request.get(request_api.userInfos.listThirdAccount, { withAuth: true });
16  }
17}
18
19class ScoreAboutService {
20  async getScoreTotal() {
21    return await fetch_request.get(request_api.scoreAbout.scoreTotal, { withAuth: true });
22  }
23
24  async getDayAward() {
25    return await fetch_request.get(request_api.scoreAbout.dayAward, { withAuth: true });
26  }
27
28  async getScoreDetail(date) {
29    let param = date
30    if (!param) param = getCurrentDate("YYYY-MM")
31
32    return await fetch_request.get(`${request_api.scoreAbout.scoreDetail}/${param}`, { withAuth: true });
33  }
34
35  /**
36   * 积分领取
37   * @param {string} actionId 积分领取id
38   */
39  async claimScore(actionId) {
40    return await fetch_request.get(`${request_api.scoreAbout.claimScore}/${actionId}`, { withAuth: true });
41  }
42
43  async addScore(data) {
44    const { actionId = "6603ccfbc501b1ddfb278444", articleId="", articleTitle="", articleUrl="", commentId="" } = data || {};
45    return await fetch_request.post(
46      request_api.scoreAbout.addScore,
47      { actionId, articleId, articleTitle, articleUrl, commentId },
48      { withAuth: true }
49    );
50  }
51}
52
53class UserActivitiesService {
54  async getFavorite(page = 0, size = 6) {
55    const url = `${request_api.userActivities.favorite}?page=${page}&size=${size}`;
56    return await fetch_request.get(url, { withAuth: true });
57  }
58
59  /**
60   * 取消收藏
61   * @param {string[]} ids 文章id数组
62   */
63  async removeFavorite(ids) {
64    return await fetch_request.post(request_api.userActivities.removeFavorite, ids, { withAuth: true });
65  }
66
67  async getLike(page = 0, size = 6) {
68    const url = `${request_api.userActivities.like}?page=${page}&size=${size}`;
69    return await fetch_request.get(url, { withAuth: true });
70  }
71
72  /**
73   * 取消点赞
74   * @param {string} id 文章id
75   */
76  async removeLike(id) {
77    const url = `${request_api.userActivities.removeLike}/${id}`;
78    return await fetch_request.post(url, { withAuth: true });
79  }
80
81  async getAllComments(page = 0, size = 6) {
82    const url = `${request_api.userActivities.allComments}?page=${page}&size=${size}`;
83    return await fetch_request.get(url, { withAuth: true });
84  }
85
86  async getAllReplys(page = 0, size = 6) {
87    const url = `${request_api.userActivities.allReplys}?page=${page}&size=${size}`;
88    return await fetch_request.get(url, { withAuth: true });
89  }
90
91  /**
92   * 删除评论
93   * @param {string} id 评论id
94   */
95  async deleteComment(id) {
96    const url = `${request_api.userActivities.deleteComment}/${id}`;
97    return await fetch_request.delete(url, { withAuth: true });
98  }
99}
100
101class AccountService {
102  /**
103   * 发送注销验证码
104   * @param {string} email 邮箱
105   * @param {string} timestamp 时间戳
106   * @param {string} sign 签名
107   * @param {string} sliderToken 滑块验证码
108   */
109  async sendDeleteCode({ email, timestamp, sign, sliderToken }) {
110    return await fetch_request.post(
111      request_api.account.sendDeleteCode,
112      { email, timestamp, sign, sliderToken },
113      { withAuth: false }
114    );
115  }
116
117  /**
118   * 删除账号
119   * @param {string} vcode 验证码
120   */
121  async deleteAccount({ vcode }) {
122    return await fetch_request.post(
123      request_api.account.deleteAccount,
124      { vcode },
125      {
126        withAuth: true,
127        headers:{
128          "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
129        }
130      },
131      true
132    );
133  }
134
135  /**
136   * 更改密码
137   * @param {string} oldPassword1 旧密码
138   * @param {string} password 新密码
139   * @param {string} confirmPassword 确认密码
140   */
141  async updatePassword({ oldPassword1, password, confirmPassword }) {
142    return await fetch_request.put(request_api.account.updatePassword, { oldPassword1, password, confirmPassword }, { withAuth: true });
143  }
144
145  /**
146   * 发送重置密码验证码
147   * @param {string} email 邮箱
148   * @param {string} captcha 验证码
149   */
150  async sendResetCode({ email, captcha }) {
151    return await fetch_request.post(
152      request_api.account.sendResetCode,
153      { email, captcha },
154      {
155        withAuth: false,
156        headers:{
157          "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
158        },
159      },
160      true
161    );
162  }
163
164  /**
165   * 重置密码
166   * @param {string} account 邮件验证码
167   * @param {string} password 新密码
168   * @param {string} token 新密码确认
169   */
170  async resetPassword({ account, password, token }) {
171    return await fetch_request.post(request_api.account.resetPassword, { account, password, token }, { withAuth: false });
172  }
173
174  /**
175   * 解绑第三方账户
176   * @param {string} thirdId 第三方账户id
177   */
178  async unbindThirdAccount(thirdId) {
179    return await fetch_request.delete(`${request_api.account.unbindThirdAccount}${thirdId}`, { withAuth: true });
180  }
181}
182
183class FeedbackService {
184  async getMyFeedback() {
185    return await fetch_request.get(request_api.feedback.list, { withAuth: true });
186  }
187
188  /**
189   * 提交反馈
190   * @param {string} content 反馈内容
191   * @param {string} userId 用户id
192   */
193  async addFeedback(data) {
194    return await fetch_request.post(
195      request_api.feedback.add,
196      data,
197      {
198        withAuth: true,
199        headers:{
200          "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
201        }
202      },
203      true
204    );
205  }
206}
207
208class ColumnService {
209  /**
210   * 获取指定栏目下的子栏目
211   * @param {string} columnId 栏目id
212   */
213  async getSubColumns(columnId) {
214    const ori_url_part = request_api.columns.subColumns
215    const url = `${ori_url_part}/${columnId}/columns.json`
216    return await fetch_request.get(url)
217  }
218
219  /**
220   * 获取指定栏目下的稿件
221   * @param {string} columnId 栏目id
222   * @param {number} page 页码
223   */
224  async getStoryList(columnId) {
225    const ori_url_part = request_api.columns.storyList
226    const url = `${ori_url_part}/${columnId}/special_stories.json`
227    return await fetch_request.get(url)
228  }
229}
230
231/**
232 * 稿件相关
233 */
234class StoryService {
235  /**
236   * 获取指定周期内稿件的排名
237   * @param {string} cycle 周期,可选值:24(24小时排行)、168(7天排行)、720(30天排行)
238   */
239  async getRankingStories(cycle) {
240    const tmp_url = request_api.story.ranking
241    const url = `${tmp_url}/${cycle}/stories.json`
242    return await fetch_request.get(url)
243  }
244
245  /**
246   * 获取指定日期内稿件
247   * @param {number} page
248   * @param {number} size
249   * @param {string} publishedDateFrom 开始时间 yyyy-MM-dd
250   * @param {string} publishedDateTo 结束时间 yyyy-MM-dd
251   */
252  async getTimelineStories({page = 0, size = 20, publishedDateFrom = '', publishedDateTo = ''}) {
253    const request = new Fetch_Request("https://search2.wenweipo.com/")
254    const default_url = `${request_api.story.timeline}&page=${page}&size=${size}`
255    const url = publishedDateFrom ? `${default_url}&publishedDateFrom=${publishedDateFrom}&publishedDateTo=${publishedDateTo}` : default_url
256
257    // Content-Type的配置导致了接口跨域
258    return await request.get(url, {
259      headers:{
260        "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
261      }
262    })
263  }
264
265  async getStoryInfos(story) {
266    return await fetch_request.get(story, {
267      headers:{
268        "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
269      }
270    })
271  }
272
273  async searchStories({page=0, size=12, keyword="", columnId="", sort="publishTime", order="desc", typeMust="", matchingDegree="keyword_not_important"}) {
274    const request = new Fetch_Request("https://search2.wenweipo.com/")
275    const url = `${request_api.story.search}?channel=wenweipo&page=${page}&size=${size}&mode=json&fullMust=${keyword}&sort=${sort}&order=${order}&typeMust=${typeMust}&matchingDegree=${matchingDegree}&column=${columnId}`
276    return await request.get(url, {
277      headers:{
278        "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
279      }
280    })
281  }
282  
283  async getRecentStoryList() {
284      return await fetch_request.get(request_api.story.recentNews)
285  }
286}
287
288class OtherService {
289  async wc2026About(type) {
290    const request = new Fetch_Request("https://cbs-i.sports.cctv.com/")
291    const url = `${request_api[type]}?ran=${new Date().getTime()}`
292    return await request.get(url, {
293      headers:{
294        "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"
295      }
296    })
297  }
298}
299
300const userInfosService = new UserinfosService()
301const scoreAboutService = new ScoreAboutService()
302const userActivitiesService = new UserActivitiesService()
303const accountService = new AccountService()
304const feedbackService = new FeedbackService()
305const columnService = new ColumnService()
306const storyService = new StoryService()
307const otherService = new OtherService()
308
309window.$scoreAboutService = scoreAboutService
310
311export {
312  userInfosService,
313  scoreAboutService,
314  userActivitiesService,
315  accountService,
316  feedbackService,
317  columnService,
318  storyService,
319  otherService
320}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.