File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,12 +32,20 @@ import { api } from "@Api"
3232const minutes = ref< string| number> (" unknown" )
3333const max = ref< string| number> (" unknown" )
3434const getLimit = async ()=> {
35- const resp = await fetch (` ${ api ()} /alist/ali_open/limit` )
36- const res = await resp .json ()
37- minutes .value = res .minutes
38- max .value = res .max
35+ try {
36+ const resp = await fetch (` ${ api ()} /alist/ali_open/limit` )
37+ const res = await resp .json ()
38+ minutes .value = res .minutes
39+ max .value = res .max
40+ } catch (error) {
41+ // Silently fail during build or when API is not available
42+ console .debug (' Failed to fetch rate limit info:' , error)
43+ }
44+ }
45+ // Only run in browser environment, not during SSR/build
46+ if (typeof window !== " undefined" && typeof fetch !== " undefined" ) {
47+ getLimit ()
3948}
40- typeof fetch !== " undefined" && getLimit ()
4149</script >
4250::: info Aliyundrive VIP
4351
Original file line number Diff line number Diff line change @@ -32,12 +32,20 @@ import { api } from "@Api"
3232const minutes = ref< string| number> (" unknown" )
3333const max = ref< string| number> (" unknown" )
3434const getLimit = async ()=> {
35- const resp = await fetch (` ${ api ()} /alist/ali_open/limit` )
36- const res = await resp .json ()
37- minutes .value = res .minutes
38- max .value = res .max
35+ try {
36+ const resp = await fetch (` ${ api ()} /alist/ali_open/limit` )
37+ const res = await resp .json ()
38+ minutes .value = res .minutes
39+ max .value = res .max
40+ } catch (error) {
41+ // Silently fail during build or when API is not available
42+ console .debug (' Failed to fetch rate limit info:' , error)
43+ }
44+ }
45+ // Only run in browser environment, not during SSR/build
46+ if (typeof window !== " undefined" && typeof fetch !== " undefined" ) {
47+ getLimit ()
3948}
40- typeof fetch !== " undefined" && getLimit ()
4149</script >
4250::: info 阿里云盘会员
4351
You can’t perform that action at this time.
0 commit comments