5ede69326b
This reverts merge request !74
14 lines
406 B
JavaScript
14 lines
406 B
JavaScript
import request from '@/utils/request'
|
|
import { getToken } from '@/utils/auth'
|
|
import { baseName } from './utils'
|
|
|
|
export async function fetchPeers(authHost, token) {
|
|
return await request({
|
|
baseURL: baseName(authHost),
|
|
url: `/api/v1/instance/peers`,
|
|
method: 'get',
|
|
headers: authHeaders(token)
|
|
})
|
|
}
|
|
|
|
const authHeaders = (token) => token ? { 'Authorization': `Bearer ${getToken()}` } : {}
|