Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Aug 9, 2024
1 parent 7bbe553 commit 4b4215e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
19 changes: 9 additions & 10 deletions packages/index/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ const indexConfig = [
title: 'Recommends',
query: 'type=recommends&title=recommends',
icon: require('../../assets/recommend.svg').default,
remoto: recommends,
},
{
title: `What We're Watching Right Now`,
query: `type=popular&title=What We're Watching Right Now`,
title: `❤️‍🔥`,
remoto: `https://www.clicli.cc/posts?status=public&sort=&tag=恋爱&page=1&pageSize=24`,
query: `tag=恋爱&title=❤️‍🔥`,
},
{
title: 'Latest Releases',
query: 'type=recent&title=Latest Releases',
remoto: `https://www.clicli.cc/posts?status=&sort=&tag=&uid=&page=1&pageSize=24`,
query: 'tag=all&title=Latest Releases',
},
]

Expand All @@ -34,13 +37,9 @@ export default function IndexPage() {
// https://cors.moopa.my.id/?url=
// https://techz-cors-bypass.herokuapp.com/${res.url}
useEffect(() => {
Promise.allSettled([
// corsAxios.get(`https://www.clicli.cc/users?level=4&page=1&pageSize=9`),
recommends,
corsAxios.get(`https://www.clicli.cc/posts?status=public&sort=新番%2C完结&tag=7月新番&page=1&pageSize=99`),
// corsAxios.get('https://www.clicli.cc/posts?status=public&sort=&tag=%E6%8E%A8%E8%8D%90&uid=&page=1&pageSize=12'),
corsAxios.get('https://www.clicli.cc/posts?status=public&sort=&tag=&uid=&page=1&pageSize=24'),
] as any).then((_resp) => {
Promise.allSettled(
indexConfig.map(({ remoto }) => (typeof remoto == 'string' ? corsAxios.get(remoto) : remoto))
).then((_resp) => {
const resp = _resp.map(({ value }: any) => {
if (value.posts) {
return cliclisAdapter(value.posts)
Expand Down
8 changes: 2 additions & 6 deletions packages/index/src/pages/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ export default function SearchPage() {
}

useEffect(() => {
if (type == 'recent' || type == 'popular' || tag) {
if (tag || tag == 'all') {
setPosts(null)
corsAxios
.get(
`https://www.clicli.cc/posts?status=public&sort=&tag=${
type == 'popular' ? '推荐' : tag
}&uid=&page=${page}&pageSize=24`
)
.get(`https://www.clicli.cc/posts?status=public&sort=&tag=${tag}&uid=&page=${page}&pageSize=24`)
.then((it) => {
setPosts(cliclisAdapter(it.posts))
})
Expand Down

0 comments on commit 4b4215e

Please sign in to comment.