
import debugCenter from '@/api/debugCenter/debugCenter';
const uploadConfig = {
  670: {
    api: debugCenter.uploadBoot,   // 670对应接口
    requiredParams: ['deviceIds', 'file']
  },
  6170: {
    api: debugCenter.deviceUploadLogo, 
    requiredParams: ['deviceIds', 'file',] 
  },
  default: {
    api: debugCenter.uploadBoot,
    requiredParams: ['deviceIds', 'file']
  }
};
function handleParams(deviceType, deviceIds, file) {
  const formattedIds = Array.isArray(deviceIds) ? deviceIds : [deviceIds];
  const formData = new FormData();
  formattedIds.forEach(id => formData.append('deviceIds', id));
  formData.append('file', file);
  return formData;
}
export function uploadLogo(deviceType, deviceIds, file) {
  const currentConfig = uploadConfig[deviceType] || uploadConfig.default;
  const formData = handleParams(deviceType, deviceIds, file);
  return currentConfig.api(formData);
}
export default { uploadLogo };