mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
refactor: message listeners (#447)
* Refactor API imports and update API endpoints * Fix variable naming in FavoritesPop and Favorites components * Fix variable naming inconsistency in getHistoryList function * Fix API parameter naming conventions * Refactor API_AUTH afterHandle functions * Add API documentation links and add function to be the api item * Refactor API body and params * Remove unused getAccessKey function in auth.ts --------- Co-authored-by: pengyunfei <pengyunfei@360.cn> Co-authored-by: Hakadao <a578457889743@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ async function getFollowedUsersVideos() {
|
||||
contentScriptQuery: 'getMoments',
|
||||
type: 'video',
|
||||
offset: offset.value,
|
||||
updateBaseline: updateBaseline.value,
|
||||
update_baseline: updateBaseline.value,
|
||||
})
|
||||
|
||||
if (response.code === -101) {
|
||||
|
||||
@@ -117,7 +117,7 @@ async function getRecommendVideos() {
|
||||
try {
|
||||
const response: forYouResult = await browser.runtime.sendMessage({
|
||||
contentScriptQuery: 'getRecommendVideos',
|
||||
refreshIdx: refreshIdx.value++,
|
||||
fresh_idx: refreshIdx.value++,
|
||||
})
|
||||
|
||||
if (!response.data) {
|
||||
@@ -157,9 +157,9 @@ async function getAppRecommendVideos() {
|
||||
try {
|
||||
const response: AppForYouResult = await browser.runtime.sendMessage({
|
||||
contentScriptQuery: 'getAppRecommendVideos',
|
||||
accessKey: accessKey.value,
|
||||
sLocale: settings.value.language !== LanguageType.Mandarin_CN ? 'zh-Hant_TW' : 'zh-Hans_CN',
|
||||
cLocale: settings.value.language !== LanguageType.Mandarin_CN ? 'zh-Hant_TW' : 'zh-Hans_CN',
|
||||
access_key: accessKey.value,
|
||||
s_locale: settings.value.language !== LanguageType.Mandarin_CN ? 'zh-Hant_TW' : 'zh-Hans_CN',
|
||||
c_locale: settings.value.language !== LanguageType.Mandarin_CN ? 'zh-Hant_TW' : 'zh-Hans_CN',
|
||||
appkey: TVAppKey.appkey,
|
||||
idx: appVideoList.length > 0 ? appVideoList[appVideoList.length - 1].idx : 1,
|
||||
})
|
||||
|
||||
@@ -140,7 +140,7 @@ function getRankingPgc() {
|
||||
isLoading.value = true
|
||||
browser.runtime.sendMessage({
|
||||
contentScriptQuery: 'getRankingPgc',
|
||||
seasonType: activatedRankingType.value.seasonType,
|
||||
season_type: activatedRankingType.value.seasonType,
|
||||
}).then((response: RankingPgcResult) => {
|
||||
if (response.code === 0)
|
||||
Object.assign(PgcList, response.result.list)
|
||||
|
||||
@@ -84,7 +84,7 @@ async function getFollowedUsersVideos() {
|
||||
contentScriptQuery: 'getMoments',
|
||||
type: 'pgc',
|
||||
offset: offset.value,
|
||||
updateBaseline: updateBaseline.value,
|
||||
update_baseline: updateBaseline.value,
|
||||
})
|
||||
|
||||
if (response.code === -101) {
|
||||
|
||||
Reference in New Issue
Block a user