新增.gitignore文件以忽略以.aider开头的文件,更新API逻辑以使用全局配置获取OSS相关信息,优化上传组件中的配置获取方式,同时更新依赖项的版本以确保兼容性。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import { getGlobalConfig } from './utils.ts';
|
||||
import type { MinioUploadPolicy, OSSUploadPolicy } from '@d8d-appcontainer/types';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import type {
|
||||
@@ -16,7 +17,7 @@ const API_BASE_URL = '/api';
|
||||
// 获取OSS完整URL
|
||||
export const getOssUrl = (path: string): string => {
|
||||
// 获取全局配置中的OSS_HOST,如果不存在使用默认值
|
||||
const ossHost = (window.CONFIG?.OSS_BASE_URL) || '';
|
||||
const ossHost = getGlobalConfig('OSS_BASE_URL') || '';
|
||||
// 确保path不以/开头
|
||||
const ossPath = path.startsWith('/') ? path.substring(1) : path;
|
||||
return `${ossHost}/${ossPath}`;
|
||||
|
||||
Reference in New Issue
Block a user