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 8401cd6 commit 256dcea
Show file tree
Hide file tree
Showing 9 changed files with 948 additions and 950 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"gen:sw": "pnpm --filter @web/sw run build"
},
"dependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.25.0",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@types/node": "^20.14.13",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"babel-loader": "^9.1.3",
Expand All @@ -35,8 +35,8 @@
},
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"autoprefixer": "^10.4.19",
"browserslist": "^4.23.2",
"autoprefixer": "^10.4.20",
"browserslist": "^4.23.3",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
Expand All @@ -46,7 +46,7 @@
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
"mini-css-extract-plugin": "^2.9.0",
"postcss": "^8.4.40",
"postcss": "^8.4.41",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-loader": "^8.1.1",
"postcss-preset-env": "^9.6.0",
Expand Down
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 @@ -10,7 +10,7 @@ export default function RankList() {
const [list, setList] = useState<R.Post[]>()

useEffect(() => {
corsAxios.get(`https://www.clicli.cc/rank?day=${day}`).then((rsp) => {
corsAxios.get(`/rank?day=${day}`).then((rsp) => {
setList(cliclisAdapter(rsp.posts))
})
}, [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 @@ -20,13 +20,13 @@ const indexConfig = [
remoto: recommends,
},
{
title: `❤️‍🔥`,
remoto: `https://www.clicli.cc/posts?status=public&sort=&tag=恋爱&page=1&pageSize=24`,
title: `❤️‍🔥I Miss U`,
remoto: `/posts?status=public&sort=&tag=恋爱&page=1&pageSize=24`,
query: `tag=恋爱&title=❤️‍🔥`,
},
{
title: 'Latest Releases',
remoto: `https://www.clicli.cc/posts?status=&sort=&tag=&uid=&page=1&pageSize=24`,
remoto: `/posts?status=&sort=&tag=&uid=&page=1&pageSize=24`,
query: 'tag=all&title=Latest Releases',
},
]
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 @@ -110,7 +110,7 @@ export default function PlayerPage({ id }: any) {
if (!isAdp) return
player.current?.context.ui?.menu.unregister('Source')
corsAxios
.get(`https://www.clicli.cc/post/${id}`)
.get(`/post/${id}`)
.then((it) => clicliAdapter(it.result))
.then((it) => {
setState(it)
Expand Down
2 changes: 1 addition & 1 deletion packages/index/src/pages/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function SearchPage() {
// setPosts(res.data)
// })
corsAxios
.get(`https://www.clicli.cc/search/posts?key=${encodeURIComponent(k)}`)
.get(`/search/posts?key=${encodeURIComponent(k)}`)
.then((it) => setPosts(cliclisAdapter(it.posts || null) as any))
.catch((err) => {
setPosts([])
Expand Down
8 changes: 3 additions & 5 deletions packages/index/src/pages/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ export default function SearchPage() {
useEffect(() => {
if (tag || tag == 'all') {
setPosts(null)
corsAxios
.get(`https://www.clicli.cc/posts?status=public&sort=&tag=${tag}&uid=&page=${page}&pageSize=24`)
.then((it) => {
setPosts(cliclisAdapter(it.posts))
})
corsAxios.get(`/posts?status=public&sort=&tag=${tag}&uid=&page=${page}&pageSize=24`).then((it) => {
setPosts(cliclisAdapter(it.posts))
})
} else {
store
.keys()
Expand Down
5 changes: 3 additions & 2 deletions packages/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ if (document.location.search.includes('nocors')) {
}

const corsAxios = http.create<R.Response<any>>(
//https://cors-flame.vercel.app/api/cors
localStorage.getItem('cors') == null ? 'https://cors.jinlilili.top/api/cors?url=' : ''
// https://cors-flame.vercel.app/api/cors
// https://cors.jinlilili.top/api/cors?url=
localStorage.getItem('cors') == null ? 'https://cli.airmole.net' : ''
)

export { axios, corsAxios }
2 changes: 1 addition & 1 deletion packages/shared/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class Http<R = any> {

if (__DEV__) console.log(`-> REQUEST: ${method} ${url} data: `, method.toUpperCase(), data)
let rawResponse: Response
return fetch(`${this.baseUrl}${this.baseUrl ? encodeURIComponent(url) : url}`, {
return fetch(`${this.baseUrl}${url}`, {
method,
headers: config,
...this.config,
Expand Down
Loading

0 comments on commit 256dcea

Please sign in to comment.