feat: add clone file

This commit is contained in:
2025-10-12 19:55:33 +08:00
parent 02d5cc9fb0
commit 4dbee366c5
5 changed files with 90 additions and 4 deletions

View File

@@ -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) {