init for deploy files

This commit is contained in:
2024-10-10 00:43:50 +08:00
parent b2acf93806
commit ef21829ffe
23 changed files with 1519 additions and 6 deletions

18
src/module/query.ts Normal file
View File

@@ -0,0 +1,18 @@
import { Query } from '@kevisual/query';
import { getConfig } from './get-config.ts';
const config = getConfig();
export const baseURL = config?.baseURL || 'https://envision.xiongxiao.me';
export const query = new Query({
url: `${baseURL}/api/router`,
});
query.beforeRequest = async (config) => {
if (config.headers) {
const token = await getConfig()?.token;
if (token) {
config.headers['Authorization'] = 'Bearer ' + token;
}
}
return config;
};