mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 17:25:34 +08:00
Merge branch 'main' into main
This commit is contained in:
commit
094c106b7c
@ -61,7 +61,7 @@
|
||||
"tailwindcss": "^3.3.3",
|
||||
"tailwindcss-safe-area": "^0.4.0",
|
||||
"typescript": "^5.2.2",
|
||||
"uuid": "^9.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-pwa": "^0.16.5",
|
||||
"vite-plugin-solid": "^2.7.0",
|
||||
|
@ -156,8 +156,8 @@ dependencies:
|
||||
specifier: ^5.2.2
|
||||
version: 5.2.2
|
||||
uuid:
|
||||
specifier: ^9.0.0
|
||||
version: 9.0.0
|
||||
specifier: ^9.0.1
|
||||
version: 9.0.1
|
||||
vite:
|
||||
specifier: ^4.4.9
|
||||
version: 4.4.9(@types/node@20.6.0)
|
||||
@ -5894,8 +5894,8 @@ packages:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: false
|
||||
|
||||
/uuid@9.0.0:
|
||||
resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
|
||||
/uuid@9.0.1:
|
||||
resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
|
@ -26,9 +26,19 @@ export const [endpointList, setEndpointList] = makePersisted(
|
||||
export const useRequest = () => {
|
||||
const e = endpoint()
|
||||
|
||||
if (!e) {
|
||||
return ky.create({})
|
||||
}
|
||||
|
||||
const headers = new Headers()
|
||||
|
||||
if (e.secret) {
|
||||
headers.set('Authorization', `Bearer ${e.secret}`)
|
||||
}
|
||||
|
||||
return ky.create({
|
||||
prefixUrl: e?.url,
|
||||
headers: { Authorization: e?.secret ? `Bearer ${e.secret}` : '' },
|
||||
prefixUrl: e.url,
|
||||
headers,
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user