Add uuid dependency and implement KV storage support in settings and data provider components. Enhance server settings with site key configuration and improve data handling for new KV providers.

This commit is contained in:
SunWuyuan
2025-05-10 17:48:18 +08:00
parent 00a693aeba
commit c0e33dcbf9
12 changed files with 1558 additions and 270 deletions
+26
View File
@@ -0,0 +1,26 @@
import axios from "axios";
import { getSetting } from '@/utils/settings';
// 基本配置
const axiosInstance = axios.create({
// 可以在这里添加基础配置,例如超时时间等
timeout: 10000,
});
// 请求拦截器
axiosInstance.interceptors.request.use(
(requestConfig) => {
// 确保每次请求时都获取最新的 siteKey
const siteKey = getSetting('server.siteKey');
if (siteKey) {
requestConfig.headers["x-site-key"] = siteKey;
}
return requestConfig;
},
(error) => {
console.log(error);
return Promise.reject(error);
}
);
export default axiosInstance;