function getProductionFileUrl() { if (typeof window === 'undefined') return '/images/'; return `${window.location.protocol}//${window.location.hostname}:11223/images/`; } const apiConfig = { // 开发环境 development: { baseURL: "", imgUrl: "/open/file/upload", showImgUrl:'http://192.168.110.64:9998/' }, // 生产环境 production: { baseURL: "/culture", imgUrl: "/culture/open/file/upload", showImgUrl: getProductionFileUrl() }, }; export default apiConfig[process.env.VUE_APP_ENV];