feat(knowledge): add knowledge base detail page components and hooks
refactor(knowledge): restructure knowledge detail page with new components feat(components): add FileUploadDialog for file upload functionality feat(hooks): implement document management hooks for CRUD operations
This commit is contained in:
@@ -85,14 +85,19 @@ const request: AxiosInstance = axios.create({
|
||||
// 请求拦截器
|
||||
request.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
// 转换数据格式
|
||||
if (config.data) {
|
||||
// 转换数据格式 - 跳过FormData对象
|
||||
if (config.data && !(config.data instanceof FormData)) {
|
||||
config.data = convertTheKeysOfTheObjectToSnake(config.data);
|
||||
}
|
||||
if (config.params) {
|
||||
config.params = convertTheKeysOfTheObjectToSnake(config.params);
|
||||
}
|
||||
|
||||
// 对于FormData,删除默认的Content-Type让浏览器自动设置
|
||||
if (config.data instanceof FormData) {
|
||||
delete config.headers['Content-Type'];
|
||||
}
|
||||
|
||||
// 添加授权头
|
||||
const authorization = getAuthorization();
|
||||
if (authorization && !config.headers?.skipToken) {
|
||||
|
||||
Reference in New Issue
Block a user