Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Jan 24, 2025
1 parent a9417f7 commit d05d052
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/index/src/components/rank-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function RankList() {

useEffect(() => {
corsAxios.get(`/rank?day=${day}`).then((rsp) => {
setList(cliclisAdapter(rsp.posts) || [])
setList(cliclisAdapter(rsp.data) || [])
})
}, [day])

Expand Down
6 changes: 3 additions & 3 deletions packages/index/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export default function IndexPage() {
Promise.allSettled(
indexConfig.map(({ remote: remote }) => (typeof remote == 'string' ? corsAxios.get(remote) : remote))
).then((_resp) => {
const resp = _resp.map(({ value }: any) => {
if (value.posts) {
return cliclisAdapter(value.posts)
const resp = _resp.map(({ value }: any, i) => {
if (i != 0) {
return cliclisAdapter(value.data)
}

return value.data
Expand Down
2 changes: 1 addition & 1 deletion packages/index/src/pages/player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function PlayerPage({ id }: any) {
player.current?.context.ui?.menu.unregister('Source')
corsAxios
.get(`/post/${id}`)
.then((it) => clicliAdapter(it.result))
.then((it) => clicliAdapter(it.data))
.then((it) => {
setState(it)
setVideo(it.Episodes)
Expand Down
4 changes: 2 additions & 2 deletions packages/index/src/pages/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function SearchPage() {
// })
corsAxios
.get(`/search/posts?key=${encodeURIComponent(k)}`)
.then((it) => setPosts(cliclisAdapter(it.posts || null) as any))
.then((it) => setPosts(cliclisAdapter(it.data || null) as any))
.catch((err) => {
setPosts([])
console.log(err)
Expand All @@ -51,7 +51,7 @@ export default function SearchPage() {
e.preventDefault()
const qs = Object.assign({}, queryString.parse(window.location.search), {
k: inputKeyword.current,
page: 1,
page: 1
})
setLocation(`/search?${queryString.stringify(qs)}`)
// setQuery({ k: inputKeyword.current, v: Date.now() } as any)
Expand Down

0 comments on commit d05d052

Please sign in to comment.