feat: add clone file
This commit is contained in:
@@ -22,6 +22,19 @@ export const getBaseURL = () => {
|
||||
export const query = new Query({
|
||||
url: `${getBaseURL()}/api/router`,
|
||||
});
|
||||
export const getHeader = async () => {
|
||||
const headers: Record<string, string> = {
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
let token = process.env.KEVISUAL_TOKEN;
|
||||
if (!token) {
|
||||
token = await storage.getItem('token');
|
||||
}
|
||||
if (token) {
|
||||
headers['Authorization'] = 'Bearer ' + token;
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
query.beforeRequest = async (config) => {
|
||||
if (config.headers) {
|
||||
|
||||
Reference in New Issue
Block a user