Skip to content

Commit

Permalink
fix: 🐞 request add ua
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocyss committed Oct 1, 2024
1 parent fd6e1a2 commit 025c053
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/steps/lyrics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ onMounted(() => {
</script>

<template>
<a-spin
:loading="
!fromData.data ||
!fromData.playerData ||
(fromData.playerData.subtitle.subtitles.length < 1 && !error)
"
>
<a-spin :loading="!fromData.data || (!fromData.playerData && !error)">
<a-form auto-label-width :model="{}">
<a-result
v-if="error"
Expand Down
3 changes: 3 additions & 0 deletions src/utils/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export function request<TContext, TResponseType extends ResponseType = "json">({
onStream = () => {},
cookie = true,
}: RequestArgs<TContext, TResponseType>) {
headers["Referer"] = window.location.href;
headers["User-Agent"] = window.navigator.userAgent;
return new Promise<TContext>(async (resolve, reject) => {
const ck = cookie
? await new Promise<ResolvedReturnType<(typeof GM_cookie)["list"]>>(
Expand All @@ -51,6 +53,7 @@ export function request<TContext, TResponseType extends ResponseType = "json">({
})
)
: [];
console.log("music-log/requests", { url, data, method, headers, ck });
const abort = GM_xmlhttpRequest<TContext, TResponseType>({
method,
url,
Expand Down

0 comments on commit 025c053

Please sign in to comment.