Compare commits
1 Commits
edb06a5a31
...
66c49ff654
| Author | SHA1 | Date | |
|---|---|---|---|
| 66c49ff654 |
@@ -19,10 +19,21 @@ type RefreshResponse = {
|
||||
|
||||
function centerClient() {
|
||||
const cfg = getRuntimeConfig()
|
||||
return axios.create({
|
||||
const client = axios.create({
|
||||
baseURL: cfg.centerApiBase,
|
||||
timeout: 10000,
|
||||
})
|
||||
|
||||
client.interceptors.request.use((request) => {
|
||||
const { apiKey } = getRuntimeConfig()
|
||||
const requestId = crypto.randomUUID()
|
||||
if (apiKey) request.headers['x-api-key'] = apiKey
|
||||
request.headers['x-request-id'] = requestId
|
||||
request.headers['x-client-name'] = 'fabric-frontend'
|
||||
return request
|
||||
})
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
export async function loginCenter(payload: LoginPayload): Promise<AuthSession> {
|
||||
|
||||
Reference in New Issue
Block a user